xref: /llvm-project/clang/test/CodeGen/X86/amx_avx512_api.c (revision 48803bc8c7be25745a0e623e6753261c07281b06)
1 // RUN: %clang_cc1 %s -flax-vector-conversions=none -ffreestanding -triple=x86_64-unknown-unknown \
2 // RUN: -target-feature +amx-avx512 -target-feature +avx10.2-512 \
3 // RUN: -emit-llvm -o - -Werror -pedantic | FileCheck %s --check-prefixes=CHECK
4 
5 #include <immintrin.h>
6 
7 char buf[1024];
8 #define STRIDE 32
9 
10 char buf2[1024];
11 
12 __m512 test_tile_cvtrowd2ps(__tile1024i a, unsigned b) {
13   //CHECK-LABEL: @test_tile_cvtrowd2ps
14   //CHECK-DAG: call x86_amx @llvm.x86.cast.vector.to.tile.v256i32(<256 x i32> {{%.*}})
15   //CHECK-DAG: call <16 x float> @llvm.x86.tcvtrowd2ps.internal
16  return __tile_cvtrowd2ps(a, b);
17 }
18 
19 __m512bh test_tile_cvtrowps2bf16h(__tile1024i a, unsigned b) {
20   //CHECK-LABEL: @test_tile_cvtrowps2bf16h
21   //CHECK-DAG: call x86_amx @llvm.x86.cast.vector.to.tile.v256i32(<256 x i32> {{%.*}})
22   //CHECK-DAG: call <32 x bfloat> @llvm.x86.tcvtrowps2bf16h.internal
23  return __tile_cvtrowps2bf16h(a, b);
24 }
25 
26 __m512bh test_tile_cvtrowps2bf16l(__tile1024i a, unsigned b) {
27   //CHECK-LABEL: @test_tile_cvtrowps2bf16l
28   //CHECK-DAG: call x86_amx @llvm.x86.cast.vector.to.tile.v256i32(<256 x i32> {{%.*}})
29   //CHECK-DAG: call <32 x bfloat> @llvm.x86.tcvtrowps2bf16l.internal
30  return __tile_cvtrowps2bf16l(a, b);
31 }
32 
33 __m512h test_tile_cvtrowps2phh(__tile1024i a, unsigned b) {
34   //CHECK-LABEL: @test_tile_cvtrowps2phh
35   //CHECK-DAG: call x86_amx @llvm.x86.cast.vector.to.tile.v256i32(<256 x i32> {{%.*}})
36   //CHECK-DAG: call <32 x half> @llvm.x86.tcvtrowps2phh.internal
37  return __tile_cvtrowps2phh(a, b);
38 }
39 
40 __m512h test_tile_cvtrowps2phl(__tile1024i a, unsigned b) {
41   //CHECK-LABEL: @test_tile_cvtrowps2phl
42   //CHECK-DAG: call x86_amx @llvm.x86.cast.vector.to.tile.v256i32(<256 x i32> {{%.*}})
43   //CHECK-DAG: call <32 x half> @llvm.x86.tcvtrowps2phl.internal
44  return __tile_cvtrowps2phl(a, b);
45 }
46 
47 __m512i test_tile_movrow(__tile1024i a, unsigned b) {
48   //CHECK-LABEL: @test_tile_movrow
49   //CHECK-DAG: call x86_amx @llvm.x86.cast.vector.to.tile.v256i32(<256 x i32> {{%.*}})
50   //CHECK-DAG: call <16 x i32> @llvm.x86.tilemovrow.internal
51  return __tile_movrow(a, b);
52 }
53