1 // RUN
: %clang_cc1 -triple amdgcn-- -target-cpu gfx940 -verify -S -o - %s
2 // RUN
: %clang_cc1 -triple spirv64-amd-amdhsa -verify -S -o - %s
4 typedef float v2f __attribute__
((ext_vector_type(2)));
5 typedef float v4f __attribute__
((ext_vector_type(4)));
6 typedef float v16f __attribute__
((ext_vector_type(16)));
7 typedef int v2i __attribute__
((ext_vector_type(2)));
8 typedef int v4i __attribute__
((ext_vector_type(4)));
9 typedef int v16i __attribute__
((ext_vector_type(16)));
10 typedef half v4h __attribute__
((ext_vector_type(4)));
11 typedef half v8h __attribute__
((ext_vector_type(8)));
12 typedef short v4s __attribute__
((ext_vector_type(4)));
13 typedef short v8s __attribute__
((ext_vector_type(8)));
15 void test_mfma_i32_16x16x32i8
(global v4i
* out
, long a
, long b
, v4i c
, int d
)
17 *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}}
18 *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}}
19 *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}}
22 void test_mfma_i32_32x32x16i8
(global v16i
* out
, long a
, long b
, v16i c
, int d
)
24 *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}}
25 *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}}
26 *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}}
29 void test_mfma_f32_16x16x8xf32
(global v4f
* out
, v2f a
, v2f b
, v4f c
, int d
)
31 *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}}
32 *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}}
33 *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}}
36 void test_mfma_f32_32x32x4xf32
(global v16f
* out
, v2f a
, v2f b
, v16f c
, int d
)
38 *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}}
39 *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}}
40 *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}}
43 void test_mfma_f32_16x16x32_bf8_bf8
(global v4f
* out
, long a
, long b
, v4f c
, int d
)
45 *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}}
46 *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}}
47 *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}}
50 void test_mfma_f32_16x16x32_bf8_fp8
(global v4f
* out
, long a
, long b
, v4f c
, int d
)
52 *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}}
53 *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}}
54 *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}}
57 void test_mfma_f32_16x16x32_fp8_bf8
(global v4f
* out
, long a
, long b
, v4f c
, int d
)
59 *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}}
60 *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}}
61 *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}}
64 void test_mfma_f32_16x16x32_fp8_fp8
(global v4f
* out
, long a
, long b
, v4f c
, int d
)
66 *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}}
67 *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}}
68 *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}}
71 void test_mfma_f32_32x32x16_bf8_bf8
(global v16f
* out
, long a
, long b
, v16f c
, int d
)
73 *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}}
74 *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}}
75 *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}}
78 void test_mfma_f32_32x32x16_bf8_fp8
(global v16f
* out
, long a
, long b
, v16f c
, int d
)
80 *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}}
81 *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}}
82 *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}}
85 void test_mfma_f32_32x32x16_fp8_bf8
(global v16f
* out
, long a
, long b
, v16f c
, int d
)
87 *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}}
88 *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}}
89 *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}}
92 void test_mfma_f32_32x32x16_fp8_fp8
(global v16f
* out
, long a
, long b
, v16f c
, int d
)
94 *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}}
95 *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}}
96 *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}}
99 void test_smfmac_f32_16x16x32_f16
(global v4f
* out
, v4h a
, v8h b
, v4f c
, int idx
, int d
)
101 *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}}
102 *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}}
105 void test_smfmac_f32_32x32x16_f16
(global v16f
* out
, v4h a
, v8h b
, v16f c
, int idx
, int d
)
107 *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}}
108 *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}}
111 void test_smfmac_f32_16x16x32_bf16
(global v4f
* out
, v4s a
, v8s b
, v4f c
, int idx
, int d
)
113 *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}}
114 *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}}
117 void test_smfmac_f32_32x32x16_bf16
(global v16f
* out
, v4s a
, v8s b
, v16f c
, int idx
, int d
)
119 *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}}
120 *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}}
123 void test_smfmac_i32_16x16x64_i8
(global v4i
* out
, v2i a
, v4i b
, v4i c
, int idx
, int d
)
125 *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}}
126 *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}}
129 void test_smfmac_i32_32x32x32_i8
(global v16i
* out
, v2i a
, v4i b
, v16i c
, int idx
, int d
)
131 *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}}
132 *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}}
135 void test_smfmac_f32_16x16x64_bf8_bf8
(global v4f
* out
, v2i a
, v4i b
, v4f c
, int idx
, int d
)
137 *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}}
138 *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}}
141 void test_smfmac_f32_16x16x64_bf8_fp8
(global v4f
* out
, v2i a
, v4i b
, v4f c
, int idx
, int d
)
143 *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}}
144 *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}}
147 void test_smfmac_f32_16x16x64_fp8_bf8
(global v4f
* out
, v2i a
, v4i b
, v4f c
, int idx
, int d
)
149 *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}}
150 *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}}
153 void test_smfmac_f32_16x16x64_fp8_fp8
(global v4f
* out
, v2i a
, v4i b
, v4f c
, int idx
, int d
)
155 *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}}
156 *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}}
159 void test_smfmac_f32_32x32x32_bf8_bf8
(global v16f
* out
, v2i a
, v4i b
, v16f c
, int idx
, int d
)
161 *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}}
162 *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}}
165 void test_smfmac_f32_32x32x32_bf8_fp8
(global v16f
* out
, v2i a
, v4i b
, v16f c
, int idx
, int d
)
167 *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}}
168 *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}}
171 void test_smfmac_f32_32x32x32_fp8_bf8
(global v16f
* out
, v2i a
, v4i b
, v16f c
, int idx
, int d
)
173 *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}}
174 *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}}
177 void test_smfmac_f32_32x32x32_fp8_fp8
(global v16f
* out
, v2i a
, v4i b
, v16f c
, int idx
, int d
)
179 *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}}
180 *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}}