1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i386-apple-darwin -mattr=+sse -show-mc-encoding | FileCheck %s --check-prefixes=CHECK,X86,SSE,X86-SSE
3 ; RUN: llc < %s -mtriple=i386-apple-darwin -mattr=+avx -show-mc-encoding | FileCheck %s --check-prefixes=CHECK,X86,AVX,X86-AVX,AVX1,X86-AVX1
4 ; RUN: llc < %s -mtriple=i386-apple-darwin -mattr=+avx512f,+avx512bw,+avx512dq,+avx512vl -show-mc-encoding | FileCheck %s --check-prefixes=CHECK,X86,AVX,X86-AVX,AVX512,X86-AVX512
5 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=-sse2 -show-mc-encoding | FileCheck %s --check-prefixes=CHECK,X64,SSE,X64-SSE
6 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=+avx -show-mc-encoding | FileCheck %s --check-prefixes=CHECK,X64,AVX,X64-AVX,AVX1,X64-AVX1
7 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=+avx512f,+avx512bw,+avx512dq,+avx512vl -show-mc-encoding | FileCheck %s --check-prefixes=CHECK,X64,AVX,X64-AVX,AVX512,X64-AVX512
9 define <4 x float> @test_x86_sse_cmp_ps(<4 x float> %a0, <4 x float> %a1) {
10 ; SSE-LABEL: test_x86_sse_cmp_ps:
12 ; SSE-NEXT: cmpordps %xmm1, %xmm0 ## encoding: [0x0f,0xc2,0xc1,0x07]
13 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
15 ; AVX-LABEL: test_x86_sse_cmp_ps:
17 ; AVX-NEXT: vcmpordps %xmm1, %xmm0, %xmm0 ## encoding: [0xc5,0xf8,0xc2,0xc1,0x07]
18 ; AVX-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
19 %res = call <4 x float> @llvm.x86.sse.cmp.ps(<4 x float> %a0, <4 x float> %a1, i8 7) ; <<4 x float>> [#uses=1]
22 declare <4 x float> @llvm.x86.sse.cmp.ps(<4 x float>, <4 x float>, i8) nounwind readnone
25 define <4 x float> @test_x86_sse_cmp_ss(<4 x float> %a0, <4 x float> %a1) {
26 ; SSE-LABEL: test_x86_sse_cmp_ss:
28 ; SSE-NEXT: cmpordss %xmm1, %xmm0 ## encoding: [0xf3,0x0f,0xc2,0xc1,0x07]
29 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
31 ; AVX-LABEL: test_x86_sse_cmp_ss:
33 ; AVX-NEXT: vcmpordss %xmm1, %xmm0, %xmm0 ## encoding: [0xc5,0xfa,0xc2,0xc1,0x07]
34 ; AVX-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
35 %res = call <4 x float> @llvm.x86.sse.cmp.ss(<4 x float> %a0, <4 x float> %a1, i8 7) ; <<4 x float>> [#uses=1]
38 declare <4 x float> @llvm.x86.sse.cmp.ss(<4 x float>, <4 x float>, i8) nounwind readnone
41 define i32 @test_x86_sse_comieq_ss(<4 x float> %a0, <4 x float> %a1) {
42 ; SSE-LABEL: test_x86_sse_comieq_ss:
44 ; SSE-NEXT: comiss %xmm1, %xmm0 ## encoding: [0x0f,0x2f,0xc1]
45 ; SSE-NEXT: setnp %al ## encoding: [0x0f,0x9b,0xc0]
46 ; SSE-NEXT: sete %cl ## encoding: [0x0f,0x94,0xc1]
47 ; SSE-NEXT: andb %al, %cl ## encoding: [0x20,0xc1]
48 ; SSE-NEXT: movzbl %cl, %eax ## encoding: [0x0f,0xb6,0xc1]
49 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
51 ; AVX1-LABEL: test_x86_sse_comieq_ss:
53 ; AVX1-NEXT: vcomiss %xmm1, %xmm0 ## encoding: [0xc5,0xf8,0x2f,0xc1]
54 ; AVX1-NEXT: setnp %al ## encoding: [0x0f,0x9b,0xc0]
55 ; AVX1-NEXT: sete %cl ## encoding: [0x0f,0x94,0xc1]
56 ; AVX1-NEXT: andb %al, %cl ## encoding: [0x20,0xc1]
57 ; AVX1-NEXT: movzbl %cl, %eax ## encoding: [0x0f,0xb6,0xc1]
58 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
60 ; AVX512-LABEL: test_x86_sse_comieq_ss:
62 ; AVX512-NEXT: vcomiss %xmm1, %xmm0 ## EVEX TO VEX Compression encoding: [0xc5,0xf8,0x2f,0xc1]
63 ; AVX512-NEXT: setnp %al ## encoding: [0x0f,0x9b,0xc0]
64 ; AVX512-NEXT: sete %cl ## encoding: [0x0f,0x94,0xc1]
65 ; AVX512-NEXT: andb %al, %cl ## encoding: [0x20,0xc1]
66 ; AVX512-NEXT: movzbl %cl, %eax ## encoding: [0x0f,0xb6,0xc1]
67 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
68 %res = call i32 @llvm.x86.sse.comieq.ss(<4 x float> %a0, <4 x float> %a1) ; <i32> [#uses=1]
71 declare i32 @llvm.x86.sse.comieq.ss(<4 x float>, <4 x float>) nounwind readnone
74 define i32 @test_x86_sse_comige_ss(<4 x float> %a0, <4 x float> %a1) {
75 ; SSE-LABEL: test_x86_sse_comige_ss:
77 ; SSE-NEXT: xorl %eax, %eax ## encoding: [0x31,0xc0]
78 ; SSE-NEXT: comiss %xmm1, %xmm0 ## encoding: [0x0f,0x2f,0xc1]
79 ; SSE-NEXT: setae %al ## encoding: [0x0f,0x93,0xc0]
80 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
82 ; AVX1-LABEL: test_x86_sse_comige_ss:
84 ; AVX1-NEXT: xorl %eax, %eax ## encoding: [0x31,0xc0]
85 ; AVX1-NEXT: vcomiss %xmm1, %xmm0 ## encoding: [0xc5,0xf8,0x2f,0xc1]
86 ; AVX1-NEXT: setae %al ## encoding: [0x0f,0x93,0xc0]
87 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
89 ; AVX512-LABEL: test_x86_sse_comige_ss:
91 ; AVX512-NEXT: xorl %eax, %eax ## encoding: [0x31,0xc0]
92 ; AVX512-NEXT: vcomiss %xmm1, %xmm0 ## EVEX TO VEX Compression encoding: [0xc5,0xf8,0x2f,0xc1]
93 ; AVX512-NEXT: setae %al ## encoding: [0x0f,0x93,0xc0]
94 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
95 %res = call i32 @llvm.x86.sse.comige.ss(<4 x float> %a0, <4 x float> %a1) ; <i32> [#uses=1]
98 declare i32 @llvm.x86.sse.comige.ss(<4 x float>, <4 x float>) nounwind readnone
101 define i32 @test_x86_sse_comigt_ss(<4 x float> %a0, <4 x float> %a1) {
102 ; SSE-LABEL: test_x86_sse_comigt_ss:
104 ; SSE-NEXT: xorl %eax, %eax ## encoding: [0x31,0xc0]
105 ; SSE-NEXT: comiss %xmm1, %xmm0 ## encoding: [0x0f,0x2f,0xc1]
106 ; SSE-NEXT: seta %al ## encoding: [0x0f,0x97,0xc0]
107 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
109 ; AVX1-LABEL: test_x86_sse_comigt_ss:
111 ; AVX1-NEXT: xorl %eax, %eax ## encoding: [0x31,0xc0]
112 ; AVX1-NEXT: vcomiss %xmm1, %xmm0 ## encoding: [0xc5,0xf8,0x2f,0xc1]
113 ; AVX1-NEXT: seta %al ## encoding: [0x0f,0x97,0xc0]
114 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
116 ; AVX512-LABEL: test_x86_sse_comigt_ss:
118 ; AVX512-NEXT: xorl %eax, %eax ## encoding: [0x31,0xc0]
119 ; AVX512-NEXT: vcomiss %xmm1, %xmm0 ## EVEX TO VEX Compression encoding: [0xc5,0xf8,0x2f,0xc1]
120 ; AVX512-NEXT: seta %al ## encoding: [0x0f,0x97,0xc0]
121 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
122 %res = call i32 @llvm.x86.sse.comigt.ss(<4 x float> %a0, <4 x float> %a1) ; <i32> [#uses=1]
125 declare i32 @llvm.x86.sse.comigt.ss(<4 x float>, <4 x float>) nounwind readnone
128 define i32 @test_x86_sse_comile_ss(<4 x float> %a0, <4 x float> %a1) {
129 ; SSE-LABEL: test_x86_sse_comile_ss:
131 ; SSE-NEXT: xorl %eax, %eax ## encoding: [0x31,0xc0]
132 ; SSE-NEXT: comiss %xmm0, %xmm1 ## encoding: [0x0f,0x2f,0xc8]
133 ; SSE-NEXT: setae %al ## encoding: [0x0f,0x93,0xc0]
134 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
136 ; AVX1-LABEL: test_x86_sse_comile_ss:
138 ; AVX1-NEXT: xorl %eax, %eax ## encoding: [0x31,0xc0]
139 ; AVX1-NEXT: vcomiss %xmm0, %xmm1 ## encoding: [0xc5,0xf8,0x2f,0xc8]
140 ; AVX1-NEXT: setae %al ## encoding: [0x0f,0x93,0xc0]
141 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
143 ; AVX512-LABEL: test_x86_sse_comile_ss:
145 ; AVX512-NEXT: xorl %eax, %eax ## encoding: [0x31,0xc0]
146 ; AVX512-NEXT: vcomiss %xmm0, %xmm1 ## EVEX TO VEX Compression encoding: [0xc5,0xf8,0x2f,0xc8]
147 ; AVX512-NEXT: setae %al ## encoding: [0x0f,0x93,0xc0]
148 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
149 %res = call i32 @llvm.x86.sse.comile.ss(<4 x float> %a0, <4 x float> %a1) ; <i32> [#uses=1]
152 declare i32 @llvm.x86.sse.comile.ss(<4 x float>, <4 x float>) nounwind readnone
155 define i32 @test_x86_sse_comilt_ss(<4 x float> %a0, <4 x float> %a1) {
156 ; SSE-LABEL: test_x86_sse_comilt_ss:
158 ; SSE-NEXT: xorl %eax, %eax ## encoding: [0x31,0xc0]
159 ; SSE-NEXT: comiss %xmm0, %xmm1 ## encoding: [0x0f,0x2f,0xc8]
160 ; SSE-NEXT: seta %al ## encoding: [0x0f,0x97,0xc0]
161 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
163 ; AVX1-LABEL: test_x86_sse_comilt_ss:
165 ; AVX1-NEXT: xorl %eax, %eax ## encoding: [0x31,0xc0]
166 ; AVX1-NEXT: vcomiss %xmm0, %xmm1 ## encoding: [0xc5,0xf8,0x2f,0xc8]
167 ; AVX1-NEXT: seta %al ## encoding: [0x0f,0x97,0xc0]
168 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
170 ; AVX512-LABEL: test_x86_sse_comilt_ss:
172 ; AVX512-NEXT: xorl %eax, %eax ## encoding: [0x31,0xc0]
173 ; AVX512-NEXT: vcomiss %xmm0, %xmm1 ## EVEX TO VEX Compression encoding: [0xc5,0xf8,0x2f,0xc8]
174 ; AVX512-NEXT: seta %al ## encoding: [0x0f,0x97,0xc0]
175 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
176 %res = call i32 @llvm.x86.sse.comilt.ss(<4 x float> %a0, <4 x float> %a1) ; <i32> [#uses=1]
179 declare i32 @llvm.x86.sse.comilt.ss(<4 x float>, <4 x float>) nounwind readnone
182 define i32 @test_x86_sse_comineq_ss(<4 x float> %a0, <4 x float> %a1) {
183 ; SSE-LABEL: test_x86_sse_comineq_ss:
185 ; SSE-NEXT: comiss %xmm1, %xmm0 ## encoding: [0x0f,0x2f,0xc1]
186 ; SSE-NEXT: setp %al ## encoding: [0x0f,0x9a,0xc0]
187 ; SSE-NEXT: setne %cl ## encoding: [0x0f,0x95,0xc1]
188 ; SSE-NEXT: orb %al, %cl ## encoding: [0x08,0xc1]
189 ; SSE-NEXT: movzbl %cl, %eax ## encoding: [0x0f,0xb6,0xc1]
190 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
192 ; AVX1-LABEL: test_x86_sse_comineq_ss:
194 ; AVX1-NEXT: vcomiss %xmm1, %xmm0 ## encoding: [0xc5,0xf8,0x2f,0xc1]
195 ; AVX1-NEXT: setp %al ## encoding: [0x0f,0x9a,0xc0]
196 ; AVX1-NEXT: setne %cl ## encoding: [0x0f,0x95,0xc1]
197 ; AVX1-NEXT: orb %al, %cl ## encoding: [0x08,0xc1]
198 ; AVX1-NEXT: movzbl %cl, %eax ## encoding: [0x0f,0xb6,0xc1]
199 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
201 ; AVX512-LABEL: test_x86_sse_comineq_ss:
203 ; AVX512-NEXT: vcomiss %xmm1, %xmm0 ## EVEX TO VEX Compression encoding: [0xc5,0xf8,0x2f,0xc1]
204 ; AVX512-NEXT: setp %al ## encoding: [0x0f,0x9a,0xc0]
205 ; AVX512-NEXT: setne %cl ## encoding: [0x0f,0x95,0xc1]
206 ; AVX512-NEXT: orb %al, %cl ## encoding: [0x08,0xc1]
207 ; AVX512-NEXT: movzbl %cl, %eax ## encoding: [0x0f,0xb6,0xc1]
208 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
209 %res = call i32 @llvm.x86.sse.comineq.ss(<4 x float> %a0, <4 x float> %a1) ; <i32> [#uses=1]
212 declare i32 @llvm.x86.sse.comineq.ss(<4 x float>, <4 x float>) nounwind readnone
215 define i32 @test_x86_sse_cvtss2si(<4 x float> %a0) {
216 ; SSE-LABEL: test_x86_sse_cvtss2si:
218 ; SSE-NEXT: cvtss2si %xmm0, %eax ## encoding: [0xf3,0x0f,0x2d,0xc0]
219 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
221 ; AVX1-LABEL: test_x86_sse_cvtss2si:
223 ; AVX1-NEXT: vcvtss2si %xmm0, %eax ## encoding: [0xc5,0xfa,0x2d,0xc0]
224 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
226 ; AVX512-LABEL: test_x86_sse_cvtss2si:
228 ; AVX512-NEXT: vcvtss2si %xmm0, %eax ## EVEX TO VEX Compression encoding: [0xc5,0xfa,0x2d,0xc0]
229 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
230 %res = call i32 @llvm.x86.sse.cvtss2si(<4 x float> %a0) ; <i32> [#uses=1]
233 declare i32 @llvm.x86.sse.cvtss2si(<4 x float>) nounwind readnone
236 define i32 @test_x86_sse_cvttss2si(<4 x float> %a0) {
237 ; SSE-LABEL: test_x86_sse_cvttss2si:
239 ; SSE-NEXT: cvttss2si %xmm0, %eax ## encoding: [0xf3,0x0f,0x2c,0xc0]
240 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
242 ; AVX1-LABEL: test_x86_sse_cvttss2si:
244 ; AVX1-NEXT: vcvttss2si %xmm0, %eax ## encoding: [0xc5,0xfa,0x2c,0xc0]
245 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
247 ; AVX512-LABEL: test_x86_sse_cvttss2si:
249 ; AVX512-NEXT: vcvttss2si %xmm0, %eax ## EVEX TO VEX Compression encoding: [0xc5,0xfa,0x2c,0xc0]
250 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
251 %res = call i32 @llvm.x86.sse.cvttss2si(<4 x float> %a0) ; <i32> [#uses=1]
254 declare i32 @llvm.x86.sse.cvttss2si(<4 x float>) nounwind readnone
257 define void @test_x86_sse_ldmxcsr(i8* %a0) {
258 ; X86-SSE-LABEL: test_x86_sse_ldmxcsr:
260 ; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %eax ## encoding: [0x8b,0x44,0x24,0x04]
261 ; X86-SSE-NEXT: ldmxcsr (%eax) ## encoding: [0x0f,0xae,0x10]
262 ; X86-SSE-NEXT: retl ## encoding: [0xc3]
264 ; X86-AVX-LABEL: test_x86_sse_ldmxcsr:
266 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %eax ## encoding: [0x8b,0x44,0x24,0x04]
267 ; X86-AVX-NEXT: vldmxcsr (%eax) ## encoding: [0xc5,0xf8,0xae,0x10]
268 ; X86-AVX-NEXT: retl ## encoding: [0xc3]
270 ; X64-SSE-LABEL: test_x86_sse_ldmxcsr:
272 ; X64-SSE-NEXT: ldmxcsr (%rdi) ## encoding: [0x0f,0xae,0x17]
273 ; X64-SSE-NEXT: retq ## encoding: [0xc3]
275 ; X64-AVX-LABEL: test_x86_sse_ldmxcsr:
277 ; X64-AVX-NEXT: vldmxcsr (%rdi) ## encoding: [0xc5,0xf8,0xae,0x17]
278 ; X64-AVX-NEXT: retq ## encoding: [0xc3]
279 call void @llvm.x86.sse.ldmxcsr(i8* %a0)
282 declare void @llvm.x86.sse.ldmxcsr(i8*) nounwind
286 define <4 x float> @test_x86_sse_max_ps(<4 x float> %a0, <4 x float> %a1) {
287 ; SSE-LABEL: test_x86_sse_max_ps:
289 ; SSE-NEXT: maxps %xmm1, %xmm0 ## encoding: [0x0f,0x5f,0xc1]
290 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
292 ; AVX1-LABEL: test_x86_sse_max_ps:
294 ; AVX1-NEXT: vmaxps %xmm1, %xmm0, %xmm0 ## encoding: [0xc5,0xf8,0x5f,0xc1]
295 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
297 ; AVX512-LABEL: test_x86_sse_max_ps:
299 ; AVX512-NEXT: vmaxps %xmm1, %xmm0, %xmm0 ## EVEX TO VEX Compression encoding: [0xc5,0xf8,0x5f,0xc1]
300 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
301 %res = call <4 x float> @llvm.x86.sse.max.ps(<4 x float> %a0, <4 x float> %a1) ; <<4 x float>> [#uses=1]
304 declare <4 x float> @llvm.x86.sse.max.ps(<4 x float>, <4 x float>) nounwind readnone
307 define <4 x float> @test_x86_sse_max_ss(<4 x float> %a0, <4 x float> %a1) {
308 ; SSE-LABEL: test_x86_sse_max_ss:
310 ; SSE-NEXT: maxss %xmm1, %xmm0 ## encoding: [0xf3,0x0f,0x5f,0xc1]
311 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
313 ; AVX1-LABEL: test_x86_sse_max_ss:
315 ; AVX1-NEXT: vmaxss %xmm1, %xmm0, %xmm0 ## encoding: [0xc5,0xfa,0x5f,0xc1]
316 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
318 ; AVX512-LABEL: test_x86_sse_max_ss:
320 ; AVX512-NEXT: vmaxss %xmm1, %xmm0, %xmm0 ## EVEX TO VEX Compression encoding: [0xc5,0xfa,0x5f,0xc1]
321 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
322 %res = call <4 x float> @llvm.x86.sse.max.ss(<4 x float> %a0, <4 x float> %a1) ; <<4 x float>> [#uses=1]
325 declare <4 x float> @llvm.x86.sse.max.ss(<4 x float>, <4 x float>) nounwind readnone
328 define <4 x float> @test_x86_sse_min_ps(<4 x float> %a0, <4 x float> %a1) {
329 ; SSE-LABEL: test_x86_sse_min_ps:
331 ; SSE-NEXT: minps %xmm1, %xmm0 ## encoding: [0x0f,0x5d,0xc1]
332 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
334 ; AVX1-LABEL: test_x86_sse_min_ps:
336 ; AVX1-NEXT: vminps %xmm1, %xmm0, %xmm0 ## encoding: [0xc5,0xf8,0x5d,0xc1]
337 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
339 ; AVX512-LABEL: test_x86_sse_min_ps:
341 ; AVX512-NEXT: vminps %xmm1, %xmm0, %xmm0 ## EVEX TO VEX Compression encoding: [0xc5,0xf8,0x5d,0xc1]
342 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
343 %res = call <4 x float> @llvm.x86.sse.min.ps(<4 x float> %a0, <4 x float> %a1) ; <<4 x float>> [#uses=1]
346 declare <4 x float> @llvm.x86.sse.min.ps(<4 x float>, <4 x float>) nounwind readnone
349 define <4 x float> @test_x86_sse_min_ss(<4 x float> %a0, <4 x float> %a1) {
350 ; SSE-LABEL: test_x86_sse_min_ss:
352 ; SSE-NEXT: minss %xmm1, %xmm0 ## encoding: [0xf3,0x0f,0x5d,0xc1]
353 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
355 ; AVX1-LABEL: test_x86_sse_min_ss:
357 ; AVX1-NEXT: vminss %xmm1, %xmm0, %xmm0 ## encoding: [0xc5,0xfa,0x5d,0xc1]
358 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
360 ; AVX512-LABEL: test_x86_sse_min_ss:
362 ; AVX512-NEXT: vminss %xmm1, %xmm0, %xmm0 ## EVEX TO VEX Compression encoding: [0xc5,0xfa,0x5d,0xc1]
363 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
364 %res = call <4 x float> @llvm.x86.sse.min.ss(<4 x float> %a0, <4 x float> %a1) ; <<4 x float>> [#uses=1]
367 declare <4 x float> @llvm.x86.sse.min.ss(<4 x float>, <4 x float>) nounwind readnone
370 define i32 @test_x86_sse_movmsk_ps(<4 x float> %a0) {
371 ; SSE-LABEL: test_x86_sse_movmsk_ps:
373 ; SSE-NEXT: movmskps %xmm0, %eax ## encoding: [0x0f,0x50,0xc0]
374 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
376 ; AVX-LABEL: test_x86_sse_movmsk_ps:
378 ; AVX-NEXT: vmovmskps %xmm0, %eax ## encoding: [0xc5,0xf8,0x50,0xc0]
379 ; AVX-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
380 %res = call i32 @llvm.x86.sse.movmsk.ps(<4 x float> %a0) ; <i32> [#uses=1]
383 declare i32 @llvm.x86.sse.movmsk.ps(<4 x float>) nounwind readnone
387 define <4 x float> @test_x86_sse_rcp_ps(<4 x float> %a0) {
388 ; SSE-LABEL: test_x86_sse_rcp_ps:
390 ; SSE-NEXT: rcpps %xmm0, %xmm0 ## encoding: [0x0f,0x53,0xc0]
391 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
393 ; AVX-LABEL: test_x86_sse_rcp_ps:
395 ; AVX-NEXT: vrcpps %xmm0, %xmm0 ## encoding: [0xc5,0xf8,0x53,0xc0]
396 ; AVX-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
397 %res = call <4 x float> @llvm.x86.sse.rcp.ps(<4 x float> %a0) ; <<4 x float>> [#uses=1]
400 declare <4 x float> @llvm.x86.sse.rcp.ps(<4 x float>) nounwind readnone
403 define <4 x float> @test_x86_sse_rcp_ss(<4 x float> %a0) {
404 ; SSE-LABEL: test_x86_sse_rcp_ss:
406 ; SSE-NEXT: rcpss %xmm0, %xmm0 ## encoding: [0xf3,0x0f,0x53,0xc0]
407 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
409 ; AVX-LABEL: test_x86_sse_rcp_ss:
411 ; AVX-NEXT: vrcpss %xmm0, %xmm0, %xmm0 ## encoding: [0xc5,0xfa,0x53,0xc0]
412 ; AVX-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
413 %res = call <4 x float> @llvm.x86.sse.rcp.ss(<4 x float> %a0) ; <<4 x float>> [#uses=1]
416 declare <4 x float> @llvm.x86.sse.rcp.ss(<4 x float>) nounwind readnone
419 define <4 x float> @test_x86_sse_rsqrt_ps(<4 x float> %a0) {
420 ; SSE-LABEL: test_x86_sse_rsqrt_ps:
422 ; SSE-NEXT: rsqrtps %xmm0, %xmm0 ## encoding: [0x0f,0x52,0xc0]
423 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
425 ; AVX-LABEL: test_x86_sse_rsqrt_ps:
427 ; AVX-NEXT: vrsqrtps %xmm0, %xmm0 ## encoding: [0xc5,0xf8,0x52,0xc0]
428 ; AVX-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
429 %res = call <4 x float> @llvm.x86.sse.rsqrt.ps(<4 x float> %a0) ; <<4 x float>> [#uses=1]
432 declare <4 x float> @llvm.x86.sse.rsqrt.ps(<4 x float>) nounwind readnone
435 define <4 x float> @test_x86_sse_rsqrt_ss(<4 x float> %a0) {
436 ; SSE-LABEL: test_x86_sse_rsqrt_ss:
438 ; SSE-NEXT: rsqrtss %xmm0, %xmm0 ## encoding: [0xf3,0x0f,0x52,0xc0]
439 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
441 ; AVX-LABEL: test_x86_sse_rsqrt_ss:
443 ; AVX-NEXT: vrsqrtss %xmm0, %xmm0, %xmm0 ## encoding: [0xc5,0xfa,0x52,0xc0]
444 ; AVX-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
445 %res = call <4 x float> @llvm.x86.sse.rsqrt.ss(<4 x float> %a0) ; <<4 x float>> [#uses=1]
448 declare <4 x float> @llvm.x86.sse.rsqrt.ss(<4 x float>) nounwind readnone
451 define void @test_x86_sse_stmxcsr(i8* %a0) {
452 ; X86-SSE-LABEL: test_x86_sse_stmxcsr:
454 ; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %eax ## encoding: [0x8b,0x44,0x24,0x04]
455 ; X86-SSE-NEXT: stmxcsr (%eax) ## encoding: [0x0f,0xae,0x18]
456 ; X86-SSE-NEXT: retl ## encoding: [0xc3]
458 ; X86-AVX-LABEL: test_x86_sse_stmxcsr:
460 ; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %eax ## encoding: [0x8b,0x44,0x24,0x04]
461 ; X86-AVX-NEXT: vstmxcsr (%eax) ## encoding: [0xc5,0xf8,0xae,0x18]
462 ; X86-AVX-NEXT: retl ## encoding: [0xc3]
464 ; X64-SSE-LABEL: test_x86_sse_stmxcsr:
466 ; X64-SSE-NEXT: stmxcsr (%rdi) ## encoding: [0x0f,0xae,0x1f]
467 ; X64-SSE-NEXT: retq ## encoding: [0xc3]
469 ; X64-AVX-LABEL: test_x86_sse_stmxcsr:
471 ; X64-AVX-NEXT: vstmxcsr (%rdi) ## encoding: [0xc5,0xf8,0xae,0x1f]
472 ; X64-AVX-NEXT: retq ## encoding: [0xc3]
473 call void @llvm.x86.sse.stmxcsr(i8* %a0)
476 declare void @llvm.x86.sse.stmxcsr(i8*) nounwind
479 define i32 @test_x86_sse_ucomieq_ss(<4 x float> %a0, <4 x float> %a1) {
480 ; SSE-LABEL: test_x86_sse_ucomieq_ss:
482 ; SSE-NEXT: ucomiss %xmm1, %xmm0 ## encoding: [0x0f,0x2e,0xc1]
483 ; SSE-NEXT: setnp %al ## encoding: [0x0f,0x9b,0xc0]
484 ; SSE-NEXT: sete %cl ## encoding: [0x0f,0x94,0xc1]
485 ; SSE-NEXT: andb %al, %cl ## encoding: [0x20,0xc1]
486 ; SSE-NEXT: movzbl %cl, %eax ## encoding: [0x0f,0xb6,0xc1]
487 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
489 ; AVX1-LABEL: test_x86_sse_ucomieq_ss:
491 ; AVX1-NEXT: vucomiss %xmm1, %xmm0 ## encoding: [0xc5,0xf8,0x2e,0xc1]
492 ; AVX1-NEXT: setnp %al ## encoding: [0x0f,0x9b,0xc0]
493 ; AVX1-NEXT: sete %cl ## encoding: [0x0f,0x94,0xc1]
494 ; AVX1-NEXT: andb %al, %cl ## encoding: [0x20,0xc1]
495 ; AVX1-NEXT: movzbl %cl, %eax ## encoding: [0x0f,0xb6,0xc1]
496 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
498 ; AVX512-LABEL: test_x86_sse_ucomieq_ss:
500 ; AVX512-NEXT: vucomiss %xmm1, %xmm0 ## EVEX TO VEX Compression encoding: [0xc5,0xf8,0x2e,0xc1]
501 ; AVX512-NEXT: setnp %al ## encoding: [0x0f,0x9b,0xc0]
502 ; AVX512-NEXT: sete %cl ## encoding: [0x0f,0x94,0xc1]
503 ; AVX512-NEXT: andb %al, %cl ## encoding: [0x20,0xc1]
504 ; AVX512-NEXT: movzbl %cl, %eax ## encoding: [0x0f,0xb6,0xc1]
505 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
506 %res = call i32 @llvm.x86.sse.ucomieq.ss(<4 x float> %a0, <4 x float> %a1) ; <i32> [#uses=1]
509 declare i32 @llvm.x86.sse.ucomieq.ss(<4 x float>, <4 x float>) nounwind readnone
512 define i32 @test_x86_sse_ucomige_ss(<4 x float> %a0, <4 x float> %a1) {
513 ; SSE-LABEL: test_x86_sse_ucomige_ss:
515 ; SSE-NEXT: xorl %eax, %eax ## encoding: [0x31,0xc0]
516 ; SSE-NEXT: ucomiss %xmm1, %xmm0 ## encoding: [0x0f,0x2e,0xc1]
517 ; SSE-NEXT: setae %al ## encoding: [0x0f,0x93,0xc0]
518 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
520 ; AVX1-LABEL: test_x86_sse_ucomige_ss:
522 ; AVX1-NEXT: xorl %eax, %eax ## encoding: [0x31,0xc0]
523 ; AVX1-NEXT: vucomiss %xmm1, %xmm0 ## encoding: [0xc5,0xf8,0x2e,0xc1]
524 ; AVX1-NEXT: setae %al ## encoding: [0x0f,0x93,0xc0]
525 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
527 ; AVX512-LABEL: test_x86_sse_ucomige_ss:
529 ; AVX512-NEXT: xorl %eax, %eax ## encoding: [0x31,0xc0]
530 ; AVX512-NEXT: vucomiss %xmm1, %xmm0 ## EVEX TO VEX Compression encoding: [0xc5,0xf8,0x2e,0xc1]
531 ; AVX512-NEXT: setae %al ## encoding: [0x0f,0x93,0xc0]
532 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
533 %res = call i32 @llvm.x86.sse.ucomige.ss(<4 x float> %a0, <4 x float> %a1) ; <i32> [#uses=1]
536 declare i32 @llvm.x86.sse.ucomige.ss(<4 x float>, <4 x float>) nounwind readnone
539 define i32 @test_x86_sse_ucomigt_ss(<4 x float> %a0, <4 x float> %a1) {
540 ; SSE-LABEL: test_x86_sse_ucomigt_ss:
542 ; SSE-NEXT: xorl %eax, %eax ## encoding: [0x31,0xc0]
543 ; SSE-NEXT: ucomiss %xmm1, %xmm0 ## encoding: [0x0f,0x2e,0xc1]
544 ; SSE-NEXT: seta %al ## encoding: [0x0f,0x97,0xc0]
545 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
547 ; AVX1-LABEL: test_x86_sse_ucomigt_ss:
549 ; AVX1-NEXT: xorl %eax, %eax ## encoding: [0x31,0xc0]
550 ; AVX1-NEXT: vucomiss %xmm1, %xmm0 ## encoding: [0xc5,0xf8,0x2e,0xc1]
551 ; AVX1-NEXT: seta %al ## encoding: [0x0f,0x97,0xc0]
552 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
554 ; AVX512-LABEL: test_x86_sse_ucomigt_ss:
556 ; AVX512-NEXT: xorl %eax, %eax ## encoding: [0x31,0xc0]
557 ; AVX512-NEXT: vucomiss %xmm1, %xmm0 ## EVEX TO VEX Compression encoding: [0xc5,0xf8,0x2e,0xc1]
558 ; AVX512-NEXT: seta %al ## encoding: [0x0f,0x97,0xc0]
559 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
560 %res = call i32 @llvm.x86.sse.ucomigt.ss(<4 x float> %a0, <4 x float> %a1) ; <i32> [#uses=1]
563 declare i32 @llvm.x86.sse.ucomigt.ss(<4 x float>, <4 x float>) nounwind readnone
566 define i32 @test_x86_sse_ucomile_ss(<4 x float> %a0, <4 x float> %a1) {
567 ; SSE-LABEL: test_x86_sse_ucomile_ss:
569 ; SSE-NEXT: xorl %eax, %eax ## encoding: [0x31,0xc0]
570 ; SSE-NEXT: ucomiss %xmm0, %xmm1 ## encoding: [0x0f,0x2e,0xc8]
571 ; SSE-NEXT: setae %al ## encoding: [0x0f,0x93,0xc0]
572 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
574 ; AVX1-LABEL: test_x86_sse_ucomile_ss:
576 ; AVX1-NEXT: xorl %eax, %eax ## encoding: [0x31,0xc0]
577 ; AVX1-NEXT: vucomiss %xmm0, %xmm1 ## encoding: [0xc5,0xf8,0x2e,0xc8]
578 ; AVX1-NEXT: setae %al ## encoding: [0x0f,0x93,0xc0]
579 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
581 ; AVX512-LABEL: test_x86_sse_ucomile_ss:
583 ; AVX512-NEXT: xorl %eax, %eax ## encoding: [0x31,0xc0]
584 ; AVX512-NEXT: vucomiss %xmm0, %xmm1 ## EVEX TO VEX Compression encoding: [0xc5,0xf8,0x2e,0xc8]
585 ; AVX512-NEXT: setae %al ## encoding: [0x0f,0x93,0xc0]
586 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
587 %res = call i32 @llvm.x86.sse.ucomile.ss(<4 x float> %a0, <4 x float> %a1) ; <i32> [#uses=1]
590 declare i32 @llvm.x86.sse.ucomile.ss(<4 x float>, <4 x float>) nounwind readnone
593 define i32 @test_x86_sse_ucomilt_ss(<4 x float> %a0, <4 x float> %a1) {
594 ; SSE-LABEL: test_x86_sse_ucomilt_ss:
596 ; SSE-NEXT: xorl %eax, %eax ## encoding: [0x31,0xc0]
597 ; SSE-NEXT: ucomiss %xmm0, %xmm1 ## encoding: [0x0f,0x2e,0xc8]
598 ; SSE-NEXT: seta %al ## encoding: [0x0f,0x97,0xc0]
599 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
601 ; AVX1-LABEL: test_x86_sse_ucomilt_ss:
603 ; AVX1-NEXT: xorl %eax, %eax ## encoding: [0x31,0xc0]
604 ; AVX1-NEXT: vucomiss %xmm0, %xmm1 ## encoding: [0xc5,0xf8,0x2e,0xc8]
605 ; AVX1-NEXT: seta %al ## encoding: [0x0f,0x97,0xc0]
606 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
608 ; AVX512-LABEL: test_x86_sse_ucomilt_ss:
610 ; AVX512-NEXT: xorl %eax, %eax ## encoding: [0x31,0xc0]
611 ; AVX512-NEXT: vucomiss %xmm0, %xmm1 ## EVEX TO VEX Compression encoding: [0xc5,0xf8,0x2e,0xc8]
612 ; AVX512-NEXT: seta %al ## encoding: [0x0f,0x97,0xc0]
613 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
614 %res = call i32 @llvm.x86.sse.ucomilt.ss(<4 x float> %a0, <4 x float> %a1) ; <i32> [#uses=1]
617 declare i32 @llvm.x86.sse.ucomilt.ss(<4 x float>, <4 x float>) nounwind readnone
620 define i32 @test_x86_sse_ucomineq_ss(<4 x float> %a0, <4 x float> %a1) {
621 ; SSE-LABEL: test_x86_sse_ucomineq_ss:
623 ; SSE-NEXT: ucomiss %xmm1, %xmm0 ## encoding: [0x0f,0x2e,0xc1]
624 ; SSE-NEXT: setp %al ## encoding: [0x0f,0x9a,0xc0]
625 ; SSE-NEXT: setne %cl ## encoding: [0x0f,0x95,0xc1]
626 ; SSE-NEXT: orb %al, %cl ## encoding: [0x08,0xc1]
627 ; SSE-NEXT: movzbl %cl, %eax ## encoding: [0x0f,0xb6,0xc1]
628 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
630 ; AVX1-LABEL: test_x86_sse_ucomineq_ss:
632 ; AVX1-NEXT: vucomiss %xmm1, %xmm0 ## encoding: [0xc5,0xf8,0x2e,0xc1]
633 ; AVX1-NEXT: setp %al ## encoding: [0x0f,0x9a,0xc0]
634 ; AVX1-NEXT: setne %cl ## encoding: [0x0f,0x95,0xc1]
635 ; AVX1-NEXT: orb %al, %cl ## encoding: [0x08,0xc1]
636 ; AVX1-NEXT: movzbl %cl, %eax ## encoding: [0x0f,0xb6,0xc1]
637 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
639 ; AVX512-LABEL: test_x86_sse_ucomineq_ss:
641 ; AVX512-NEXT: vucomiss %xmm1, %xmm0 ## EVEX TO VEX Compression encoding: [0xc5,0xf8,0x2e,0xc1]
642 ; AVX512-NEXT: setp %al ## encoding: [0x0f,0x9a,0xc0]
643 ; AVX512-NEXT: setne %cl ## encoding: [0x0f,0x95,0xc1]
644 ; AVX512-NEXT: orb %al, %cl ## encoding: [0x08,0xc1]
645 ; AVX512-NEXT: movzbl %cl, %eax ## encoding: [0x0f,0xb6,0xc1]
646 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
647 %res = call i32 @llvm.x86.sse.ucomineq.ss(<4 x float> %a0, <4 x float> %a1) ; <i32> [#uses=1]
650 declare i32 @llvm.x86.sse.ucomineq.ss(<4 x float>, <4 x float>) nounwind readnone
653 define void @sfence() nounwind {
654 ; CHECK-LABEL: sfence:
656 ; CHECK-NEXT: sfence ## encoding: [0x0f,0xae,0xf8]
657 ; CHECK-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
658 tail call void @llvm.x86.sse.sfence()
661 declare void @llvm.x86.sse.sfence() nounwind