xref: /llvm-project/clang/test/CodeGen/X86/amx_transpose_errors.c (revision 813f7c3820d00349fe23bfc6ba26159764541540)
1 // RUN: %clang_cc1 %s -ffreestanding -triple=x86_64-unknown-unknown \
2 // RUN: -target-feature +amx-int8 -target-feature +amx-bf16 -target-feature +amx-transpose \
3 // RUN: -target-feature +avx512f -target-feature +amx-fp16 -target-feature +amx-complex -verify
4 
5 #include <immintrin.h>
6 #include <stddef.h>
7 
8 // Transpose
9 void test_tile_2rpntlvwz0(const void *A, size_t B) {
10   _tile_2rpntlvwz0(8, A, B); // expected-error {{argument value 8 is outside the valid range [0, 7]}}
11 }
12 
13 void test_tile_2rpntlvwz0t1(const void *A, size_t B) {
14   _tile_2rpntlvwz0t1(8, A, B); // expected-error {{argument value 8 is outside the valid range [0, 7]}}
15 }
16 
17 void test_tile_2rpntlvwz1(const void *A, size_t B) {
18   _tile_2rpntlvwz1(8, A, B); // expected-error {{argument value 8 is outside the valid range [0, 7]}}
19 }
20 
21 void test_tile_2rpntlvwz1t1(const void *A, size_t B) {
22   _tile_2rpntlvwz1t1(8, A, B); // expected-error {{argument value 8 is outside the valid range [0, 7]}}
23 }
24 
25 void test_tile_tdpbf16ps()
26 {
27   _tile_tdpbf16ps(8, 2, 3); // expected-error {{argument value 8 is outside the valid range [0, 7]}}
28   _tile_tdpbf16ps(1, 8, 3); // expected-error {{argument value 8 is outside the valid range [0, 7]}}
29   _tile_tdpbf16ps(1, 2, 8); // expected-error {{argument value 8 is outside the valid range [0, 7]}}
30   _tile_tdpbf16ps(1, 1, 3);  // expected-error {{tile arguments must refer to different tiles}}
31   _tile_tdpbf16ps(1, 2, 1);  // expected-error {{tile arguments must refer to different tiles}}
32   _tile_tdpbf16ps(1, 2, 2);  // expected-error {{tile arguments must refer to different tiles}}
33 }
34 
35 void test_tile_tdpfp16ps()
36 {
37   _tile_tdpfp16ps(8, 5, 6); // expected-error {{argument value 8 is outside the valid range [0, 7]}}
38   _tile_tdpfp16ps(1, 8, 6); // expected-error {{argument value 8 is outside the valid range [0, 7]}}
39   _tile_tdpfp16ps(1, 5, 8); // expected-error {{argument value 8 is outside the valid range [0, 7]}}
40   _tile_tdpfp16ps(1, 1, 3);  // expected-error {{tile arguments must refer to different tiles}}
41   _tile_tdpfp16ps(1, 2, 1);  // expected-error {{tile arguments must refer to different tiles}}
42   _tile_tdpfp16ps(1, 2, 2);  // expected-error {{tile arguments must refer to different tiles}}
43 }
44 
45 void test_tile_transposed()
46 {
47   _tile_transposed(8, 2); // expected-error {{argument value 8 is outside the valid range [0, 7]}}
48   _tile_transposed(1, 8); // expected-error {{argument value 8 is outside the valid range [0, 7]}}
49 }
50 
51 void test_tile_tcmmimfp16ps() {
52   _tile_tcmmimfp16ps(16, 2, 3); // expected-error {{argument value 16 is outside the valid range [0, 7]}}
53   _tile_tcmmimfp16ps(1, 26, 3); // expected-error {{argument value 26 is outside the valid range [0, 7]}}
54   _tile_tcmmimfp16ps(1, 2, 36); // expected-error {{argument value 36 is outside the valid range [0, 7]}}
55   _tile_tcmmimfp16ps(1, 1, 3);  // expected-error {{tile arguments must refer to different tiles}}
56 }
57 
58 void test_tile_tcmmrlfp16ps() {
59   _tile_tcmmrlfp16ps(16, 2, 3); // expected-error {{argument value 16 is outside the valid range [0, 7]}}
60   _tile_tcmmrlfp16ps(1, 26, 3); // expected-error {{argument value 26 is outside the valid range [0, 7]}}
61   _tile_tcmmrlfp16ps(1, 2, 36); // expected-error {{argument value 36 is outside the valid range [0, 7]}}
62   _tile_tcmmrlfp16ps(1, 1, 3);  // expected-error {{tile arguments must refer to different tiles}}
63 }
64 
65 void test_tile_conjtcmmimfp16ps() {
66   _tile_conjtcmmimfp16ps(16, 2, 3); // expected-error {{argument value 16 is outside the valid range [0, 7]}}
67   _tile_conjtcmmimfp16ps(1, 26, 3); // expected-error {{argument value 26 is outside the valid range [0, 7]}}
68   _tile_conjtcmmimfp16ps(1, 2, 36); // expected-error {{argument value 36 is outside the valid range [0, 7]}}
69   _tile_conjtcmmimfp16ps(1, 2, 1);  // expected-error {{tile arguments must refer to different tiles}}
70 }
71 
72 void test_tile_conjtfp16() {
73   _tile_conjtfp16(16, 2); // expected-error {{argument value 16 is outside the valid range [0, 7]}}
74   _tile_conjtfp16(1, 26); // expected-error {{argument value 26 is outside the valid range [0, 7]}}
75 }
76