[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / CodeGen / PowerPC / ppc-smmintrin.c
blob7daef71a61c329e828c239575f8fe40568861925
1 // REQUIRES: powerpc-registered-target
3 // RUN: %clang -S -emit-llvm -target powerpc64le-unknown-linux-gnu -mcpu=pwr8 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
4 // RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s
5 // RUN: %clang -S -emit-llvm -target powerpc64-unknown-linux-gnu -mcpu=pwr8 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
6 // RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s
8 // RUN: %clang -S -emit-llvm -target powerpc64le-unknown-freebsd13.0 -mcpu=pwr8 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
9 // RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s
10 // RUN: %clang -S -emit-llvm -target powerpc64-unknown-freebsd13.0 -mcpu=pwr8 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
11 // RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s
13 // RUN: %clang -S -emit-llvm -target powerpc64le-unknown-linux-gnu -mcpu=pwr10 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
14 // RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s --check-prefix=P10
15 // RUN: %clang -S -emit-llvm -target powerpc64-unknown-linux-gnu -mcpu=pwr10 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
16 // RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s --check-prefix=P10
18 // RUN: %clang -x c++ -S -emit-llvm -target powerpc64le-unknown-linux-gnu -mcpu=pwr8 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
19 // RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -fsyntax-only
20 // RUN: %clang -x c++ -S -emit-llvm -target powerpc64le-unknown-linux-gnu -mcpu=pwr10 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
21 // RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -fsyntax-only
23 // RUN: %clang -S -emit-llvm -target powerpc64le-unknown-freebsd13.0 -mcpu=pwr8 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
24 // RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s
25 // RUN: %clang -S -emit-llvm -target powerpc64-unknown-freebsd13.0 -mcpu=pwr8 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
26 // RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s
28 // RUN: %clang -S -emit-llvm -target powerpc64-ibm-aix -mcpu=pwr10 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
29 // RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s --check-prefix=P10
30 // RUN: %clang -S -emit-llvm -target powerpc64-ibm-aix -mcpu=pwr8 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
31 // RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s
33 #include <smmintrin.h>
35 __m128 mn1, mn2;
36 __m128d md1, md2;
37 __m128i mi, m1, m2;
39 void __attribute__((noinline))
40 test_extract() {
41 _mm_extract_epi8(mi, 0);
42 _mm_extract_epi32(mi, 0);
43 _mm_extract_epi64(mi, 0);
44 _mm_extract_ps((__m128)mi, 0);
47 // CHECK-LABEL: @test_extract
49 // CHECK-LABEL: define available_externally signext i32 @_mm_extract_epi8(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}}, i32 noundef signext %{{[0-9a-zA-Z_.]+}})
50 // CHECK: %[[AND:[0-9a-zA-Z_.]+]] = and i32 %{{[0-9a-zA-Z_.]+}}, 15
51 // CHECK: %[[EXT:[0-9a-zA-Z_.]+]] = extractelement <16 x i8> %{{[0-9a-zA-Z_.]+}}, i32 %[[AND]]
52 // CHECK: zext i8 %[[EXT]] to i32
54 // CHECK-LABEL: define available_externally signext i32 @_mm_extract_epi32(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}}, i32 noundef signext %{{[0-9a-zA-Z_.]+}})
55 // CHECK: %[[AND:[0-9a-zA-Z_.]+]] = and i32 %{{[0-9a-zA-Z_.]+}}, 3
56 // CHECK: extractelement <4 x i32> %{{[0-9a-zA-Z_.]+}}, i32 %[[AND]]
58 // CHECK-LABEL: define available_externally signext i32 @_mm_extract_epi64(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}}, i32 noundef signext %{{[0-9a-zA-Z_.]+}})
59 // CHECK: %[[AND:[0-9a-zA-Z_.]+]] = and i32 %{{[0-9a-zA-Z_.]+}}, 1
60 // CHECK: %[[EXT:[0-9a-zA-Z_.]+]] = extractelement <2 x i64> %{{[0-9a-zA-Z_.]+}}, i32 %[[AND]]
61 // CHECK: trunc i64 %[[EXT]] to i32
63 // CHECK-LABEL: define available_externally signext i32 @_mm_extract_ps(<4 x float> noundef %{{[0-9a-zA-Z_.]+}}, i32 noundef signext %{{[0-9a-zA-Z_.]+}})
64 // CHECK: %[[AND:[0-9a-zA-Z_.]+]] = and i32 %{{[0-9a-zA-Z_.]+}}, 3
65 // CHECK: extractelement <4 x i32> %{{[0-9a-zA-Z_.]+}}, i32 %[[AND]]
67 void __attribute__((noinline))
68 test_blend() {
69 _mm_blend_epi16(m1, m2, 0);
70 _mm_blendv_epi8(m1, m2, mi);
71 _mm_blend_ps(mn1, mn2, 0);
72 _mm_blendv_ps(mn1, mn2, mn1);
73 _mm_blend_pd(md1, md2, 0);
74 _mm_blendv_pd(md1, md2, md1);
77 // CHECK-LABEL: @test_blend
79 // CHECK-LABEL: define available_externally <2 x i64> @_mm_blend_epi16(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}}, <2 x i64> noundef %{{[0-9a-zA-Z_.]+}}, i32 noundef signext %{{[0-9a-zA-Z_.]+}})
80 // CHECK: %[[TRUNC:[0-9a-zA-Z_.]+]] = trunc i32 %{{[0-9a-zA-Z_.]+}} to i8
81 // CHECK: call <16 x i8> @vec_splats(unsigned char)(i8 noundef zeroext %[[TRUNC]])
82 // CHECK: call <16 x i8> @llvm.ppc.altivec.vgbbd(<16 x i8> %{{[0-9a-zA-Z_.]+}})
83 // CHECK: %[[PACK:[0-9a-zA-Z_.]+]] = call <8 x i16> @vec_unpackh(signed char vector[16])
84 // CHECK: store <8 x i16> %[[PACK]], ptr %{{[0-9a-zA-Z_.]+}}, align 16
85 // BE: %[[REVE:[0-9a-zA-Z_.]+]] = call <8 x i16> @vec_reve(unsigned short vector[8])
86 // BE: store <8 x i16> %[[REVE]], ptr %{{[0-9a-zA-Z_.]+}}, align 16
87 // CHECK: call <8 x i16> @vec_sel(unsigned short vector[8], unsigned short vector[8], unsigned short vector[8])
89 // P10-LABEL: define available_externally <2 x i64> @_mm_blendv_epi8(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}}, <2 x i64> noundef %{{[0-9a-zA-Z_.]+}}, <2 x i64> noundef %{{[0-9a-zA-Z_.]+}})
90 // P10: call <16 x i8> @vec_blendv(signed char vector[16], signed char vector[16], unsigned char vector[16])(<16 x i8> noundef %{{[0-9a-zA-Z_.]+}}, <16 x i8> noundef %{{[0-9a-zA-Z_.]+}}, <16 x i8> noundef %{{[0-9a-zA-Z_.]+}})
92 // CHECK-LABEL: define available_externally <2 x i64> @_mm_blendv_epi8(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}}, <2 x i64> noundef %{{[0-9a-zA-Z_.]+}}, <2 x i64> noundef %{{[0-9a-zA-Z_.]+}})
93 // CHECK: call <16 x i8> @vec_splats(unsigned char)(i8 noundef zeroext 7)
94 // CHECK: call <16 x i8> @vec_sra(unsigned char vector[16], unsigned char vector[16])
95 // CHECK: call <16 x i8> @vec_sel(signed char vector[16], signed char vector[16], unsigned char vector[16])
97 void __attribute__((noinline))
98 test_insert() {
99 _mm_insert_epi8(m1, 1, 0);
100 _mm_insert_epi32(m1, 1, 0);
101 _mm_insert_epi64(m1, 0xFFFFFFFF1L, 0);
104 // CHECK-LABEL: @test_insert
106 // CHECK-LABEL: define available_externally <2 x i64> @_mm_insert_epi8(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}}, i32 noundef signext %{{[0-9a-zA-Z_.]+}}, i32 noundef signext %{{[0-9a-zA-Z_.]+}})
107 // CHECK: %[[TRUNC:[0-9a-zA-Z_.]+]] = trunc i32 %{{[0-9a-zA-Z_.]+}} to i8
108 // CHECK: %[[AND:[0-9a-zA-Z_.]+]] = and i32 %{{[0-9a-zA-Z_.]+}}, 15
109 // CHECK: insertelement <16 x i8> %{{[0-9a-zA-Z_.]+}}, i8 %[[TRUNC]], i32 %[[AND]]
111 // CHECK-LABEL: define available_externally <2 x i64> @_mm_insert_epi32(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}}, i32 noundef signext %{{[0-9a-zA-Z_.]+}}, i32 noundef signext %{{[0-9a-zA-Z_.]+}})
112 // CHECK: %[[AND:[0-9a-zA-Z_.]+]] = and i32 %{{[0-9a-zA-Z_.]+}}, 3
113 // CHECK: insertelement <4 x i32> %{{[0-9a-zA-Z_.]+}}, i32 %{{[0-9a-zA-Z_.]+}}, i32 %[[AND]]
115 // CHECK-LABEL: define available_externally <2 x i64> @_mm_insert_epi64(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}}, i64 noundef %{{[0-9a-zA-Z_.]+}}, i32 noundef signext %{{[0-9a-zA-Z_.]+}})
116 // CHECK: %[[AND:[0-9a-zA-Z_.]+]] = and i32 %{{[0-9a-zA-Z_.]+}}, 1
117 // CHECK: insertelement <2 x i64> %{{[0-9a-zA-Z_.]+}}, i64 %{{[0-9a-zA-Z_.]+}}, i32 %[[AND:[0-9a-zA-Z_.]+]]
119 void __attribute__((noinline))
120 test_convert() {
121 _mm_cvtepi16_epi32(m1);
122 _mm_cvtepi16_epi64(m1);
123 _mm_cvtepi32_epi64(m1);
124 _mm_cvtepi8_epi16(m1);
125 _mm_cvtepi8_epi32(m1);
126 _mm_cvtepi8_epi64(m1);
127 _mm_cvtepu16_epi32(m1);
128 _mm_cvtepu16_epi64(m1);
129 _mm_cvtepu32_epi64(m1);
130 _mm_cvtepu8_epi16(m1);
131 _mm_cvtepu8_epi32(m1);
132 _mm_cvtepu8_epi64(m1);
135 // CHECK-LABEL: @test_convert
137 // CHECK-LABEL: define available_externally <2 x i64> @_mm_cvtepi16_epi32(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}})
138 // CHECK: call <4 x i32> @vec_unpackh(short vector[8])
140 // CHECK-LABEL: define available_externally <2 x i64> @_mm_cvtepi16_epi64(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}})
141 // CHECK: call <4 x i32> @vec_unpackh(short vector[8])
142 // CHECK: call <2 x i64> @vec_unpackh(int vector[4])
144 // CHECK-LABEL: define available_externally <2 x i64> @_mm_cvtepi32_epi64(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}})
145 // CHECK: call <2 x i64> @vec_unpackh(int vector[4])
147 // CHECK-LABEL: define available_externally <2 x i64> @_mm_cvtepi8_epi16(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}})
148 // CHECK: call <8 x i16> @vec_unpackh(signed char vector[16])
150 // CHECK-LABEL: define available_externally <2 x i64> @_mm_cvtepi8_epi32(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}})
151 // CHECK: call <8 x i16> @vec_unpackh(signed char vector[16])
152 // CHECK: call <4 x i32> @vec_unpackh(short vector[8])
154 // CHECK-LABEL: define available_externally <2 x i64> @_mm_cvtepi8_epi64(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}})
155 // CHECK: call <8 x i16> @vec_unpackh(signed char vector[16])
156 // CHECK: call <4 x i32> @vec_unpackh(short vector[8])
157 // CHECK: call <2 x i64> @vec_unpackh(int vector[4])
159 // CHECK-LABEL: define available_externally <2 x i64> @_mm_cvtepu16_epi32(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}})
160 // LE: call <8 x i16> @vec_mergeh(unsigned short vector[8], unsigned short vector[8])(<8 x i16> noundef %{{[0-9a-zA-Z_.]+}}, <8 x i16> noundef zeroinitializer)
161 // BE: call <8 x i16> @vec_mergeh(unsigned short vector[8], unsigned short vector[8])(<8 x i16> noundef zeroinitializer, <8 x i16> noundef %{{[0-9a-zA-Z_.]+}})
163 // CHECK-LABEL: define available_externally <2 x i64> @_mm_cvtepu16_epi64(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}})
164 // LE: call <8 x i16> @vec_mergeh(unsigned short vector[8], unsigned short vector[8])(<8 x i16> noundef %{{[0-9a-zA-Z_.]+}}, <8 x i16> noundef zeroinitializer)
165 // LE: call <4 x i32> @vec_mergeh(unsigned int vector[4], unsigned int vector[4])(<4 x i32> noundef %{{[0-9a-zA-Z_.]+}}, <4 x i32> noundef zeroinitializer)
166 // BE: call <8 x i16> @vec_mergeh(unsigned short vector[8], unsigned short vector[8])(<8 x i16> noundef zeroinitializer, <8 x i16> noundef %{{[0-9a-zA-Z_.]+}})
167 // BE: call <4 x i32> @vec_mergeh(unsigned int vector[4], unsigned int vector[4])(<4 x i32> noundef zeroinitializer, <4 x i32> noundef %{{[0-9a-zA-Z_.]+}})
169 // CHECK-LABEL: define available_externally <2 x i64> @_mm_cvtepu32_epi64(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}})
170 // LE: call <4 x i32> @vec_mergeh(unsigned int vector[4], unsigned int vector[4])(<4 x i32> noundef %{{[0-9a-zA-Z_.]+}}, <4 x i32> noundef zeroinitializer)
171 // BE: call <4 x i32> @vec_mergeh(unsigned int vector[4], unsigned int vector[4])(<4 x i32> noundef zeroinitializer, <4 x i32> noundef %{{[0-9a-zA-Z_.]+}})
173 // CHECK-LABEL: define available_externally <2 x i64> @_mm_cvtepu8_epi16(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}})
174 // LE: call <16 x i8> @vec_mergeh(unsigned char vector[16], unsigned char vector[16])(<16 x i8> noundef %{{[0-9a-zA-Z_.]+}}, <16 x i8> noundef zeroinitializer)
175 // BE: call <16 x i8> @vec_mergeh(unsigned char vector[16], unsigned char vector[16])(<16 x i8> noundef zeroinitializer, <16 x i8> noundef %{{[0-9a-zA-Z_.]+}})
177 // CHECK-LABEL: define available_externally <2 x i64> @_mm_cvtepu8_epi32(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}})
178 // LE: call <16 x i8> @vec_mergeh(unsigned char vector[16], unsigned char vector[16])(<16 x i8> noundef %{{[0-9a-zA-Z_.]+}}, <16 x i8> noundef zeroinitializer)
179 // LE: call <8 x i16> @vec_mergeh(unsigned short vector[8], unsigned short vector[8])(<8 x i16> noundef %{{[0-9a-zA-Z_.]+}}, <8 x i16> noundef zeroinitializer)
180 // BE: call <16 x i8> @vec_mergeh(unsigned char vector[16], unsigned char vector[16])(<16 x i8> noundef zeroinitializer, <16 x i8> noundef %{{[0-9a-zA-Z_.]+}})
181 // BE: call <8 x i16> @vec_mergeh(unsigned short vector[8], unsigned short vector[8])(<8 x i16> noundef zeroinitializer, <8 x i16> noundef %{{[0-9a-zA-Z_.]+}})
183 // CHECK-LABEL: define available_externally <2 x i64> @_mm_cvtepu8_epi64(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}})
184 // CHECK: call <16 x i8> @vec_mergeh(unsigned char vector[16], unsigned char vector[16])
185 // CHECK: call <8 x i16> @vec_mergeh(unsigned short vector[8], unsigned short vector[8])
186 // CHECK: call <4 x i32> @vec_mergeh(unsigned int vector[4], unsigned int vector[4])
188 void __attribute__((noinline))
189 test_minmax() {
190 _mm_max_epi32(m1, m2);
191 _mm_max_epi8(m1, m2);
192 _mm_max_epu16(m1, m2);
193 _mm_max_epu32(m1, m2);
194 _mm_min_epi32(m1, m2);
195 _mm_min_epi8(m1, m2);
196 _mm_min_epu16(m1, m2);
197 _mm_min_epu32(m1, m2);
198 _mm_minpos_epu16(m1);
201 // CHECK-LABEL: @test_minmax
203 // CHECK-LABEL: define available_externally <2 x i64> @_mm_max_epi32(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}}, <2 x i64> noundef %{{[0-9a-zA-Z_.]+}})
204 // CHECK: call <4 x i32> @vec_max(int vector[4], int vector[4])
206 // CHECK-LABEL: define available_externally <2 x i64> @_mm_max_epi8(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}}, <2 x i64> noundef %{{[0-9a-zA-Z_.]+}})
207 // CHECK: call <16 x i8> @vec_max(signed char vector[16], signed char vector[16])
209 // CHECK-LABEL: define available_externally <2 x i64> @_mm_max_epu16(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}}, <2 x i64> noundef %{{[0-9a-zA-Z_.]+}})
210 // CHECK: call <8 x i16> @vec_max(unsigned short vector[8], unsigned short vector[8])
212 // CHECK-LABEL: define available_externally <2 x i64> @_mm_max_epu32(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}}, <2 x i64> noundef %{{[0-9a-zA-Z_.]+}})
213 // CHECK: call <4 x i32> @vec_max(unsigned int vector[4], unsigned int vector[4])
215 // CHECK-LABEL: define available_externally <2 x i64> @_mm_min_epi32(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}}, <2 x i64> noundef %{{[0-9a-zA-Z_.]+}})
216 // CHECK: call <4 x i32> @vec_min(int vector[4], int vector[4])
218 // CHECK-LABEL: define available_externally <2 x i64> @_mm_min_epi8(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}}, <2 x i64> noundef %{{[0-9a-zA-Z_.]+}})
219 // CHECK: call <16 x i8> @vec_min(signed char vector[16], signed char vector[16])
221 // CHECK-LABEL: define available_externally <2 x i64> @_mm_min_epu16(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}}, <2 x i64> noundef %{{[0-9a-zA-Z_.]+}})
222 // CHECK: call <8 x i16> @vec_min(unsigned short vector[8], unsigned short vector[8])
224 // CHECK-LABEL: define available_externally <2 x i64> @_mm_min_epu32(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}}, <2 x i64> noundef %{{[0-9a-zA-Z_.]+}})
225 // CHECK: call <4 x i32> @vec_min(unsigned int vector[4], unsigned int vector[4])
227 // CHECK-LABEL: define available_externally <2 x i64> @_mm_minpos_epu16(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}})
228 // CHECK: call void @llvm.memset.p0.i64(ptr align 16 %{{[0-9a-zA-Z_.]+}}, i8 0, i64 16, i1 false)
229 // CHECK: extractelement <8 x i16> %{{[0-9a-zA-Z_.]+}}, i16 %{{[0-9a-zA-Z_.]+}}
230 // CHECK: %[[VEXT:[0-9a-zA-Z_.]+]] = extractelement <8 x i16> %{{[0-9a-zA-Z_.]+}}, i64 %{{[0-9a-zA-Z_.]+}}
231 // CHECK: zext i16 %[[VEXT]] to i32
232 // CHECK: zext i16 %{{[0-9a-zA-Z_.]+}} to i32
233 // CHECK: extractelement <8 x i16> %{{[0-9a-zA-Z_.]+}}, i64 %{{[0-9a-zA-Z_.]+}}
234 // CHECK: add i64 %{{[0-9a-zA-Z_.]+}}, 1
236 void __attribute__((noinline))
237 test_round() {
238 _mm_round_ps(mn1, 0);
239 _mm_round_ss(mn1, mn2, 0);
240 _mm_round_pd(md1, 0);
241 _mm_round_sd(md1, md2, 0);
244 // CHECK-LABEL: @test_round
246 // CHECK-LABEL: define available_externally <4 x float> @_mm_round_ps(<4 x float> noundef %{{[0-9a-zA-Z_.]+}}, i32 noundef signext %{{[0-9a-zA-Z_.]+}})
247 // CHECK: call double @llvm.ppc.readflm()
248 // CHECK: call void @llvm.ppc.mtfsf(i32 3, double %{{[0-9a-zA-Z_.]+}})
249 // CHECK: %{{[0-9a-zA-Z_.]+}} = call <4 x float> asm "", "=^wa,0"
250 // CHECK: call double @llvm.ppc.readflm()
251 // P10: call double @llvm.ppc.mffsl()
252 // CHECK: call double @llvm.ppc.setrnd(i32 0)
253 // CHECK: %{{[0-9a-zA-Z_.]+}} = call <4 x float> asm "", "=^wa,0"
254 // CHECK: call <4 x float> @vec_rint(float vector[4])
255 // CHECK: call void asm sideeffect "", "^wa"
256 // CHECK: call double @llvm.ppc.setrnd(i32 %{{[0-9a-zA-Z_.]+}})
257 // CHECK: call <4 x float> @vec_floor(float vector[4])
258 // CHECK: call <4 x float> @vec_ceil(float vector[4])
259 // CHECK: call <4 x float> @vec_trunc(float vector[4])
260 // CHECK: call <4 x float> @vec_rint(float vector[4])
261 // CHECK: call void asm sideeffect "", "^wa"
262 // CHECK: call double @llvm.ppc.readflm()
263 // P10: call double @llvm.ppc.mffsl()
264 // CHECK: call void @llvm.ppc.mtfsf(i32 3, double %{{[0-9a-zA-Z_.]+}})
266 // CHECK-LABEL: define available_externally <4 x float> @_mm_round_ss(<4 x float> noundef %{{[0-9a-zA-Z_.]+}}, <4 x float> noundef %{{[0-9a-zA-Z_.]+}}, i32 noundef signext %{{[0-9a-zA-Z_.]+}})
267 // CHECK: call <4 x float> @_mm_round_ps(<4 x float> noundef %{{[0-9a-zA-Z_.]+}}, i32 noundef signext %{{[0-9a-zA-Z_.]+}})
268 // CHECK: extractelement <4 x float> %{{[0-9a-zA-Z_.]+}}, i32 0
270 // CHECK-LABEL: define available_externally <2 x double> @_mm_round_pd(<2 x double> noundef %{{[0-9a-zA-Z_.]+}}, i32 noundef signext %{{[0-9a-zA-Z_.]+}})
271 // CHECK: call double @llvm.ppc.readflm()
272 // CHECK: call void @llvm.ppc.mtfsf(i32 3, double %{{[0-9a-zA-Z_.]+}})
273 // CHECK: %{{[0-9a-zA-Z_.]+}} = call <2 x double> asm "", "=^wa,0"
274 // CHECK: call double @llvm.ppc.readflm()
275 // P10: call double @llvm.ppc.mffsl()
276 // CHECK: call double @llvm.ppc.setrnd(i32 0)
277 // CHECK: %{{[0-9a-zA-Z_.]+}} = call <2 x double> asm "", "=^wa,0"
278 // CHECK: call <2 x double> @vec_rint(double vector[2])
279 // CHECK: call void asm sideeffect "", "^wa"
280 // CHECK: call double @llvm.ppc.setrnd(i32 %{{[0-9a-zA-Z_.]+}})
281 // CHECK: call <2 x double> @vec_floor(double vector[2])
282 // CHECK: call <2 x double> @vec_ceil(double vector[2])
283 // CHECK: call <2 x double> @vec_trunc(double vector[2])
284 // CHECK: call <2 x double> @vec_rint(double vector[2])
285 // CHECK: call void asm sideeffect "", "^wa"
286 // CHECK: call double @llvm.ppc.readflm()
287 // P10: call double @llvm.ppc.mffsl()
288 // CHECK: call void @llvm.ppc.mtfsf(i32 3, double %{{[0-9a-zA-Z_.]+}})
290 // CHECK-LABEL: define available_externally <2 x double> @_mm_round_sd(<2 x double> noundef %{{[0-9a-zA-Z_.]+}}, <2 x double> noundef %{{[0-9a-zA-Z_.]+}}, i32 noundef signext %{{[0-9a-zA-Z_.]+}})
291 // CHECK: call <2 x double> @_mm_round_pd(<2 x double> noundef %{{[0-9a-zA-Z_.]+}}, i32 noundef signext %{{[0-9a-zA-Z_.]+}})
292 // CHECK: extractelement <2 x double> %{{[0-9a-zA-Z_.]+}}, i32 0
293 // CHECK: extractelement <2 x double> %{{[0-9a-zA-Z_.]+}}, i32 1
295 void __attribute__((noinline))
296 test_testing() {
297 _mm_testc_si128(m1, m2);
298 _mm_testnzc_si128(m1, m2);
299 _mm_testz_si128(m1, m2);
302 // CHECK-LABEL: @test_testing
304 // CHECK-LABEL: define available_externally signext i32 @_mm_testc_si128(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}}, <2 x i64> noundef %{{[0-9a-zA-Z_.]+}})
305 // CHECK: call <16 x i8> @vec_nor(unsigned char vector[16], unsigned char vector[16])
306 // CHECK: call <16 x i8> @vec_and(unsigned char vector[16], unsigned char vector[16])
307 // CHECK: call signext i32 @vec_all_eq(unsigned char vector[16], unsigned char vector[16])(<16 x i8> noundef %call1, <16 x i8> noundef zeroinitializer)
309 // CHECK-LABEL: define available_externally signext i32 @_mm_testnzc_si128(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}}, <2 x i64> noundef %{{[0-9a-zA-Z_.]+}})
310 // CHECK: call signext i32 @_mm_testz_si128(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}}, <2 x i64> noundef %{{[0-9a-zA-Z_.]+}})
311 // CHECK: call signext i32 @_mm_testc_si128(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}}, <2 x i64> noundef %{{[0-9a-zA-Z_.]+}})
312 // CHECK: zext i1 %{{[0-9a-zA-Z_.]+}} to i32
314 // CHECK-LABEL: define available_externally signext i32 @_mm_testz_si128(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}}, <2 x i64> noundef %{{[0-9a-zA-Z_.]+}})
315 // CHECK: call <16 x i8> @vec_and(unsigned char vector[16], unsigned char vector[16])
316 // CHECK: call signext i32 @vec_all_eq(unsigned char vector[16], unsigned char vector[16])(<16 x i8> noundef %call, <16 x i8> noundef zeroinitializer)
318 void __attribute__((noinline))
319 test_compare() {
320 _mm_cmpeq_epi64(m1, m2);
321 _mm_cmpgt_epi64(m1, m2);
324 // CHECK-LABEL: @test_compare
326 // CHECK-LABEL: define available_externally <2 x i64> @_mm_cmpeq_epi64(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}}, <2 x i64> noundef %{{[0-9a-zA-Z_.]+}})
327 // CHECK: call <2 x i64> @vec_cmpeq(long long vector[2], long long vector[2])
329 // CHECK-LABEL: define available_externally <2 x i64> @_mm_cmpgt_epi64(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}}, <2 x i64> noundef %{{[0-9a-zA-Z_.]+}})
330 // CHECK: call <2 x i64> @vec_cmpgt(long long vector[2], long long vector[2])
332 void __attribute__((noinline))
333 test_mul() {
334 _mm_mul_epi32(m1, m2);
335 _mm_mullo_epi32(m1, m2);
338 // CHECK-LABEL: @test_mul
340 // CHECK-LABEL: define available_externally <2 x i64> @_mm_mul_epi32(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}}, <2 x i64> noundef %{{[0-9a-zA-Z_.]+}})
341 // CHECK: %call = call <2 x i64> @vec_mule(int vector[4], int vector[4])
343 // CHECK-LABEL: define available_externally <2 x i64> @_mm_mullo_epi32(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}}, <2 x i64> noundef %{{[0-9a-zA-Z_.]+}})
344 // CHECK: %call = call <4 x i32> @vec_mul(unsigned int vector[4], unsigned int vector[4])
346 void __attribute__((noinline))
347 test_packus() {
348 _mm_packus_epi32(m1, m2);
351 // CHECK-LABEL: @test_packus
353 // CHECK-LABEL: define available_externally <2 x i64> @_mm_packus_epi32(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}}, <2 x i64> noundef %{{[0-9a-zA-Z_.]+}})
354 // CHECK: call <8 x i16> @vec_packsu(int vector[4], int vector[4])(<4 x i32> noundef %1, <4 x i32> noundef %3)
356 // To test smmintrin.h includes tmmintrin.h
358 void __attribute__((noinline))
359 test_abs_ssse3() {
360 _mm_abs_epi16(m1);
363 // CHECK-LABEL: @test_abs_ssse3
365 // CHECK-LABEL: define available_externally <2 x i64> @_mm_abs_epi16(<2 x i64> noundef %{{[0-9a-zA-Z_.]+}})