1 // RUN
: %clang_cc1 -triple amdgcn-- -target-cpu gfx940 -verify -S -o - %s
3 typedef float v2f __attribute__
((ext_vector_type(2)));
4 typedef float v4f __attribute__
((ext_vector_type(4)));
5 typedef float v16f __attribute__
((ext_vector_type(16)));
6 typedef int v2i __attribute__
((ext_vector_type(2)));
7 typedef int v4i __attribute__
((ext_vector_type(4)));
8 typedef int v16i __attribute__
((ext_vector_type(16)));
9 typedef half v4h __attribute__
((ext_vector_type(4)));
10 typedef half v8h __attribute__
((ext_vector_type(8)));
11 typedef short v4s __attribute__
((ext_vector_type(4)));
12 typedef short v8s __attribute__
((ext_vector_type(8)));
14 void test_mfma_i32_16x16x32i8
(global v4i
* out
, long a
, long b
, v4i c
, int d
)
16 *out
= __builtin_amdgcn_mfma_i32_16x16x32_i8
(a, b
, c
, d
, 0, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_i32_16x16x32_i8' must be a constant integer}}
17 *out
= __builtin_amdgcn_mfma_i32_16x16x32_i8
(a, b
, c
, 0, d
, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_i32_16x16x32_i8' must be a constant integer}}
18 *out
= __builtin_amdgcn_mfma_i32_16x16x32_i8
(a, b
, c
, 0, 0, d
); // expected-error{{argument to '__builtin_amdgcn_mfma_i32_16x16x32_i8' must be a constant integer}}
21 void test_mfma_i32_32x32x16i8
(global v16i
* out
, long a
, long b
, v16i c
, int d
)
23 *out
= __builtin_amdgcn_mfma_i32_32x32x16_i8
(a, b
, c
, d
, 0, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_i32_32x32x16_i8' must be a constant integer}}
24 *out
= __builtin_amdgcn_mfma_i32_32x32x16_i8
(a, b
, c
, 0, d
, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_i32_32x32x16_i8' must be a constant integer}}
25 *out
= __builtin_amdgcn_mfma_i32_32x32x16_i8
(a, b
, c
, 0, 0, d
); // expected-error{{argument to '__builtin_amdgcn_mfma_i32_32x32x16_i8' must be a constant integer}}
28 void test_mfma_f32_16x16x8xf32
(global v4f
* out
, v2f a
, v2f b
, v4f c
, int d
)
30 *out
= __builtin_amdgcn_mfma_f32_16x16x8_xf32
(a, b
, c
, d
, 0, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_16x16x8_xf32' must be a constant integer}}
31 *out
= __builtin_amdgcn_mfma_f32_16x16x8_xf32
(a, b
, c
, 0, d
, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_16x16x8_xf32' must be a constant integer}}
32 *out
= __builtin_amdgcn_mfma_f32_16x16x8_xf32
(a, b
, c
, 0, 0, d
); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_16x16x8_xf32' must be a constant integer}}
35 void test_mfma_f32_32x32x4xf32
(global v16f
* out
, v2f a
, v2f b
, v16f c
, int d
)
37 *out
= __builtin_amdgcn_mfma_f32_32x32x4_xf32
(a, b
, c
, d
, 0, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_32x32x4_xf32' must be a constant integer}}
38 *out
= __builtin_amdgcn_mfma_f32_32x32x4_xf32
(a, b
, c
, 0, d
, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_32x32x4_xf32' must be a constant integer}}
39 *out
= __builtin_amdgcn_mfma_f32_32x32x4_xf32
(a, b
, c
, 0, 0, d
); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_32x32x4_xf32' must be a constant integer}}
42 void test_mfma_f32_16x16x32_bf8_bf8
(global v4f
* out
, long a
, long b
, v4f c
, int d
)
44 *out
= __builtin_amdgcn_mfma_f32_16x16x32_bf8_bf8
(a, b
, c
, d
, 0, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_16x16x32_bf8_bf8' must be a constant integer}}
45 *out
= __builtin_amdgcn_mfma_f32_16x16x32_bf8_bf8
(a, b
, c
, 0, d
, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_16x16x32_bf8_bf8' must be a constant integer}}
46 *out
= __builtin_amdgcn_mfma_f32_16x16x32_bf8_bf8
(a, b
, c
, 0, 0, d
); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_16x16x32_bf8_bf8' must be a constant integer}}
49 void test_mfma_f32_16x16x32_bf8_fp8
(global v4f
* out
, long a
, long b
, v4f c
, int d
)
51 *out
= __builtin_amdgcn_mfma_f32_16x16x32_bf8_fp8
(a, b
, c
, d
, 0, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_16x16x32_bf8_fp8' must be a constant integer}}
52 *out
= __builtin_amdgcn_mfma_f32_16x16x32_bf8_fp8
(a, b
, c
, 0, d
, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_16x16x32_bf8_fp8' must be a constant integer}}
53 *out
= __builtin_amdgcn_mfma_f32_16x16x32_bf8_fp8
(a, b
, c
, 0, 0, d
); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_16x16x32_bf8_fp8' must be a constant integer}}
56 void test_mfma_f32_16x16x32_fp8_bf8
(global v4f
* out
, long a
, long b
, v4f c
, int d
)
58 *out
= __builtin_amdgcn_mfma_f32_16x16x32_fp8_bf8
(a, b
, c
, d
, 0, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_16x16x32_fp8_bf8' must be a constant integer}}
59 *out
= __builtin_amdgcn_mfma_f32_16x16x32_fp8_bf8
(a, b
, c
, 0, d
, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_16x16x32_fp8_bf8' must be a constant integer}}
60 *out
= __builtin_amdgcn_mfma_f32_16x16x32_fp8_bf8
(a, b
, c
, 0, 0, d
); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_16x16x32_fp8_bf8' must be a constant integer}}
63 void test_mfma_f32_16x16x32_fp8_fp8
(global v4f
* out
, long a
, long b
, v4f c
, int d
)
65 *out
= __builtin_amdgcn_mfma_f32_16x16x32_fp8_fp8
(a, b
, c
, d
, 0, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_16x16x32_fp8_fp8' must be a constant integer}}
66 *out
= __builtin_amdgcn_mfma_f32_16x16x32_fp8_fp8
(a, b
, c
, 0, d
, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_16x16x32_fp8_fp8' must be a constant integer}}
67 *out
= __builtin_amdgcn_mfma_f32_16x16x32_fp8_fp8
(a, b
, c
, 0, 0, d
); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_16x16x32_fp8_fp8' must be a constant integer}}
70 void test_mfma_f32_32x32x16_bf8_bf8
(global v16f
* out
, long a
, long b
, v16f c
, int d
)
72 *out
= __builtin_amdgcn_mfma_f32_32x32x16_bf8_bf8
(a, b
, c
, d
, 0, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_32x32x16_bf8_bf8' must be a constant integer}}
73 *out
= __builtin_amdgcn_mfma_f32_32x32x16_bf8_bf8
(a, b
, c
, 0, d
, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_32x32x16_bf8_bf8' must be a constant integer}}
74 *out
= __builtin_amdgcn_mfma_f32_32x32x16_bf8_bf8
(a, b
, c
, 0, 0, d
); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_32x32x16_bf8_bf8' must be a constant integer}}
77 void test_mfma_f32_32x32x16_bf8_fp8
(global v16f
* out
, long a
, long b
, v16f c
, int d
)
79 *out
= __builtin_amdgcn_mfma_f32_32x32x16_bf8_fp8
(a, b
, c
, d
, 0, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_32x32x16_bf8_fp8' must be a constant integer}}
80 *out
= __builtin_amdgcn_mfma_f32_32x32x16_bf8_fp8
(a, b
, c
, 0, d
, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_32x32x16_bf8_fp8' must be a constant integer}}
81 *out
= __builtin_amdgcn_mfma_f32_32x32x16_bf8_fp8
(a, b
, c
, 0, 0, d
); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_32x32x16_bf8_fp8' must be a constant integer}}
84 void test_mfma_f32_32x32x16_fp8_bf8
(global v16f
* out
, long a
, long b
, v16f c
, int d
)
86 *out
= __builtin_amdgcn_mfma_f32_32x32x16_fp8_bf8
(a, b
, c
, d
, 0, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_32x32x16_fp8_bf8' must be a constant integer}}
87 *out
= __builtin_amdgcn_mfma_f32_32x32x16_fp8_bf8
(a, b
, c
, 0, d
, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_32x32x16_fp8_bf8' must be a constant integer}}
88 *out
= __builtin_amdgcn_mfma_f32_32x32x16_fp8_bf8
(a, b
, c
, 0, 0, d
); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_32x32x16_fp8_bf8' must be a constant integer}}
91 void test_mfma_f32_32x32x16_fp8_fp8
(global v16f
* out
, long a
, long b
, v16f c
, int d
)
93 *out
= __builtin_amdgcn_mfma_f32_32x32x16_fp8_fp8
(a, b
, c
, d
, 0, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_32x32x16_fp8_fp8' must be a constant integer}}
94 *out
= __builtin_amdgcn_mfma_f32_32x32x16_fp8_fp8
(a, b
, c
, 0, d
, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_32x32x16_fp8_fp8' must be a constant integer}}
95 *out
= __builtin_amdgcn_mfma_f32_32x32x16_fp8_fp8
(a, b
, c
, 0, 0, d
); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_32x32x16_fp8_fp8' must be a constant integer}}
98 void test_smfmac_f32_16x16x32_f16
(global v4f
* out
, v4h a
, v8h b
, v4f c
, int idx
, int d
)
100 *out
= __builtin_amdgcn_smfmac_f32_16x16x32_f16
(a, b
, c
, idx
, d
, 0); // expected-error{{argument to '__builtin_amdgcn_smfmac_f32_16x16x32_f16' must be a constant integer}}
101 *out
= __builtin_amdgcn_smfmac_f32_16x16x32_f16
(a, b
, c
, idx
, 0, d
); // expected-error{{argument to '__builtin_amdgcn_smfmac_f32_16x16x32_f16' must be a constant integer}}
104 void test_smfmac_f32_32x32x16_f16
(global v16f
* out
, v4h a
, v8h b
, v16f c
, int idx
, int d
)
106 *out
= __builtin_amdgcn_smfmac_f32_32x32x16_f16
(a, b
, c
, idx
, d
, 0); // expected-error{{argument to '__builtin_amdgcn_smfmac_f32_32x32x16_f16' must be a constant integer}}
107 *out
= __builtin_amdgcn_smfmac_f32_32x32x16_f16
(a, b
, c
, idx
, 0, d
); // expected-error{{argument to '__builtin_amdgcn_smfmac_f32_32x32x16_f16' must be a constant integer}}
110 void test_smfmac_f32_16x16x32_bf16
(global v4f
* out
, v4s a
, v8s b
, v4f c
, int idx
, int d
)
112 *out
= __builtin_amdgcn_smfmac_f32_16x16x32_bf16
(a, b
, c
, idx
, d
, 0); // expected-error{{argument to '__builtin_amdgcn_smfmac_f32_16x16x32_bf16' must be a constant integer}}
113 *out
= __builtin_amdgcn_smfmac_f32_16x16x32_bf16
(a, b
, c
, idx
, 0, d
); // expected-error{{argument to '__builtin_amdgcn_smfmac_f32_16x16x32_bf16' must be a constant integer}}
116 void test_smfmac_f32_32x32x16_bf16
(global v16f
* out
, v4s a
, v8s b
, v16f c
, int idx
, int d
)
118 *out
= __builtin_amdgcn_smfmac_f32_32x32x16_bf16
(a, b
, c
, idx
, d
, 0); // expected-error{{argument to '__builtin_amdgcn_smfmac_f32_32x32x16_bf16' must be a constant integer}}
119 *out
= __builtin_amdgcn_smfmac_f32_32x32x16_bf16
(a, b
, c
, idx
, 0, d
); // expected-error{{argument to '__builtin_amdgcn_smfmac_f32_32x32x16_bf16' must be a constant integer}}
122 void test_smfmac_i32_16x16x64_i8
(global v4i
* out
, v2i a
, v4i b
, v4i c
, int idx
, int d
)
124 *out
= __builtin_amdgcn_smfmac_i32_16x16x64_i8
(a, b
, c
, idx
, d
, 0); // expected-error{{argument to '__builtin_amdgcn_smfmac_i32_16x16x64_i8' must be a constant integer}}
125 *out
= __builtin_amdgcn_smfmac_i32_16x16x64_i8
(a, b
, c
, idx
, 0, d
); // expected-error{{argument to '__builtin_amdgcn_smfmac_i32_16x16x64_i8' must be a constant integer}}
128 void test_smfmac_i32_32x32x32_i8
(global v16i
* out
, v2i a
, v4i b
, v16i c
, int idx
, int d
)
130 *out
= __builtin_amdgcn_smfmac_i32_32x32x32_i8
(a, b
, c
, idx
, d
, 0); // expected-error{{argument to '__builtin_amdgcn_smfmac_i32_32x32x32_i8' must be a constant integer}}
131 *out
= __builtin_amdgcn_smfmac_i32_32x32x32_i8
(a, b
, c
, idx
, 0, d
); // expected-error{{argument to '__builtin_amdgcn_smfmac_i32_32x32x32_i8' must be a constant integer}}
134 void test_smfmac_f32_16x16x64_bf8_bf8
(global v4f
* out
, v2i a
, v4i b
, v4f c
, int idx
, int d
)
136 *out
= __builtin_amdgcn_smfmac_f32_16x16x64_bf8_bf8
(a, b
, c
, idx
, d
, 0); // expected-error{{argument to '__builtin_amdgcn_smfmac_f32_16x16x64_bf8_bf8' must be a constant integer}}
137 *out
= __builtin_amdgcn_smfmac_f32_16x16x64_bf8_bf8
(a, b
, c
, idx
, 0, d
); // expected-error{{argument to '__builtin_amdgcn_smfmac_f32_16x16x64_bf8_bf8' must be a constant integer}}
140 void test_smfmac_f32_16x16x64_bf8_fp8
(global v4f
* out
, v2i a
, v4i b
, v4f c
, int idx
, int d
)
142 *out
= __builtin_amdgcn_smfmac_f32_16x16x64_bf8_fp8
(a, b
, c
, idx
, d
, 0); // expected-error{{argument to '__builtin_amdgcn_smfmac_f32_16x16x64_bf8_fp8' must be a constant integer}}
143 *out
= __builtin_amdgcn_smfmac_f32_16x16x64_bf8_fp8
(a, b
, c
, idx
, 0, d
); // expected-error{{argument to '__builtin_amdgcn_smfmac_f32_16x16x64_bf8_fp8' must be a constant integer}}
146 void test_smfmac_f32_16x16x64_fp8_bf8
(global v4f
* out
, v2i a
, v4i b
, v4f c
, int idx
, int d
)
148 *out
= __builtin_amdgcn_smfmac_f32_16x16x64_fp8_bf8
(a, b
, c
, idx
, d
, 0); // expected-error{{argument to '__builtin_amdgcn_smfmac_f32_16x16x64_fp8_bf8' must be a constant integer}}
149 *out
= __builtin_amdgcn_smfmac_f32_16x16x64_fp8_bf8
(a, b
, c
, idx
, 0, d
); // expected-error{{argument to '__builtin_amdgcn_smfmac_f32_16x16x64_fp8_bf8' must be a constant integer}}
152 void test_smfmac_f32_16x16x64_fp8_fp8
(global v4f
* out
, v2i a
, v4i b
, v4f c
, int idx
, int d
)
154 *out
= __builtin_amdgcn_smfmac_f32_16x16x64_fp8_fp8
(a, b
, c
, idx
, d
, 0); // expected-error{{argument to '__builtin_amdgcn_smfmac_f32_16x16x64_fp8_fp8' must be a constant integer}}
155 *out
= __builtin_amdgcn_smfmac_f32_16x16x64_fp8_fp8
(a, b
, c
, idx
, 0, d
); // expected-error{{argument to '__builtin_amdgcn_smfmac_f32_16x16x64_fp8_fp8' must be a constant integer}}
158 void test_smfmac_f32_32x32x32_bf8_bf8
(global v16f
* out
, v2i a
, v4i b
, v16f c
, int idx
, int d
)
160 *out
= __builtin_amdgcn_smfmac_f32_32x32x32_bf8_bf8
(a, b
, c
, idx
, d
, 0); // expected-error{{argument to '__builtin_amdgcn_smfmac_f32_32x32x32_bf8_bf8' must be a constant integer}}
161 *out
= __builtin_amdgcn_smfmac_f32_32x32x32_bf8_bf8
(a, b
, c
, idx
, 0, d
); // expected-error{{argument to '__builtin_amdgcn_smfmac_f32_32x32x32_bf8_bf8' must be a constant integer}}
164 void test_smfmac_f32_32x32x32_bf8_fp8
(global v16f
* out
, v2i a
, v4i b
, v16f c
, int idx
, int d
)
166 *out
= __builtin_amdgcn_smfmac_f32_32x32x32_bf8_fp8
(a, b
, c
, idx
, d
, 0); // expected-error{{argument to '__builtin_amdgcn_smfmac_f32_32x32x32_bf8_fp8' must be a constant integer}}
167 *out
= __builtin_amdgcn_smfmac_f32_32x32x32_bf8_fp8
(a, b
, c
, idx
, 0, d
); // expected-error{{argument to '__builtin_amdgcn_smfmac_f32_32x32x32_bf8_fp8' must be a constant integer}}
170 void test_smfmac_f32_32x32x32_fp8_bf8
(global v16f
* out
, v2i a
, v4i b
, v16f c
, int idx
, int d
)
172 *out
= __builtin_amdgcn_smfmac_f32_32x32x32_fp8_bf8
(a, b
, c
, idx
, d
, 0); // expected-error{{argument to '__builtin_amdgcn_smfmac_f32_32x32x32_fp8_bf8' must be a constant integer}}
173 *out
= __builtin_amdgcn_smfmac_f32_32x32x32_fp8_bf8
(a, b
, c
, idx
, 0, d
); // expected-error{{argument to '__builtin_amdgcn_smfmac_f32_32x32x32_fp8_bf8' must be a constant integer}}
176 void test_smfmac_f32_32x32x32_fp8_fp8
(global v16f
* out
, v2i a
, v4i b
, v16f c
, int idx
, int d
)
178 *out
= __builtin_amdgcn_smfmac_f32_32x32x32_fp8_fp8
(a, b
, c
, idx
, d
, 0); // expected-error{{argument to '__builtin_amdgcn_smfmac_f32_32x32x32_fp8_fp8' must be a constant integer}}
179 *out
= __builtin_amdgcn_smfmac_f32_32x32x32_fp8_fp8
(a, b
, c
, idx
, 0, d
); // expected-error{{argument to '__builtin_amdgcn_smfmac_f32_32x32x32_fp8_fp8' must be a constant integer}}