xref: /llvm-project/clang/test/CodeGen/X86/avxneconvert-builtins.c (revision aee2a35ac4ab4fe62bb0ce4e314966ab9207efd1)
1 // RUN: %clang_cc1 %s -ffreestanding -triple=x86_64-unknown-unknown -target-feature +avx2 -target-feature +avxneconvert \
2 // RUN: -emit-llvm -o - -Wall -Werror -pedantic -Wno-gnu-statement-expression | FileCheck %s
3 // RUN: %clang_cc1 %s -ffreestanding -triple=i386-unknown-unknown  -target-feature +avx2 -target-feature +avxneconvert \
4 // RUN: -emit-llvm -o - -Wall -Werror -pedantic -Wno-gnu-statement-expression | FileCheck %s
5 
6 #include <immintrin.h>
7 #include <stddef.h>
8 
test_mm_bcstnebf16_ps(const void * __A)9 __m128 test_mm_bcstnebf16_ps(const void *__A) {
10   // CHECK-LABEL: @test_mm_bcstnebf16_ps(
11   // CHECK: call <4 x float> @llvm.x86.vbcstnebf162ps128(ptr %{{.*}})
12   return _mm_bcstnebf16_ps(__A);
13 }
14 
test_mm256_bcstnebf16_ps(const void * __A)15 __m256 test_mm256_bcstnebf16_ps(const void *__A) {
16   // CHECK-LABEL: @test_mm256_bcstnebf16_ps(
17   // CHECK: call <8 x float> @llvm.x86.vbcstnebf162ps256(ptr %{{.*}})
18   return _mm256_bcstnebf16_ps(__A);
19 }
20 
test_mm_bcstnesh_ps(const void * __A)21 __m128 test_mm_bcstnesh_ps(const void *__A) {
22   // CHECK-LABEL: @test_mm_bcstnesh_ps(
23   // CHECK: call <4 x float> @llvm.x86.vbcstnesh2ps128(ptr %{{.*}})
24   return _mm_bcstnesh_ps(__A);
25 }
26 
test_mm256_bcstnesh_ps(const void * __A)27 __m256 test_mm256_bcstnesh_ps(const void *__A) {
28   // CHECK-LABEL: @test_mm256_bcstnesh_ps(
29   // CHECK: call <8 x float> @llvm.x86.vbcstnesh2ps256(ptr %{{.*}})
30   return _mm256_bcstnesh_ps(__A);
31 }
32 
test_mm_cvtneebf16_ps(const __m128bh * __A)33 __m128 test_mm_cvtneebf16_ps(const __m128bh *__A) {
34   // CHECK-LABEL: @test_mm_cvtneebf16_ps(
35   // CHECK: call <4 x float> @llvm.x86.vcvtneebf162ps128(ptr %{{.*}})
36   return _mm_cvtneebf16_ps(__A);
37 }
38 
test_mm256_cvtneebf16_ps(const __m256bh * __A)39 __m256 test_mm256_cvtneebf16_ps(const __m256bh *__A) {
40   // CHECK-LABEL: @test_mm256_cvtneebf16_ps(
41   // CHECK: call <8 x float> @llvm.x86.vcvtneebf162ps256(ptr %{{.*}})
42   return _mm256_cvtneebf16_ps(__A);
43 }
44 
test_mm_cvtneeph_ps(const __m128h * __A)45 __m128 test_mm_cvtneeph_ps(const __m128h *__A) {
46   // CHECK-LABEL: @test_mm_cvtneeph_ps(
47   // CHECK: call <4 x float> @llvm.x86.vcvtneeph2ps128(ptr %{{.*}})
48   return _mm_cvtneeph_ps(__A);
49 }
50 
test_mm256_cvtneeph_ps(const __m256h * __A)51 __m256 test_mm256_cvtneeph_ps(const __m256h *__A) {
52   // CHECK-LABEL: @test_mm256_cvtneeph_ps(
53   // CHECK: call <8 x float> @llvm.x86.vcvtneeph2ps256(ptr %{{.*}})
54   return _mm256_cvtneeph_ps(__A);
55 }
56 
test_mm_cvtneobf16_ps(const __m128bh * __A)57 __m128 test_mm_cvtneobf16_ps(const __m128bh *__A) {
58   // CHECK-LABEL: @test_mm_cvtneobf16_ps(
59   // CHECK: call <4 x float> @llvm.x86.vcvtneobf162ps128(ptr %{{.*}})
60   return _mm_cvtneobf16_ps(__A);
61 }
62 
test_mm256_cvtneobf16_ps(const __m256bh * __A)63 __m256 test_mm256_cvtneobf16_ps(const __m256bh *__A) {
64   // CHECK-LABEL: @test_mm256_cvtneobf16_ps(
65   // CHECK: call <8 x float> @llvm.x86.vcvtneobf162ps256(ptr %{{.*}})
66   return _mm256_cvtneobf16_ps(__A);
67 }
68 
test_mm_cvtneoph_ps(const __m128h * __A)69 __m128 test_mm_cvtneoph_ps(const __m128h *__A) {
70   // CHECK-LABEL: @test_mm_cvtneoph_ps(
71   // CHECK: call <4 x float> @llvm.x86.vcvtneoph2ps128(ptr %{{.*}})
72   return _mm_cvtneoph_ps(__A);
73 }
74 
test_mm256_cvtneoph_ps(const __m256h * __A)75 __m256 test_mm256_cvtneoph_ps(const __m256h *__A) {
76   // CHECK-LABEL: @test_mm256_cvtneoph_ps(
77   // CHECK: call <8 x float> @llvm.x86.vcvtneoph2ps256(ptr %{{.*}})
78   return _mm256_cvtneoph_ps(__A);
79 }
80 
test_mm_cvtneps_avx_pbh(__m128 __A)81 __m128bh test_mm_cvtneps_avx_pbh(__m128 __A) {
82   // CHECK-LABEL: @test_mm_cvtneps_avx_pbh(
83   // CHECK: call <8 x bfloat> @llvm.x86.vcvtneps2bf16128(<4 x float> %{{.*}})
84   return _mm_cvtneps_avx_pbh(__A);
85 }
86 
test_mm256_cvtneps_avx_pbh(__m256 __A)87 __m128bh test_mm256_cvtneps_avx_pbh(__m256 __A) {
88   // CHECK-LABEL: @test_mm256_cvtneps_avx_pbh(
89   // CHECK: call <8 x bfloat> @llvm.x86.vcvtneps2bf16256(<8 x float> %{{.*}})
90   return _mm256_cvtneps_avx_pbh(__A);
91 }
92