Debian Codegraph @

clang/test/CIR/CodeGenBuiltins/X86/avx512vlbf16-builtins.c

raw
1 // RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx512f -target-feature +avx512vl -target-feature +avx512bf16 -fclangir -emit-cir -o %t.cir -Wall -Werror -Wsign-conversion
2 // RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s
3 // RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx512f -target-feature +avx512vl -target-feature +avx512bf16 -fclangir -emit-llvm -o %t.ll -Wall -Werror -Wsign-conversion
4 // RUN: FileCheck --check-prefixes=LLVM --input-file=%t.ll %s
5 // RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx512f -target-feature +avx512vl -target-feature +avx512bf16 -emit-llvm -o %t.ll -Wall -Werror -Wsign-conversion
6 // RUN: FileCheck --check-prefixes=OGCG --input-file=%t.ll %s
7
8 #include <immintrin.h>
9
10 __m256bh test_mm512_mask_cvtneps_pbh(__m256bh src, __mmask16 k, __m512 a) {
11 // CIR-LABEL: test_mm512_mask_cvtneps_pbh
12 // CIR: cir.call @_mm512_mask_cvtneps_pbh({{.+}}, {{.+}}, {{.+}}) : (!cir.vector<16 x !cir.bf16>, !u16i, !cir.vector<16 x !cir.float>) -> !cir.vector<16 x !cir.bf16>
13
14 // LLVM-LABEL: @test_mm512_mask_cvtneps_pbh
15 // LLVM: call <16 x bfloat> @llvm.x86.avx512bf16.cvtneps2bf16.512
16
17 // OGCG-LABEL: @test_mm512_mask_cvtneps_pbh
18 // OGCG: call <16 x bfloat> @llvm.x86.avx512bf16.cvtneps2bf16.512
19 return _mm512_mask_cvtneps_pbh(src, k, a);
20 }
21
22 __m256bh test_mm512_maskz_cvtneps_pbh(__mmask16 k, __m512 a) {
23 // CIR-LABEL: test_mm512_maskz_cvtneps_pbh
24 // CIR: cir.call @_mm512_maskz_cvtneps_pbh({{.+}}, {{.+}}) : (!u16i, !cir.vector<16 x !cir.float>) -> !cir.vector<16 x !cir.bf16>
25
26 // LLVM-LABEL: @test_mm512_maskz_cvtneps_pbh
27 // LLVM: call <16 x bfloat> @llvm.x86.avx512bf16.cvtneps2bf16.512(<16 x float> {{.+}})
28
29 // OGCG-LABEL: @test_mm512_maskz_cvtneps_pbh
30 // OGCG: call <16 x bfloat> @llvm.x86.avx512bf16.cvtneps2bf16.512(<16 x float> {{.+}})
31 return _mm512_maskz_cvtneps_pbh(k, a);
32 }
33
34
35 __m128bh test_mm256_mask_cvtneps_pbh(__m128bh src, __mmask8 k, __m256 a) {
36 // CIR-LABEL: test_mm256_mask_cvtneps_pbh
37 // CIR: cir.call @_mm256_mask_cvtneps_pbh({{.+}}, {{.+}}, {{.+}}) : (!cir.vector<8 x !cir.bf16>, !u8i, !cir.vector<8 x !cir.float>) -> !cir.vector<8 x !cir.bf16>
38
39 // LLVM-LABEL: @test_mm256_mask_cvtneps_pbh
40 // LLVM: call <8 x bfloat> @llvm.x86.avx512bf16.cvtneps2bf16.256(<8 x float> {{.+}})
41
42 // OGCG-LABEL: @test_mm256_mask_cvtneps_pbh
43 // OGCG: call <8 x bfloat> @llvm.x86.avx512bf16.cvtneps2bf16.256(<8 x float> {{.+}})
44 return _mm256_mask_cvtneps_pbh(src, k, a);
45 }
46
47 __m128bh test_mm256_maskz_cvtneps_pbh(__mmask8 k, __m256 a) {
48 // CIR-LABEL: test_mm256_maskz_cvtneps_pbh
49 // CIR: cir.call @_mm256_maskz_cvtneps_pbh({{.+}}, {{.+}}) : (!u8i, !cir.vector<8 x !cir.float>) -> !cir.vector<8 x !cir.bf16>
50
51 // LLVM-LABEL: @test_mm256_maskz_cvtneps_pbh
52 // LLVM: call <8 x bfloat> @llvm.x86.avx512bf16.cvtneps2bf16.256(<8 x float> {{.+}})
53
54 // OGCG-LABEL: @test_mm256_maskz_cvtneps_pbh
55 // OGCG: call <8 x bfloat> @llvm.x86.avx512bf16.cvtneps2bf16.256(<8 x float> {{.+}})
56 return _mm256_maskz_cvtneps_pbh(k, a);
57 }
58
59 __m128bh test_mm_mask_cvtneps_pbh(__m128bh src, __mmask8 k, __m128 a) {
60 // CIR-LABEL: test_mm_mask_cvtneps_pbh
61 // CIR: cir.call @_mm_mask_cvtneps_pbh({{.+}}, {{.+}}, {{.+}}) : (!cir.vector<8 x !cir.bf16>, !u8i, !cir.vector<4 x !cir.float>) -> !cir.vector<8 x !cir.bf16>{{.+}}
62
63 // LLVM-LABEL: @test_mm_mask_cvtneps_pbh
64 // LLVM: call <8 x bfloat> @llvm.x86.avx512bf16.mask.cvtneps2bf16.128(<4 x float> {{.+}}, <8 x bfloat> {{.+}}, <4 x i1> {{.+}})
65
66 // OGCG-LABEL: @test_mm_mask_cvtneps_pbh
67 // OGCG: call <8 x bfloat> @llvm.x86.avx512bf16.mask.cvtneps2bf16.128(<4 x float> {{.+}}, <8 x bfloat> {{.+}}, <4 x i1> {{.+}})
68 return _mm_mask_cvtneps_pbh(src, k, a);
69 }
70
71 __m128bh test_mm_maskz_cvtneps_pbh(__mmask8 k, __m128 a) {
72 // CIR-LABEL: test_mm_maskz_cvtneps_pbh
73 // CIR: cir.call @_mm_maskz_cvtneps_pbh({{.+}}, {{.+}}) : (!u8i, !cir.vector<4 x !cir.float>) -> !cir.vector<8 x !cir.bf16>
74
75 // LLVM-LABEL: @test_mm_maskz_cvtneps_pbh
76 // LLVM: call <8 x bfloat> @llvm.x86.avx512bf16.mask.cvtneps2bf16.128(<4 x float> {{.+}}, <8 x bfloat> {{.+}}, <4 x i1> {{.+}})
77
78 // OGCG-LABEL: @test_mm_maskz_cvtneps_pbh
79 // OGCG: call <8 x bfloat> @llvm.x86.avx512bf16.mask.cvtneps2bf16.128(<4 x float> {{.+}}, <8 x bfloat> {{.+}}, <4 x i1> {{.+}})
80 return _mm_maskz_cvtneps_pbh(k, a);
81 }