1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-linux | FileCheck %s -check-prefix=CHECK-32
3 ; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s -check-prefix=CHECK-64
5 define i1 @is_nan_f80(x86_fp80 %x) {
6 ; CHECK-32-LABEL: is_nan_f80:
7 ; CHECK-32: # %bb.0: # %entry
8 ; CHECK-32-NEXT: fldt {{[0-9]+}}(%esp)
9 ; CHECK-32-NEXT: fucomp %st(0)
10 ; CHECK-32-NEXT: fnstsw %ax
11 ; CHECK-32-NEXT: # kill: def $ah killed $ah killed $ax
13 ; CHECK-32-NEXT: setp %al
16 ; CHECK-64-LABEL: is_nan_f80:
17 ; CHECK-64: # %bb.0: # %entry
18 ; CHECK-64-NEXT: fldt {{[0-9]+}}(%rsp)
19 ; CHECK-64-NEXT: fucompi %st(0), %st
20 ; CHECK-64-NEXT: setp %al
23 %0 = tail call i1 @llvm.is.fpclass.f80(x86_fp80 %x, i32 3) ; "nan"
27 define i1 @is_nan_f80_strict(x86_fp80 %x) strictfp {
28 ; CHECK-32-LABEL: is_nan_f80_strict:
29 ; CHECK-32: # %bb.0: # %entry
30 ; CHECK-32-NEXT: pushl %esi
31 ; CHECK-32-NEXT: .cfi_def_cfa_offset 8
32 ; CHECK-32-NEXT: .cfi_offset %esi, -8
33 ; CHECK-32-NEXT: movl {{[0-9]+}}(%esp), %eax
34 ; CHECK-32-NEXT: movzwl {{[0-9]+}}(%esp), %ecx
35 ; CHECK-32-NEXT: andl $32767, %ecx # imm = 0x7FFF
36 ; CHECK-32-NEXT: xorl %edx, %edx
37 ; CHECK-32-NEXT: cmpl {{[0-9]+}}(%esp), %edx
38 ; CHECK-32-NEXT: movl $-2147483648, %esi # imm = 0x80000000
39 ; CHECK-32-NEXT: sbbl %eax, %esi
40 ; CHECK-32-NEXT: movl $32767, %esi # imm = 0x7FFF
41 ; CHECK-32-NEXT: sbbl %ecx, %esi
42 ; CHECK-32-NEXT: sbbl %edx, %edx
43 ; CHECK-32-NEXT: setl %dl
44 ; CHECK-32-NEXT: testl %ecx, %ecx
45 ; CHECK-32-NEXT: sete %cl
46 ; CHECK-32-NEXT: shrl $31, %eax
47 ; CHECK-32-NEXT: xorb %cl, %al
48 ; CHECK-32-NEXT: xorb $1, %al
49 ; CHECK-32-NEXT: orb %dl, %al
50 ; CHECK-32-NEXT: # kill: def $al killed $al killed $eax
51 ; CHECK-32-NEXT: popl %esi
52 ; CHECK-32-NEXT: .cfi_def_cfa_offset 4
55 ; CHECK-64-LABEL: is_nan_f80_strict:
56 ; CHECK-64: # %bb.0: # %entry
57 ; CHECK-64-NEXT: movzwl {{[0-9]+}}(%rsp), %eax
58 ; CHECK-64-NEXT: movq {{[0-9]+}}(%rsp), %rcx
59 ; CHECK-64-NEXT: andl $32767, %eax # imm = 0x7FFF
60 ; CHECK-64-NEXT: movabsq $-9223372036854775808, %rdx # imm = 0x8000000000000000
61 ; CHECK-64-NEXT: cmpq %rcx, %rdx
62 ; CHECK-64-NEXT: movl $32767, %edx # imm = 0x7FFF
63 ; CHECK-64-NEXT: sbbq %rax, %rdx
64 ; CHECK-64-NEXT: setl %dl
65 ; CHECK-64-NEXT: shrq $63, %rcx
66 ; CHECK-64-NEXT: testq %rax, %rax
67 ; CHECK-64-NEXT: sete %al
68 ; CHECK-64-NEXT: xorb %cl, %al
69 ; CHECK-64-NEXT: xorb $1, %al
70 ; CHECK-64-NEXT: orb %dl, %al
73 %0 = tail call i1 @llvm.is.fpclass.f80(x86_fp80 %x, i32 3) strictfp ; "nan"
77 define i1 @is_snan_f80(x86_fp80 %x) {
78 ; CHECK-32-LABEL: is_snan_f80:
79 ; CHECK-32: # %bb.0: # %entry
80 ; CHECK-32-NEXT: pushl %ebx
81 ; CHECK-32-NEXT: .cfi_def_cfa_offset 8
82 ; CHECK-32-NEXT: pushl %esi
83 ; CHECK-32-NEXT: .cfi_def_cfa_offset 12
84 ; CHECK-32-NEXT: .cfi_offset %esi, -12
85 ; CHECK-32-NEXT: .cfi_offset %ebx, -8
86 ; CHECK-32-NEXT: movl {{[0-9]+}}(%esp), %edx
87 ; CHECK-32-NEXT: movzwl {{[0-9]+}}(%esp), %eax
88 ; CHECK-32-NEXT: andl $32767, %eax # imm = 0x7FFF
89 ; CHECK-32-NEXT: xorl %ecx, %ecx
90 ; CHECK-32-NEXT: cmpl {{[0-9]+}}(%esp), %ecx
91 ; CHECK-32-NEXT: movl $-2147483648, %esi # imm = 0x80000000
92 ; CHECK-32-NEXT: sbbl %edx, %esi
93 ; CHECK-32-NEXT: movl $32767, %esi # imm = 0x7FFF
94 ; CHECK-32-NEXT: sbbl %eax, %esi
95 ; CHECK-32-NEXT: movl $0, %esi
96 ; CHECK-32-NEXT: sbbl %esi, %esi
97 ; CHECK-32-NEXT: setl %bl
98 ; CHECK-32-NEXT: cmpl $-1073741824, %edx # imm = 0xC0000000
99 ; CHECK-32-NEXT: sbbl $32767, %eax # imm = 0x7FFF
100 ; CHECK-32-NEXT: sbbl %ecx, %ecx
101 ; CHECK-32-NEXT: setl %al
102 ; CHECK-32-NEXT: andb %bl, %al
103 ; CHECK-32-NEXT: popl %esi
104 ; CHECK-32-NEXT: .cfi_def_cfa_offset 8
105 ; CHECK-32-NEXT: popl %ebx
106 ; CHECK-32-NEXT: .cfi_def_cfa_offset 4
107 ; CHECK-32-NEXT: retl
109 ; CHECK-64-LABEL: is_snan_f80:
110 ; CHECK-64: # %bb.0: # %entry
111 ; CHECK-64-NEXT: movzwl {{[0-9]+}}(%rsp), %eax
112 ; CHECK-64-NEXT: movq {{[0-9]+}}(%rsp), %rcx
113 ; CHECK-64-NEXT: andl $32767, %eax # imm = 0x7FFF
114 ; CHECK-64-NEXT: movabsq $-4611686018427387904, %rdx # imm = 0xC000000000000000
115 ; CHECK-64-NEXT: cmpq %rdx, %rcx
116 ; CHECK-64-NEXT: movq %rax, %rdx
117 ; CHECK-64-NEXT: sbbq $32767, %rdx # imm = 0x7FFF
118 ; CHECK-64-NEXT: setl %dl
119 ; CHECK-64-NEXT: movabsq $-9223372036854775808, %rsi # imm = 0x8000000000000000
120 ; CHECK-64-NEXT: cmpq %rcx, %rsi
121 ; CHECK-64-NEXT: movl $32767, %ecx # imm = 0x7FFF
122 ; CHECK-64-NEXT: sbbq %rax, %rcx
123 ; CHECK-64-NEXT: setl %al
124 ; CHECK-64-NEXT: andb %dl, %al
125 ; CHECK-64-NEXT: retq
127 %0 = tail call i1 @llvm.is.fpclass.f80(x86_fp80 %x, i32 1) ; "snan"
131 define i1 @is_qnan_f80(x86_fp80 %x) {
132 ; CHECK-32-LABEL: is_qnan_f80:
133 ; CHECK-32: # %bb.0: # %entry
134 ; CHECK-32-NEXT: movzwl {{[0-9]+}}(%esp), %eax
135 ; CHECK-32-NEXT: andl $32767, %eax # imm = 0x7FFF
136 ; CHECK-32-NEXT: xorl %ecx, %ecx
137 ; CHECK-32-NEXT: movl $-1073741825, %edx # imm = 0xBFFFFFFF
138 ; CHECK-32-NEXT: cmpl {{[0-9]+}}(%esp), %edx
139 ; CHECK-32-NEXT: movl $32767, %edx # imm = 0x7FFF
140 ; CHECK-32-NEXT: sbbl %eax, %edx
141 ; CHECK-32-NEXT: sbbl %ecx, %ecx
142 ; CHECK-32-NEXT: setl %al
143 ; CHECK-32-NEXT: retl
145 ; CHECK-64-LABEL: is_qnan_f80:
146 ; CHECK-64: # %bb.0: # %entry
147 ; CHECK-64-NEXT: movzwl {{[0-9]+}}(%rsp), %eax
148 ; CHECK-64-NEXT: andl $32767, %eax # imm = 0x7FFF
149 ; CHECK-64-NEXT: movabsq $-4611686018427387905, %rcx # imm = 0xBFFFFFFFFFFFFFFF
150 ; CHECK-64-NEXT: cmpq {{[0-9]+}}(%rsp), %rcx
151 ; CHECK-64-NEXT: movl $32767, %ecx # imm = 0x7FFF
152 ; CHECK-64-NEXT: sbbq %rax, %rcx
153 ; CHECK-64-NEXT: setl %al
154 ; CHECK-64-NEXT: retq
156 %0 = tail call i1 @llvm.is.fpclass.f80(x86_fp80 %x, i32 2) ; "qnan"
160 define i1 @is_zero_f80(x86_fp80 %x) {
161 ; CHECK-32-LABEL: is_zero_f80:
162 ; CHECK-32: # %bb.0: # %entry
163 ; CHECK-32-NEXT: movzwl {{[0-9]+}}(%esp), %eax
164 ; CHECK-32-NEXT: andl $32767, %eax # imm = 0x7FFF
165 ; CHECK-32-NEXT: orl {{[0-9]+}}(%esp), %eax
166 ; CHECK-32-NEXT: orl {{[0-9]+}}(%esp), %eax
167 ; CHECK-32-NEXT: sete %al
168 ; CHECK-32-NEXT: retl
170 ; CHECK-64-LABEL: is_zero_f80:
171 ; CHECK-64: # %bb.0: # %entry
172 ; CHECK-64-NEXT: movzwl {{[0-9]+}}(%rsp), %eax
173 ; CHECK-64-NEXT: andl $32767, %eax # imm = 0x7FFF
174 ; CHECK-64-NEXT: orq {{[0-9]+}}(%rsp), %rax
175 ; CHECK-64-NEXT: sete %al
176 ; CHECK-64-NEXT: retq
178 %0 = tail call i1 @llvm.is.fpclass.f80(x86_fp80 %x, i32 96) ; 0x60 = "zero"
182 define i1 @is_zero_f80_strict(x86_fp80 %x) strictfp {
183 ; CHECK-32-LABEL: is_zero_f80_strict:
184 ; CHECK-32: # %bb.0: # %entry
185 ; CHECK-32-NEXT: movzwl {{[0-9]+}}(%esp), %eax
186 ; CHECK-32-NEXT: andl $32767, %eax # imm = 0x7FFF
187 ; CHECK-32-NEXT: orl {{[0-9]+}}(%esp), %eax
188 ; CHECK-32-NEXT: orl {{[0-9]+}}(%esp), %eax
189 ; CHECK-32-NEXT: sete %al
190 ; CHECK-32-NEXT: retl
192 ; CHECK-64-LABEL: is_zero_f80_strict:
193 ; CHECK-64: # %bb.0: # %entry
194 ; CHECK-64-NEXT: movzwl {{[0-9]+}}(%rsp), %eax
195 ; CHECK-64-NEXT: andl $32767, %eax # imm = 0x7FFF
196 ; CHECK-64-NEXT: orq {{[0-9]+}}(%rsp), %rax
197 ; CHECK-64-NEXT: sete %al
198 ; CHECK-64-NEXT: retq
200 %0 = tail call i1 @llvm.is.fpclass.f80(x86_fp80 %x, i32 96) strictfp ; 0x60 = "zero"
204 define i1 @is_poszero_f80(x86_fp80 %x) {
205 ; CHECK-32-LABEL: is_poszero_f80:
206 ; CHECK-32: # %bb.0: # %entry
207 ; CHECK-32-NEXT: movzwl {{[0-9]+}}(%esp), %eax
208 ; CHECK-32-NEXT: orl {{[0-9]+}}(%esp), %eax
209 ; CHECK-32-NEXT: orl {{[0-9]+}}(%esp), %eax
210 ; CHECK-32-NEXT: sete %al
211 ; CHECK-32-NEXT: retl
213 ; CHECK-64-LABEL: is_poszero_f80:
214 ; CHECK-64: # %bb.0: # %entry
215 ; CHECK-64-NEXT: movzwl {{[0-9]+}}(%rsp), %eax
216 ; CHECK-64-NEXT: orq {{[0-9]+}}(%rsp), %rax
217 ; CHECK-64-NEXT: sete %al
218 ; CHECK-64-NEXT: retq
220 %0 = tail call i1 @llvm.is.fpclass.f80(x86_fp80 %x, i32 64) ; 0x40 = "+zero"
224 define i1 @is_negzero_f80(x86_fp80 %x) {
225 ; CHECK-32-LABEL: is_negzero_f80:
226 ; CHECK-32: # %bb.0: # %entry
227 ; CHECK-32-NEXT: movzwl {{[0-9]+}}(%esp), %eax
228 ; CHECK-32-NEXT: xorl $32768, %eax # imm = 0x8000
229 ; CHECK-32-NEXT: orl {{[0-9]+}}(%esp), %eax
230 ; CHECK-32-NEXT: orl {{[0-9]+}}(%esp), %eax
231 ; CHECK-32-NEXT: sete %al
232 ; CHECK-32-NEXT: retl
234 ; CHECK-64-LABEL: is_negzero_f80:
235 ; CHECK-64: # %bb.0: # %entry
236 ; CHECK-64-NEXT: movzwl {{[0-9]+}}(%rsp), %eax
237 ; CHECK-64-NEXT: xorq $32768, %rax # imm = 0x8000
238 ; CHECK-64-NEXT: orq {{[0-9]+}}(%rsp), %rax
239 ; CHECK-64-NEXT: sete %al
240 ; CHECK-64-NEXT: retq
242 %0 = tail call i1 @llvm.is.fpclass.f80(x86_fp80 %x, i32 32) ; 0x20 = "-zero"
246 define i1 @is_inf_f80(x86_fp80 %x) {
247 ; CHECK-32-LABEL: is_inf_f80:
248 ; CHECK-32: # %bb.0: # %entry
249 ; CHECK-32-NEXT: movl {{[0-9]+}}(%esp), %eax
250 ; CHECK-32-NEXT: notl %eax
251 ; CHECK-32-NEXT: movl $-2147483648, %ecx # imm = 0x80000000
252 ; CHECK-32-NEXT: xorl {{[0-9]+}}(%esp), %ecx
253 ; CHECK-32-NEXT: andl $32767, %eax # imm = 0x7FFF
254 ; CHECK-32-NEXT: orl {{[0-9]+}}(%esp), %eax
255 ; CHECK-32-NEXT: orl %ecx, %eax
256 ; CHECK-32-NEXT: sete %al
257 ; CHECK-32-NEXT: retl
259 ; CHECK-64-LABEL: is_inf_f80:
260 ; CHECK-64: # %bb.0: # %entry
261 ; CHECK-64-NEXT: movl {{[0-9]+}}(%rsp), %eax
262 ; CHECK-64-NEXT: notl %eax
263 ; CHECK-64-NEXT: movabsq $-9223372036854775808, %rcx # imm = 0x8000000000000000
264 ; CHECK-64-NEXT: xorq {{[0-9]+}}(%rsp), %rcx
265 ; CHECK-64-NEXT: andl $32767, %eax # imm = 0x7FFF
266 ; CHECK-64-NEXT: orq %rcx, %rax
267 ; CHECK-64-NEXT: sete %al
268 ; CHECK-64-NEXT: retq
270 %0 = tail call i1 @llvm.is.fpclass.f80(x86_fp80 %x, i32 516) ; 0x204 = "inf"
274 define i1 @is_posinf_f80(x86_fp80 %x) {
275 ; CHECK-32-LABEL: is_posinf_f80:
276 ; CHECK-32: # %bb.0: # %entry
277 ; CHECK-32-NEXT: movzwl {{[0-9]+}}(%esp), %eax
278 ; CHECK-32-NEXT: movl $-2147483648, %ecx # imm = 0x80000000
279 ; CHECK-32-NEXT: xorl {{[0-9]+}}(%esp), %ecx
280 ; CHECK-32-NEXT: xorl $32767, %eax # imm = 0x7FFF
281 ; CHECK-32-NEXT: orl {{[0-9]+}}(%esp), %eax
282 ; CHECK-32-NEXT: orl %ecx, %eax
283 ; CHECK-32-NEXT: sete %al
284 ; CHECK-32-NEXT: retl
286 ; CHECK-64-LABEL: is_posinf_f80:
287 ; CHECK-64: # %bb.0: # %entry
288 ; CHECK-64-NEXT: movzwl {{[0-9]+}}(%rsp), %eax
289 ; CHECK-64-NEXT: movabsq $-9223372036854775808, %rcx # imm = 0x8000000000000000
290 ; CHECK-64-NEXT: xorq {{[0-9]+}}(%rsp), %rcx
291 ; CHECK-64-NEXT: xorq $32767, %rax # imm = 0x7FFF
292 ; CHECK-64-NEXT: orq %rcx, %rax
293 ; CHECK-64-NEXT: sete %al
294 ; CHECK-64-NEXT: retq
296 %0 = tail call i1 @llvm.is.fpclass.f80(x86_fp80 %x, i32 512) ; 0x200 = "+inf"
300 define i1 @is_neginf_f80(x86_fp80 %x) {
301 ; CHECK-32-LABEL: is_neginf_f80:
302 ; CHECK-32: # %bb.0: # %entry
303 ; CHECK-32-NEXT: movzwl {{[0-9]+}}(%esp), %eax
304 ; CHECK-32-NEXT: xorl $65535, %eax # imm = 0xFFFF
305 ; CHECK-32-NEXT: movl $-2147483648, %ecx # imm = 0x80000000
306 ; CHECK-32-NEXT: xorl {{[0-9]+}}(%esp), %ecx
307 ; CHECK-32-NEXT: orl {{[0-9]+}}(%esp), %eax
308 ; CHECK-32-NEXT: orl %ecx, %eax
309 ; CHECK-32-NEXT: sete %al
310 ; CHECK-32-NEXT: retl
312 ; CHECK-64-LABEL: is_neginf_f80:
313 ; CHECK-64: # %bb.0: # %entry
314 ; CHECK-64-NEXT: movzwl {{[0-9]+}}(%rsp), %eax
315 ; CHECK-64-NEXT: xorq $65535, %rax # imm = 0xFFFF
316 ; CHECK-64-NEXT: movabsq $-9223372036854775808, %rcx # imm = 0x8000000000000000
317 ; CHECK-64-NEXT: xorq {{[0-9]+}}(%rsp), %rcx
318 ; CHECK-64-NEXT: orq %rax, %rcx
319 ; CHECK-64-NEXT: sete %al
320 ; CHECK-64-NEXT: retq
322 %0 = tail call i1 @llvm.is.fpclass.f80(x86_fp80 %x, i32 4) ; "-inf"
326 define i1 @is_normal_f80(x86_fp80 %x) {
327 ; CHECK-32-LABEL: is_normal_f80:
328 ; CHECK-32: # %bb.0: # %entry
329 ; CHECK-32-NEXT: movl {{[0-9]+}}(%esp), %eax
330 ; CHECK-32-NEXT: movzwl {{[0-9]+}}(%esp), %ecx
331 ; CHECK-32-NEXT: andl $32767, %ecx # imm = 0x7FFF
332 ; CHECK-32-NEXT: decl %ecx
333 ; CHECK-32-NEXT: movzwl %cx, %ecx
334 ; CHECK-32-NEXT: xorl %edx, %edx
335 ; CHECK-32-NEXT: cmpl $32766, %ecx # imm = 0x7FFE
336 ; CHECK-32-NEXT: sbbl %edx, %edx
337 ; CHECK-32-NEXT: setb %cl
338 ; CHECK-32-NEXT: shrl $31, %eax
339 ; CHECK-32-NEXT: andb %cl, %al
340 ; CHECK-32-NEXT: # kill: def $al killed $al killed $eax
341 ; CHECK-32-NEXT: retl
343 ; CHECK-64-LABEL: is_normal_f80:
344 ; CHECK-64: # %bb.0: # %entry
345 ; CHECK-64-NEXT: movzwl {{[0-9]+}}(%rsp), %eax
346 ; CHECK-64-NEXT: movq {{[0-9]+}}(%rsp), %rcx
347 ; CHECK-64-NEXT: shrq $63, %rcx
348 ; CHECK-64-NEXT: andl $32767, %eax # imm = 0x7FFF
349 ; CHECK-64-NEXT: decl %eax
350 ; CHECK-64-NEXT: movzwl %ax, %eax
351 ; CHECK-64-NEXT: cmpl $32766, %eax # imm = 0x7FFE
352 ; CHECK-64-NEXT: setb %al
353 ; CHECK-64-NEXT: andb %cl, %al
354 ; CHECK-64-NEXT: retq
356 %0 = tail call i1 @llvm.is.fpclass.f80(x86_fp80 %x, i32 264) ; 0x108 = "normal"
360 define i1 @is_posnormal_f80(x86_fp80 %x) {
361 ; CHECK-32-LABEL: is_posnormal_f80:
362 ; CHECK-32: # %bb.0: # %entry
363 ; CHECK-32-NEXT: pushl %esi
364 ; CHECK-32-NEXT: .cfi_def_cfa_offset 8
365 ; CHECK-32-NEXT: .cfi_offset %esi, -8
366 ; CHECK-32-NEXT: movzwl {{[0-9]+}}(%esp), %edx
367 ; CHECK-32-NEXT: movswl %dx, %ecx
368 ; CHECK-32-NEXT: sarl $15, %ecx
369 ; CHECK-32-NEXT: movl {{[0-9]+}}(%esp), %eax
370 ; CHECK-32-NEXT: andl $32767, %edx # imm = 0x7FFF
371 ; CHECK-32-NEXT: decl %edx
372 ; CHECK-32-NEXT: movzwl %dx, %edx
373 ; CHECK-32-NEXT: xorl %esi, %esi
374 ; CHECK-32-NEXT: cmpl $32766, %edx # imm = 0x7FFE
375 ; CHECK-32-NEXT: sbbl %esi, %esi
376 ; CHECK-32-NEXT: setb %dl
377 ; CHECK-32-NEXT: testl %ecx, %ecx
378 ; CHECK-32-NEXT: setns %cl
379 ; CHECK-32-NEXT: shrl $31, %eax
380 ; CHECK-32-NEXT: andb %cl, %al
381 ; CHECK-32-NEXT: andb %dl, %al
382 ; CHECK-32-NEXT: # kill: def $al killed $al killed $eax
383 ; CHECK-32-NEXT: popl %esi
384 ; CHECK-32-NEXT: .cfi_def_cfa_offset 4
385 ; CHECK-32-NEXT: retl
387 ; CHECK-64-LABEL: is_posnormal_f80:
388 ; CHECK-64: # %bb.0: # %entry
389 ; CHECK-64-NEXT: movq {{[0-9]+}}(%rsp), %rax
390 ; CHECK-64-NEXT: movswq {{[0-9]+}}(%rsp), %rcx
391 ; CHECK-64-NEXT: testq %rcx, %rcx
392 ; CHECK-64-NEXT: setns %dl
393 ; CHECK-64-NEXT: andl $32767, %ecx # imm = 0x7FFF
394 ; CHECK-64-NEXT: decl %ecx
395 ; CHECK-64-NEXT: movzwl %cx, %ecx
396 ; CHECK-64-NEXT: cmpl $32766, %ecx # imm = 0x7FFE
397 ; CHECK-64-NEXT: setb %cl
398 ; CHECK-64-NEXT: shrq $63, %rax
399 ; CHECK-64-NEXT: andb %dl, %al
400 ; CHECK-64-NEXT: andb %cl, %al
401 ; CHECK-64-NEXT: # kill: def $al killed $al killed $rax
402 ; CHECK-64-NEXT: retq
404 %0 = tail call i1 @llvm.is.fpclass.f80(x86_fp80 %x, i32 256) ; 0x100 = "+normal"
408 define i1 @is_negnormal_f80(x86_fp80 %x) {
409 ; CHECK-32-LABEL: is_negnormal_f80:
410 ; CHECK-32: # %bb.0: # %entry
411 ; CHECK-32-NEXT: pushl %esi
412 ; CHECK-32-NEXT: .cfi_def_cfa_offset 8
413 ; CHECK-32-NEXT: .cfi_offset %esi, -8
414 ; CHECK-32-NEXT: movzwl {{[0-9]+}}(%esp), %edx
415 ; CHECK-32-NEXT: movswl %dx, %ecx
416 ; CHECK-32-NEXT: sarl $15, %ecx
417 ; CHECK-32-NEXT: movl {{[0-9]+}}(%esp), %eax
418 ; CHECK-32-NEXT: andl $32767, %edx # imm = 0x7FFF
419 ; CHECK-32-NEXT: decl %edx
420 ; CHECK-32-NEXT: movzwl %dx, %edx
421 ; CHECK-32-NEXT: xorl %esi, %esi
422 ; CHECK-32-NEXT: cmpl $32766, %edx # imm = 0x7FFE
423 ; CHECK-32-NEXT: sbbl %esi, %esi
424 ; CHECK-32-NEXT: setb %dl
425 ; CHECK-32-NEXT: testl %ecx, %ecx
426 ; CHECK-32-NEXT: sets %cl
427 ; CHECK-32-NEXT: shrl $31, %eax
428 ; CHECK-32-NEXT: andb %cl, %al
429 ; CHECK-32-NEXT: andb %dl, %al
430 ; CHECK-32-NEXT: # kill: def $al killed $al killed $eax
431 ; CHECK-32-NEXT: popl %esi
432 ; CHECK-32-NEXT: .cfi_def_cfa_offset 4
433 ; CHECK-32-NEXT: retl
435 ; CHECK-64-LABEL: is_negnormal_f80:
436 ; CHECK-64: # %bb.0: # %entry
437 ; CHECK-64-NEXT: movq {{[0-9]+}}(%rsp), %rax
438 ; CHECK-64-NEXT: movswq {{[0-9]+}}(%rsp), %rcx
439 ; CHECK-64-NEXT: testq %rcx, %rcx
440 ; CHECK-64-NEXT: sets %dl
441 ; CHECK-64-NEXT: andl $32767, %ecx # imm = 0x7FFF
442 ; CHECK-64-NEXT: decl %ecx
443 ; CHECK-64-NEXT: movzwl %cx, %ecx
444 ; CHECK-64-NEXT: cmpl $32766, %ecx # imm = 0x7FFE
445 ; CHECK-64-NEXT: setb %cl
446 ; CHECK-64-NEXT: shrq $63, %rax
447 ; CHECK-64-NEXT: andb %dl, %al
448 ; CHECK-64-NEXT: andb %cl, %al
449 ; CHECK-64-NEXT: # kill: def $al killed $al killed $rax
450 ; CHECK-64-NEXT: retq
452 %0 = tail call i1 @llvm.is.fpclass.f80(x86_fp80 %x, i32 8) ; "-normal"
456 define i1 @is_subnormal_f80(x86_fp80 %x) {
457 ; CHECK-32-LABEL: is_subnormal_f80:
458 ; CHECK-32: # %bb.0: # %entry
459 ; CHECK-32-NEXT: pushl %esi
460 ; CHECK-32-NEXT: .cfi_def_cfa_offset 8
461 ; CHECK-32-NEXT: .cfi_offset %esi, -8
462 ; CHECK-32-NEXT: movl {{[0-9]+}}(%esp), %esi
463 ; CHECK-32-NEXT: movl {{[0-9]+}}(%esp), %ecx
464 ; CHECK-32-NEXT: movzwl {{[0-9]+}}(%esp), %eax
465 ; CHECK-32-NEXT: andl $32767, %eax # imm = 0x7FFF
466 ; CHECK-32-NEXT: xorl %edx, %edx
467 ; CHECK-32-NEXT: addl $-1, %esi
468 ; CHECK-32-NEXT: adcl $-1, %ecx
469 ; CHECK-32-NEXT: adcl $-1, %eax
470 ; CHECK-32-NEXT: adcl $-1, %edx
471 ; CHECK-32-NEXT: cmpl $-1, %esi
472 ; CHECK-32-NEXT: sbbl $2147483647, %ecx # imm = 0x7FFFFFFF
473 ; CHECK-32-NEXT: sbbl $0, %eax
474 ; CHECK-32-NEXT: sbbl $0, %edx
475 ; CHECK-32-NEXT: setb %al
476 ; CHECK-32-NEXT: popl %esi
477 ; CHECK-32-NEXT: .cfi_def_cfa_offset 4
478 ; CHECK-32-NEXT: retl
480 ; CHECK-64-LABEL: is_subnormal_f80:
481 ; CHECK-64: # %bb.0: # %entry
482 ; CHECK-64-NEXT: movzwl {{[0-9]+}}(%rsp), %eax
483 ; CHECK-64-NEXT: movq {{[0-9]+}}(%rsp), %rcx
484 ; CHECK-64-NEXT: andl $32767, %eax # imm = 0x7FFF
485 ; CHECK-64-NEXT: addq $-1, %rcx
486 ; CHECK-64-NEXT: adcq $-1, %rax
487 ; CHECK-64-NEXT: movabsq $9223372036854775807, %rdx # imm = 0x7FFFFFFFFFFFFFFF
488 ; CHECK-64-NEXT: cmpq %rdx, %rcx
489 ; CHECK-64-NEXT: sbbq $0, %rax
490 ; CHECK-64-NEXT: setb %al
491 ; CHECK-64-NEXT: retq
493 %0 = tail call i1 @llvm.is.fpclass.f80(x86_fp80 %x, i32 144) ; 0x90 = "subnormal"
497 define i1 @is_possubnormal_f80(x86_fp80 %x) {
498 ; CHECK-32-LABEL: is_possubnormal_f80:
499 ; CHECK-32: # %bb.0: # %entry
500 ; CHECK-32-NEXT: pushl %esi
501 ; CHECK-32-NEXT: .cfi_def_cfa_offset 8
502 ; CHECK-32-NEXT: .cfi_offset %esi, -8
503 ; CHECK-32-NEXT: movl {{[0-9]+}}(%esp), %eax
504 ; CHECK-32-NEXT: movl {{[0-9]+}}(%esp), %ecx
505 ; CHECK-32-NEXT: movl {{[0-9]+}}(%esp), %edx
506 ; CHECK-32-NEXT: addl $-1, %ecx
507 ; CHECK-32-NEXT: adcl $-1, %edx
508 ; CHECK-32-NEXT: adcl $-1, %eax
509 ; CHECK-32-NEXT: movzwl %ax, %eax
510 ; CHECK-32-NEXT: xorl %esi, %esi
511 ; CHECK-32-NEXT: cmpl $-1, %ecx
512 ; CHECK-32-NEXT: sbbl $2147483647, %edx # imm = 0x7FFFFFFF
513 ; CHECK-32-NEXT: sbbl $0, %eax
514 ; CHECK-32-NEXT: sbbl %esi, %esi
515 ; CHECK-32-NEXT: setb %al
516 ; CHECK-32-NEXT: popl %esi
517 ; CHECK-32-NEXT: .cfi_def_cfa_offset 4
518 ; CHECK-32-NEXT: retl
520 ; CHECK-64-LABEL: is_possubnormal_f80:
521 ; CHECK-64: # %bb.0: # %entry
522 ; CHECK-64-NEXT: movl {{[0-9]+}}(%rsp), %eax
523 ; CHECK-64-NEXT: movq {{[0-9]+}}(%rsp), %rcx
524 ; CHECK-64-NEXT: addq $-1, %rcx
525 ; CHECK-64-NEXT: adcq $-1, %rax
526 ; CHECK-64-NEXT: movzwl %ax, %eax
527 ; CHECK-64-NEXT: movabsq $9223372036854775807, %rdx # imm = 0x7FFFFFFFFFFFFFFF
528 ; CHECK-64-NEXT: cmpq %rdx, %rcx
529 ; CHECK-64-NEXT: sbbq $0, %rax
530 ; CHECK-64-NEXT: setb %al
531 ; CHECK-64-NEXT: retq
533 %0 = tail call i1 @llvm.is.fpclass.f80(x86_fp80 %x, i32 128) ; 0x80 = "+subnormal"
537 define i1 @is_negsubnormal_f80(x86_fp80 %x) {
538 ; CHECK-32-LABEL: is_negsubnormal_f80:
539 ; CHECK-32: # %bb.0: # %entry
540 ; CHECK-32-NEXT: pushl %edi
541 ; CHECK-32-NEXT: .cfi_def_cfa_offset 8
542 ; CHECK-32-NEXT: pushl %esi
543 ; CHECK-32-NEXT: .cfi_def_cfa_offset 12
544 ; CHECK-32-NEXT: .cfi_offset %esi, -12
545 ; CHECK-32-NEXT: .cfi_offset %edi, -8
546 ; CHECK-32-NEXT: movzwl {{[0-9]+}}(%esp), %ecx
547 ; CHECK-32-NEXT: movswl %cx, %eax
548 ; CHECK-32-NEXT: sarl $15, %eax
549 ; CHECK-32-NEXT: movl {{[0-9]+}}(%esp), %esi
550 ; CHECK-32-NEXT: movl {{[0-9]+}}(%esp), %edi
551 ; CHECK-32-NEXT: andl $32767, %ecx # imm = 0x7FFF
552 ; CHECK-32-NEXT: xorl %edx, %edx
553 ; CHECK-32-NEXT: addl $-1, %esi
554 ; CHECK-32-NEXT: adcl $-1, %edi
555 ; CHECK-32-NEXT: adcl $-1, %ecx
556 ; CHECK-32-NEXT: adcl $-1, %edx
557 ; CHECK-32-NEXT: cmpl $-1, %esi
558 ; CHECK-32-NEXT: sbbl $2147483647, %edi # imm = 0x7FFFFFFF
559 ; CHECK-32-NEXT: sbbl $0, %ecx
560 ; CHECK-32-NEXT: sbbl $0, %edx
561 ; CHECK-32-NEXT: setb %cl
562 ; CHECK-32-NEXT: testl %eax, %eax
563 ; CHECK-32-NEXT: sets %al
564 ; CHECK-32-NEXT: andb %cl, %al
565 ; CHECK-32-NEXT: popl %esi
566 ; CHECK-32-NEXT: .cfi_def_cfa_offset 8
567 ; CHECK-32-NEXT: popl %edi
568 ; CHECK-32-NEXT: .cfi_def_cfa_offset 4
569 ; CHECK-32-NEXT: retl
571 ; CHECK-64-LABEL: is_negsubnormal_f80:
572 ; CHECK-64: # %bb.0: # %entry
573 ; CHECK-64-NEXT: movzwl {{[0-9]+}}(%rsp), %eax
574 ; CHECK-64-NEXT: movswq %ax, %rcx
575 ; CHECK-64-NEXT: movq {{[0-9]+}}(%rsp), %rdx
576 ; CHECK-64-NEXT: andl $32767, %eax # imm = 0x7FFF
577 ; CHECK-64-NEXT: addq $-1, %rdx
578 ; CHECK-64-NEXT: adcq $-1, %rax
579 ; CHECK-64-NEXT: movabsq $9223372036854775807, %rsi # imm = 0x7FFFFFFFFFFFFFFF
580 ; CHECK-64-NEXT: cmpq %rsi, %rdx
581 ; CHECK-64-NEXT: sbbq $0, %rax
582 ; CHECK-64-NEXT: setb %dl
583 ; CHECK-64-NEXT: testq %rcx, %rcx
584 ; CHECK-64-NEXT: sets %al
585 ; CHECK-64-NEXT: andb %dl, %al
586 ; CHECK-64-NEXT: retq
588 %0 = tail call i1 @llvm.is.fpclass.f80(x86_fp80 %x, i32 16) ; 0x10 = "-subnormal"
592 declare i1 @llvm.is.fpclass.f80(x86_fp80, i32)