1 // REQUIRES
: amdgpu-registered-target
2 // RUN
: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu gfx1100 -DWMMA_GFX1100_TESTS -S -emit-llvm -o - %s | FileCheck %s --check-prefix
=CHECK-GFX1100
4 typedef float v4f __attribute__
((ext_vector_type(4)));
5 typedef float v8f __attribute__
((ext_vector_type(8)));
6 typedef half v16h __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 v8i __attribute__
((ext_vector_type(8)));
10 typedef short v16s __attribute__
((ext_vector_type(16)));
12 #ifdef WMMA_GFX1100_TESTS
17 // amdgcn_wmma_f32_16x16x16_f16
20 // CHECK-GFX1100-LABEL
: @test_amdgcn_wmma_f32_16x16x16_f16_w32
21 // CHECK-GFX1100
: call
<8 x float
> @llvm.amdgcn.wmma.f32.16x16x16.f16.v8f32
(<16 x half
> %a
, <16 x half
> %b
, <8 x float
> %c
)
22 void test_amdgcn_wmma_f32_16x16x16_f16_w32
(global v8f
* out
, v16h a
, v16h b
, v8f c
)
24 *out
= __builtin_amdgcn_wmma_f32_16x16x16_f16_w32
(a, b
, c
);
28 // amdgcn_wmma_f32_16x16x16_bf16
31 // CHECK-GFX1100-LABEL
: @test_amdgcn_wmma_f32_16x16x16_bf16_w32
32 // CHECK-GFX1100
: call
<8 x float
> @llvm.amdgcn.wmma.f32.16x16x16.bf16.v8f32
(<16 x i16
> %a
, <16 x i16
> %b
, <8 x float
> %c
)
33 void test_amdgcn_wmma_f32_16x16x16_bf16_w32
(global v8f
* out
, v16s a
, v16s b
, v8f c
)
35 *out
= __builtin_amdgcn_wmma_f32_16x16x16_bf16_w32
(a, b
, c
);
39 // amdgcn_wmma_f16_16x16x16_f16
42 // CHECK-GFX1100-LABEL
: @test_amdgcn_wmma_f16_16x16x16_f16_w32
43 // CHECK-GFX1100
: call
<16 x half
> @llvm.amdgcn.wmma.f16.16x16x16.f16.v16f16
(<16 x half
> %a
, <16 x half
> %b
, <16 x half
> %c
, i1 true
)
44 void test_amdgcn_wmma_f16_16x16x16_f16_w32
(global v16h
* out
, v16h a
, v16h b
, v16h c
)
46 *out
= __builtin_amdgcn_wmma_f16_16x16x16_f16_w32
(a, b
, c
, true
);
50 // amdgcn_wmma_bf16_16x16x16_bf16
53 // CHECK-GFX1100-LABEL
: @test_amdgcn_wmma_bf16_16x16x16_bf16_w32
54 // CHECK-GFX1100
: call
<16 x i16
> @llvm.amdgcn.wmma.bf16.16x16x16.bf16.v16i16
(<16 x i16
> %a
, <16 x i16
> %b
, <16 x i16
> %c
, i1 true
)
55 void test_amdgcn_wmma_bf16_16x16x16_bf16_w32
(global v16s
* out
, v16s a
, v16s b
, v16s c
)
57 *out
= __builtin_amdgcn_wmma_bf16_16x16x16_bf16_w32
(a, b
, c
, true
);
61 // amdgcn_wmma_i32_16x16x16_iu8
64 // CHECK-GFX1100-LABEL
: @test_amdgcn_wmma_i32_16x16x16_iu8_w32
65 // CHECK-GFX1100
: call
<8 x i32
> @llvm.amdgcn.wmma.i32.16x16x16.iu8.v8i32
(i1 true
, <4 x i32
> %a
, i1 true
, <4 x i32
> %b
, <8 x i32
> %c
, i1 false
)
66 void test_amdgcn_wmma_i32_16x16x16_iu8_w32
(global v8i
* out
, v4i a
, v4i b
, v8i c
)
68 *out
= __builtin_amdgcn_wmma_i32_16x16x16_iu8_w32
(true, a
, true
, b
, c
, false
);
72 // amdgcn_wmma_i32_16x16x16_iu4
75 // CHECK-GFX1100-LABEL
: @test_amdgcn_wmma_i32_16x16x16_iu4_w32
76 // CHECK-GFX1100
: call
<8 x i32
> @llvm.amdgcn.wmma.i32.16x16x16.iu4.v8i32
(i1 true
, <2 x i32
> %a
, i1 true
, <2 x i32
> %b
, <8 x i32
> %c
, i1 false
)
77 void test_amdgcn_wmma_i32_16x16x16_iu4_w32
(global v8i
* out
, v2i a
, v2i b
, v8i c
)
79 *out
= __builtin_amdgcn_wmma_i32_16x16x16_iu4_w32
(true, a
, true
, b
, c
, false
);