1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
2 ; RUN: llc --mtriple=loongarch32 --mattr=+f --verify-machineinstrs < %s | FileCheck %s
3 ; RUN: llc --mtriple=loongarch64 --mattr=+f --verify-machineinstrs < %s | FileCheck %s
5 define i1 @isnan_f(float %x) {
6 ; CHECK-LABEL: isnan_f:
7 ; CHECK: # %bb.0: # %entry
8 ; CHECK-NEXT: fclass.s $fa0, $fa0
9 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
10 ; CHECK-NEXT: andi $a0, $a0, 3
11 ; CHECK-NEXT: sltu $a0, $zero, $a0
14 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 3) ; "nan"
18 define i1 @isnot_nan_f(float %x) {
19 ; CHECK-LABEL: isnot_nan_f:
20 ; CHECK: # %bb.0: # %entry
21 ; CHECK-NEXT: fclass.s $fa0, $fa0
22 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
23 ; CHECK-NEXT: andi $a0, $a0, 1020
24 ; CHECK-NEXT: sltu $a0, $zero, $a0
27 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 1020) ; 0x3fc = "zero|subnormal|normal|inf"
31 define i1 @issignaling_f(float %x) {
32 ; CHECK-LABEL: issignaling_f:
33 ; CHECK: # %bb.0: # %entry
34 ; CHECK-NEXT: fclass.s $fa0, $fa0
35 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
36 ; CHECK-NEXT: andi $a0, $a0, 1
37 ; CHECK-NEXT: sltu $a0, $zero, $a0
40 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 1) ; "snan"
44 define i1 @not_issignaling_f(float %x) {
45 ; CHECK-LABEL: not_issignaling_f:
46 ; CHECK: # %bb.0: # %entry
47 ; CHECK-NEXT: fclass.s $fa0, $fa0
48 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
49 ; CHECK-NEXT: andi $a0, $a0, 1022
50 ; CHECK-NEXT: sltu $a0, $zero, $a0
53 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 1022) ; ~"snan"
57 define i1 @isquiet_f(float %x) {
58 ; CHECK-LABEL: isquiet_f:
59 ; CHECK: # %bb.0: # %entry
60 ; CHECK-NEXT: fclass.s $fa0, $fa0
61 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
62 ; CHECK-NEXT: andi $a0, $a0, 2
63 ; CHECK-NEXT: sltu $a0, $zero, $a0
66 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 2) ; "qnan"
70 define i1 @not_isquiet_f(float %x) {
71 ; CHECK-LABEL: not_isquiet_f:
72 ; CHECK: # %bb.0: # %entry
73 ; CHECK-NEXT: fclass.s $fa0, $fa0
74 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
75 ; CHECK-NEXT: andi $a0, $a0, 1021
76 ; CHECK-NEXT: sltu $a0, $zero, $a0
79 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 1021) ; ~"qnan"
83 define i1 @isinf_f(float %x) {
84 ; CHECK-LABEL: isinf_f:
85 ; CHECK: # %bb.0: # %entry
86 ; CHECK-NEXT: fclass.s $fa0, $fa0
87 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
88 ; CHECK-NEXT: andi $a0, $a0, 68
89 ; CHECK-NEXT: sltu $a0, $zero, $a0
92 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 516) ; 0x204 = "inf"
96 define i1 @not_isinf_f(float %x) {
97 ; CHECK-LABEL: not_isinf_f:
98 ; CHECK: # %bb.0: # %entry
99 ; CHECK-NEXT: fclass.s $fa0, $fa0
100 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
101 ; CHECK-NEXT: andi $a0, $a0, 955
102 ; CHECK-NEXT: sltu $a0, $zero, $a0
105 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 507) ; ~0x204 = "~inf"
109 define i1 @is_plus_inf_f(float %x) {
110 ; CHECK-LABEL: is_plus_inf_f:
111 ; CHECK: # %bb.0: # %entry
112 ; CHECK-NEXT: fclass.s $fa0, $fa0
113 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
114 ; CHECK-NEXT: andi $a0, $a0, 64
115 ; CHECK-NEXT: sltu $a0, $zero, $a0
118 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 512) ; 0x200 = "+inf"
122 define i1 @is_minus_inf_f(float %x) {
123 ; CHECK-LABEL: is_minus_inf_f:
124 ; CHECK: # %bb.0: # %entry
125 ; CHECK-NEXT: fclass.s $fa0, $fa0
126 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
127 ; CHECK-NEXT: andi $a0, $a0, 4
128 ; CHECK-NEXT: sltu $a0, $zero, $a0
131 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 4) ; "-inf"
135 define i1 @not_is_minus_inf_f(float %x) {
136 ; CHECK-LABEL: not_is_minus_inf_f:
137 ; CHECK: # %bb.0: # %entry
138 ; CHECK-NEXT: fclass.s $fa0, $fa0
139 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
140 ; CHECK-NEXT: andi $a0, $a0, 1019
141 ; CHECK-NEXT: sltu $a0, $zero, $a0
144 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 1019) ; ~"-inf"
148 define i1 @isfinite_f(float %x) {
149 ; CHECK-LABEL: isfinite_f:
150 ; CHECK: # %bb.0: # %entry
151 ; CHECK-NEXT: fclass.s $fa0, $fa0
152 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
153 ; CHECK-NEXT: andi $a0, $a0, 952
154 ; CHECK-NEXT: sltu $a0, $zero, $a0
157 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 504) ; 0x1f8 = "finite"
161 define i1 @not_isfinite_f(float %x) {
162 ; CHECK-LABEL: not_isfinite_f:
163 ; CHECK: # %bb.0: # %entry
164 ; CHECK-NEXT: fclass.s $fa0, $fa0
165 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
166 ; CHECK-NEXT: andi $a0, $a0, 71
167 ; CHECK-NEXT: sltu $a0, $zero, $a0
170 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 519) ; ~0x1f8 = "~finite"
174 define i1 @is_plus_finite_f(float %x) {
175 ; CHECK-LABEL: is_plus_finite_f:
176 ; CHECK: # %bb.0: # %entry
177 ; CHECK-NEXT: fclass.s $fa0, $fa0
178 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
179 ; CHECK-NEXT: andi $a0, $a0, 896
180 ; CHECK-NEXT: sltu $a0, $zero, $a0
183 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 448) ; 0x1c0 = "+finite"
187 define i1 @not_is_plus_finite_f(float %x) {
188 ; CHECK-LABEL: not_is_plus_finite_f:
189 ; CHECK: # %bb.0: # %entry
190 ; CHECK-NEXT: fclass.s $fa0, $fa0
191 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
192 ; CHECK-NEXT: andi $a0, $a0, 127
193 ; CHECK-NEXT: sltu $a0, $zero, $a0
196 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 575) ; ~0x1c0 = ~"+finite"
200 define i1 @is_minus_finite_f(float %x) {
201 ; CHECK-LABEL: is_minus_finite_f:
202 ; CHECK: # %bb.0: # %entry
203 ; CHECK-NEXT: fclass.s $fa0, $fa0
204 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
205 ; CHECK-NEXT: andi $a0, $a0, 56
206 ; CHECK-NEXT: sltu $a0, $zero, $a0
209 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 56) ; 0x38 = "-finite"
213 define i1 @not_is_minus_finite_f(float %x) {
214 ; CHECK-LABEL: not_is_minus_finite_f:
215 ; CHECK: # %bb.0: # %entry
216 ; CHECK-NEXT: fclass.s $fa0, $fa0
217 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
218 ; CHECK-NEXT: andi $a0, $a0, 967
219 ; CHECK-NEXT: sltu $a0, $zero, $a0
222 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 967) ; ~0x38 = ~"-finite"
226 define i1 @isnormal_f(float %x) {
227 ; CHECK-LABEL: isnormal_f:
228 ; CHECK: # %bb.0: # %entry
229 ; CHECK-NEXT: fclass.s $fa0, $fa0
230 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
231 ; CHECK-NEXT: andi $a0, $a0, 136
232 ; CHECK-NEXT: sltu $a0, $zero, $a0
235 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 264) ; 0x108 = "normal"
239 define i1 @not_isnormal_f(float %x) {
240 ; CHECK-LABEL: not_isnormal_f:
241 ; CHECK: # %bb.0: # %entry
242 ; CHECK-NEXT: fclass.s $fa0, $fa0
243 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
244 ; CHECK-NEXT: andi $a0, $a0, 887
245 ; CHECK-NEXT: sltu $a0, $zero, $a0
248 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 759) ; ~0x108 = "~normal"
252 define i1 @is_plus_normal_f(float %x) {
253 ; CHECK-LABEL: is_plus_normal_f:
254 ; CHECK: # %bb.0: # %entry
255 ; CHECK-NEXT: fclass.s $fa0, $fa0
256 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
257 ; CHECK-NEXT: andi $a0, $a0, 128
258 ; CHECK-NEXT: sltu $a0, $zero, $a0
261 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 256) ; 0x100 = "+normal"
265 define i1 @issubnormal_f(float %x) {
266 ; CHECK-LABEL: issubnormal_f:
267 ; CHECK: # %bb.0: # %entry
268 ; CHECK-NEXT: fclass.s $fa0, $fa0
269 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
270 ; CHECK-NEXT: andi $a0, $a0, 272
271 ; CHECK-NEXT: sltu $a0, $zero, $a0
274 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 144) ; 0x90 = "subnormal"
278 define i1 @not_issubnormal_f(float %x) {
279 ; CHECK-LABEL: not_issubnormal_f:
280 ; CHECK: # %bb.0: # %entry
281 ; CHECK-NEXT: fclass.s $fa0, $fa0
282 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
283 ; CHECK-NEXT: andi $a0, $a0, 751
284 ; CHECK-NEXT: sltu $a0, $zero, $a0
287 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 879) ; ~0x90 = "~subnormal"
291 define i1 @is_plus_subnormal_f(float %x) {
292 ; CHECK-LABEL: is_plus_subnormal_f:
293 ; CHECK: # %bb.0: # %entry
294 ; CHECK-NEXT: fclass.s $fa0, $fa0
295 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
296 ; CHECK-NEXT: andi $a0, $a0, 256
297 ; CHECK-NEXT: sltu $a0, $zero, $a0
300 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 128) ; 0x80 = "+subnormal"
304 define i1 @not_is_plus_subnormal_f(float %x) {
305 ; CHECK-LABEL: not_is_plus_subnormal_f:
306 ; CHECK: # %bb.0: # %entry
307 ; CHECK-NEXT: fclass.s $fa0, $fa0
308 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
309 ; CHECK-NEXT: andi $a0, $a0, 767
310 ; CHECK-NEXT: sltu $a0, $zero, $a0
313 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 895) ; ~0x80 = ~"+subnormal"
317 define i1 @is_minus_subnormal_f(float %x) {
318 ; CHECK-LABEL: is_minus_subnormal_f:
319 ; CHECK: # %bb.0: # %entry
320 ; CHECK-NEXT: fclass.s $fa0, $fa0
321 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
322 ; CHECK-NEXT: andi $a0, $a0, 16
323 ; CHECK-NEXT: sltu $a0, $zero, $a0
326 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 16) ; 0x10 = "-subnormal"
330 define i1 @not_is_minus_subnormal_f(float %x) {
331 ; CHECK-LABEL: not_is_minus_subnormal_f:
332 ; CHECK: # %bb.0: # %entry
333 ; CHECK-NEXT: fclass.s $fa0, $fa0
334 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
335 ; CHECK-NEXT: andi $a0, $a0, 1007
336 ; CHECK-NEXT: sltu $a0, $zero, $a0
339 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 1007) ; ~0x10 = ~"-subnormal"
343 define i1 @iszero_f(float %x) {
344 ; CHECK-LABEL: iszero_f:
345 ; CHECK: # %bb.0: # %entry
346 ; CHECK-NEXT: fclass.s $fa0, $fa0
347 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
348 ; CHECK-NEXT: andi $a0, $a0, 544
349 ; CHECK-NEXT: sltu $a0, $zero, $a0
352 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 96) ; 0x60 = "zero"
356 define i1 @not_iszero_f(float %x) {
357 ; CHECK-LABEL: not_iszero_f:
358 ; CHECK: # %bb.0: # %entry
359 ; CHECK-NEXT: fclass.s $fa0, $fa0
360 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
361 ; CHECK-NEXT: andi $a0, $a0, 479
362 ; CHECK-NEXT: sltu $a0, $zero, $a0
365 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 927) ; ~0x60 = "~zero"
369 define i1 @issubnormal_or_zero_f(float %x) {
370 ; CHECK-LABEL: issubnormal_or_zero_f:
371 ; CHECK: # %bb.0: # %entry
372 ; CHECK-NEXT: fclass.s $fa0, $fa0
373 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
374 ; CHECK-NEXT: andi $a0, $a0, 816
375 ; CHECK-NEXT: sltu $a0, $zero, $a0
378 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 240) ; 0xf0 = "subnormal|zero"
382 define i1 @not_issubnormal_or_zero_f(float %x) {
383 ; CHECK-LABEL: not_issubnormal_or_zero_f:
384 ; CHECK: # %bb.0: # %entry
385 ; CHECK-NEXT: fclass.s $fa0, $fa0
386 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
387 ; CHECK-NEXT: andi $a0, $a0, 207
388 ; CHECK-NEXT: sltu $a0, $zero, $a0
391 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 783) ; ~0xf0 = "~(subnormal|zero)"
395 define i1 @is_plus_zero_f(float %x) {
396 ; CHECK-LABEL: is_plus_zero_f:
397 ; CHECK: # %bb.0: # %entry
398 ; CHECK-NEXT: fclass.s $fa0, $fa0
399 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
400 ; CHECK-NEXT: andi $a0, $a0, 512
401 ; CHECK-NEXT: sltu $a0, $zero, $a0
404 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 64) ; 0x40 = "+zero"
408 define i1 @not_is_plus_zero_f(float %x) {
409 ; CHECK-LABEL: not_is_plus_zero_f:
410 ; CHECK: # %bb.0: # %entry
411 ; CHECK-NEXT: fclass.s $fa0, $fa0
412 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
413 ; CHECK-NEXT: andi $a0, $a0, 511
414 ; CHECK-NEXT: sltu $a0, $zero, $a0
417 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 959) ; ~0x40 = ~"+zero"
421 define i1 @is_minus_zero_f(float %x) {
422 ; CHECK-LABEL: is_minus_zero_f:
423 ; CHECK: # %bb.0: # %entry
424 ; CHECK-NEXT: fclass.s $fa0, $fa0
425 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
426 ; CHECK-NEXT: andi $a0, $a0, 32
427 ; CHECK-NEXT: sltu $a0, $zero, $a0
430 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 32) ; 0x20 = "-zero"
434 define i1 @not_is_minus_zero_f(float %x) {
435 ; CHECK-LABEL: not_is_minus_zero_f:
436 ; CHECK: # %bb.0: # %entry
437 ; CHECK-NEXT: fclass.s $fa0, $fa0
438 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
439 ; CHECK-NEXT: andi $a0, $a0, 991
440 ; CHECK-NEXT: sltu $a0, $zero, $a0
443 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 991) ; ~0x20 = ~"-zero"
447 define i1 @isnone_f(float %x) {
448 ; CHECK-LABEL: isnone_f:
449 ; CHECK: # %bb.0: # %entry
450 ; CHECK-NEXT: fclass.s $fa0, $fa0
451 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
452 ; CHECK-NEXT: andi $a0, $a0, 0
453 ; CHECK-NEXT: sltu $a0, $zero, $a0
456 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 0)
460 define i1 @isany_f(float %x) {
461 ; CHECK-LABEL: isany_f:
462 ; CHECK: # %bb.0: # %entry
463 ; CHECK-NEXT: fclass.s $fa0, $fa0
464 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
465 ; CHECK-NEXT: andi $a0, $a0, 1023
466 ; CHECK-NEXT: sltu $a0, $zero, $a0
469 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 1023)
473 define i1 @iszero_or_nan_f(float %x) {
474 ; CHECK-LABEL: iszero_or_nan_f:
475 ; CHECK: # %bb.0: # %entry
476 ; CHECK-NEXT: fclass.s $fa0, $fa0
477 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
478 ; CHECK-NEXT: andi $a0, $a0, 547
479 ; CHECK-NEXT: sltu $a0, $zero, $a0
482 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 99) ; 0x60|0x3 = "zero|nan"
486 define i1 @not_iszero_or_nan_f(float %x) {
487 ; CHECK-LABEL: not_iszero_or_nan_f:
488 ; CHECK: # %bb.0: # %entry
489 ; CHECK-NEXT: fclass.s $fa0, $fa0
490 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
491 ; CHECK-NEXT: andi $a0, $a0, 476
492 ; CHECK-NEXT: sltu $a0, $zero, $a0
495 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 924) ; ~0x60 = "~(zero|nan)"
499 define i1 @iszero_or_qnan_f(float %x) {
500 ; CHECK-LABEL: iszero_or_qnan_f:
501 ; CHECK: # %bb.0: # %entry
502 ; CHECK-NEXT: fclass.s $fa0, $fa0
503 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
504 ; CHECK-NEXT: andi $a0, $a0, 546
505 ; CHECK-NEXT: sltu $a0, $zero, $a0
508 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 98) ; 0x60|0x2 = "zero|qnan"
512 define i1 @iszero_or_snan_f(float %x) {
513 ; CHECK-LABEL: iszero_or_snan_f:
514 ; CHECK: # %bb.0: # %entry
515 ; CHECK-NEXT: fclass.s $fa0, $fa0
516 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
517 ; CHECK-NEXT: andi $a0, $a0, 545
518 ; CHECK-NEXT: sltu $a0, $zero, $a0
521 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 97) ; 0x60|0x1 = "zero|snan"
525 define i1 @not_iszero_or_qnan_f(float %x) {
526 ; CHECK-LABEL: not_iszero_or_qnan_f:
527 ; CHECK: # %bb.0: # %entry
528 ; CHECK-NEXT: fclass.s $fa0, $fa0
529 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
530 ; CHECK-NEXT: andi $a0, $a0, 477
531 ; CHECK-NEXT: sltu $a0, $zero, $a0
534 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 925) ; ~(0x60|0x2) = "~(zero|qnan)"
538 define i1 @not_iszero_or_snan_f(float %x) {
539 ; CHECK-LABEL: not_iszero_or_snan_f:
540 ; CHECK: # %bb.0: # %entry
541 ; CHECK-NEXT: fclass.s $fa0, $fa0
542 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
543 ; CHECK-NEXT: andi $a0, $a0, 478
544 ; CHECK-NEXT: sltu $a0, $zero, $a0
547 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 926) ; ~(0x60|0x1) = "~(zero|snan)"
551 define i1 @isinf_or_nan_f(float %x) {
552 ; CHECK-LABEL: isinf_or_nan_f:
553 ; CHECK: # %bb.0: # %entry
554 ; CHECK-NEXT: fclass.s $fa0, $fa0
555 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
556 ; CHECK-NEXT: andi $a0, $a0, 71
557 ; CHECK-NEXT: sltu $a0, $zero, $a0
560 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 519) ; 0x204|0x3 = "inf|nan"
564 define i1 @not_isinf_or_nan_f(float %x) {
565 ; CHECK-LABEL: not_isinf_or_nan_f:
566 ; CHECK: # %bb.0: # %entry
567 ; CHECK-NEXT: fclass.s $fa0, $fa0
568 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
569 ; CHECK-NEXT: andi $a0, $a0, 952
570 ; CHECK-NEXT: sltu $a0, $zero, $a0
573 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 504) ; ~(0x204|0x3) = "~(inf|nan)"
577 define i1 @isfinite_or_nan_f(float %x) {
578 ; CHECK-LABEL: isfinite_or_nan_f:
579 ; CHECK: # %bb.0: # %entry
580 ; CHECK-NEXT: fclass.s $fa0, $fa0
581 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
582 ; CHECK-NEXT: andi $a0, $a0, 955
583 ; CHECK-NEXT: sltu $a0, $zero, $a0
586 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 507) ; 0x1f8|0x3 = "finite|nan"
590 define i1 @not_isfinite_or_nan_f(float %x) {
591 ; CHECK-LABEL: not_isfinite_or_nan_f:
592 ; CHECK: # %bb.0: # %entry
593 ; CHECK-NEXT: fclass.s $fa0, $fa0
594 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
595 ; CHECK-NEXT: andi $a0, $a0, 68
596 ; CHECK-NEXT: sltu $a0, $zero, $a0
599 %0 = tail call i1 @llvm.is.fpclass.f32(float %x, i32 516) ; ~(0x1f8|0x3) = "~(finite|nan)"
603 define i1 @is_plus_inf_or_nan_f(float %x) {
604 ; CHECK-LABEL: is_plus_inf_or_nan_f:
606 ; CHECK-NEXT: fclass.s $fa0, $fa0
607 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
608 ; CHECK-NEXT: andi $a0, $a0, 67
609 ; CHECK-NEXT: sltu $a0, $zero, $a0
611 %class = tail call i1 @llvm.is.fpclass.f32(float %x, i32 515) ; 0x200|0x3 = "+inf|nan"
615 define i1 @is_minus_inf_or_nan_f(float %x) {
616 ; CHECK-LABEL: is_minus_inf_or_nan_f:
618 ; CHECK-NEXT: fclass.s $fa0, $fa0
619 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
620 ; CHECK-NEXT: andi $a0, $a0, 7
621 ; CHECK-NEXT: sltu $a0, $zero, $a0
623 %class = tail call i1 @llvm.is.fpclass.f32(float %x, i32 7) ; "-inf|nan"
627 define i1 @not_is_plus_inf_or_nan_f(float %x) {
628 ; CHECK-LABEL: not_is_plus_inf_or_nan_f:
630 ; CHECK-NEXT: fclass.s $fa0, $fa0
631 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
632 ; CHECK-NEXT: andi $a0, $a0, 956
633 ; CHECK-NEXT: sltu $a0, $zero, $a0
635 %class = tail call i1 @llvm.is.fpclass.f32(float %x, i32 508) ; ~(0x200|0x3) = "~(+inf|nan)"
639 define i1 @not_is_minus_inf_or_nan_f(float %x) {
640 ; CHECK-LABEL: not_is_minus_inf_or_nan_f:
642 ; CHECK-NEXT: fclass.s $fa0, $fa0
643 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
644 ; CHECK-NEXT: andi $a0, $a0, 1016
645 ; CHECK-NEXT: sltu $a0, $zero, $a0
647 %class = tail call i1 @llvm.is.fpclass.f32(float %x, i32 1016) ; "~(-inf|nan)"
651 define i1 @is_plus_inf_or_snan_f(float %x) {
652 ; CHECK-LABEL: is_plus_inf_or_snan_f:
654 ; CHECK-NEXT: fclass.s $fa0, $fa0
655 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
656 ; CHECK-NEXT: andi $a0, $a0, 65
657 ; CHECK-NEXT: sltu $a0, $zero, $a0
659 %class = tail call i1 @llvm.is.fpclass.f32(float %x, i32 513) ; 0x200|0x1 = "+inf|snan"
663 define i1 @is_plus_inf_or_qnan_f(float %x) {
664 ; CHECK-LABEL: is_plus_inf_or_qnan_f:
666 ; CHECK-NEXT: fclass.s $fa0, $fa0
667 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
668 ; CHECK-NEXT: andi $a0, $a0, 66
669 ; CHECK-NEXT: sltu $a0, $zero, $a0
671 %class = tail call i1 @llvm.is.fpclass.f32(float %x, i32 514) ; 0x200|0x1 = "+inf|qnan"
675 define i1 @not_is_plus_inf_or_snan_f(float %x) {
676 ; CHECK-LABEL: not_is_plus_inf_or_snan_f:
678 ; CHECK-NEXT: fclass.s $fa0, $fa0
679 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
680 ; CHECK-NEXT: andi $a0, $a0, 958
681 ; CHECK-NEXT: sltu $a0, $zero, $a0
683 %class = tail call i1 @llvm.is.fpclass.f32(float %x, i32 510) ; ~(+inf|snan)
687 define i1 @not_is_plus_inf_or_qnan_f(float %x) {
688 ; CHECK-LABEL: not_is_plus_inf_or_qnan_f:
690 ; CHECK-NEXT: fclass.s $fa0, $fa0
691 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
692 ; CHECK-NEXT: andi $a0, $a0, 957
693 ; CHECK-NEXT: sltu $a0, $zero, $a0
695 %class = tail call i1 @llvm.is.fpclass.f32(float %x, i32 509) ; ~(+inf|qnan)
699 define i1 @is_minus_inf_or_snan_f(float %x) {
700 ; CHECK-LABEL: is_minus_inf_or_snan_f:
702 ; CHECK-NEXT: fclass.s $fa0, $fa0
703 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
704 ; CHECK-NEXT: andi $a0, $a0, 5
705 ; CHECK-NEXT: sltu $a0, $zero, $a0
707 %class = tail call i1 @llvm.is.fpclass.f32(float %x, i32 5) ; "-inf|snan"
711 define i1 @is_minus_inf_or_qnan_f(float %x) {
712 ; CHECK-LABEL: is_minus_inf_or_qnan_f:
714 ; CHECK-NEXT: fclass.s $fa0, $fa0
715 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
716 ; CHECK-NEXT: andi $a0, $a0, 6
717 ; CHECK-NEXT: sltu $a0, $zero, $a0
719 %class = tail call i1 @llvm.is.fpclass.f32(float %x, i32 6) ; "-inf|qnan"
723 define i1 @not_is_minus_inf_or_snan_f(float %x) {
724 ; CHECK-LABEL: not_is_minus_inf_or_snan_f:
726 ; CHECK-NEXT: fclass.s $fa0, $fa0
727 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
728 ; CHECK-NEXT: andi $a0, $a0, 1018
729 ; CHECK-NEXT: sltu $a0, $zero, $a0
731 %class = tail call i1 @llvm.is.fpclass.f32(float %x, i32 1018) ; "~(-inf|snan)"
735 define i1 @not_is_minus_inf_or_qnan_f(float %x) {
736 ; CHECK-LABEL: not_is_minus_inf_or_qnan_f:
738 ; CHECK-NEXT: fclass.s $fa0, $fa0
739 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
740 ; CHECK-NEXT: andi $a0, $a0, 1017
741 ; CHECK-NEXT: sltu $a0, $zero, $a0
743 %class = tail call i1 @llvm.is.fpclass.f32(float %x, i32 1017) ; "-inf|qnan"
747 define i1 @issubnormal_or_nan_f(float %x) {
748 ; CHECK-LABEL: issubnormal_or_nan_f:
750 ; CHECK-NEXT: fclass.s $fa0, $fa0
751 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
752 ; CHECK-NEXT: andi $a0, $a0, 275
753 ; CHECK-NEXT: sltu $a0, $zero, $a0
755 %class = tail call i1 @llvm.is.fpclass.f32(float %x, i32 147) ; 0x90|0x3 = "subnormal|nan"
759 define i1 @issubnormal_or_zero_or_nan_f(float %x) {
760 ; CHECK-LABEL: issubnormal_or_zero_or_nan_f:
762 ; CHECK-NEXT: fclass.s $fa0, $fa0
763 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
764 ; CHECK-NEXT: andi $a0, $a0, 819
765 ; CHECK-NEXT: sltu $a0, $zero, $a0
767 %class = tail call i1 @llvm.is.fpclass.f32(float %x, i32 243) ; 0xf0|0x3 = "subnormal|zero|nan"
771 define i1 @issubnormal_or_zero_or_snan_f(float %x) {
772 ; CHECK-LABEL: issubnormal_or_zero_or_snan_f:
774 ; CHECK-NEXT: fclass.s $fa0, $fa0
775 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
776 ; CHECK-NEXT: andi $a0, $a0, 817
777 ; CHECK-NEXT: sltu $a0, $zero, $a0
779 %class = tail call i1 @llvm.is.fpclass.f32(float %x, i32 241) ; 0x90|0x1 = "subnormal|snan"
783 define i1 @issubnormal_or_zero_or_qnan_f(float %x) {
784 ; CHECK-LABEL: issubnormal_or_zero_or_qnan_f:
786 ; CHECK-NEXT: fclass.s $fa0, $fa0
787 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
788 ; CHECK-NEXT: andi $a0, $a0, 818
789 ; CHECK-NEXT: sltu $a0, $zero, $a0
791 %class = tail call i1 @llvm.is.fpclass.f32(float %x, i32 242) ; 0x90|0x2 = "subnormal|qnan"
795 define i1 @not_issubnormal_or_nan_f(float %x) {
796 ; CHECK-LABEL: not_issubnormal_or_nan_f:
798 ; CHECK-NEXT: fclass.s $fa0, $fa0
799 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
800 ; CHECK-NEXT: andi $a0, $a0, 748
801 ; CHECK-NEXT: sltu $a0, $zero, $a0
803 %class = tail call i1 @llvm.is.fpclass.f32(float %x, i32 876) ; ~(0x90|0x3) = ~"subnormal|nan"
807 define i1 @not_issubnormal_or_zero_or_nan_f(float %x) {
808 ; CHECK-LABEL: not_issubnormal_or_zero_or_nan_f:
810 ; CHECK-NEXT: fclass.s $fa0, $fa0
811 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
812 ; CHECK-NEXT: andi $a0, $a0, 204
813 ; CHECK-NEXT: sltu $a0, $zero, $a0
815 %class = tail call i1 @llvm.is.fpclass.f32(float %x, i32 780) ; ~(0xf0|0x3) = ~"subnormal|zero|nan"
819 define i1 @not_issubnormal_or_zero_or_snan_f(float %x) {
820 ; CHECK-LABEL: not_issubnormal_or_zero_or_snan_f:
822 ; CHECK-NEXT: fclass.s $fa0, $fa0
823 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
824 ; CHECK-NEXT: andi $a0, $a0, 206
825 ; CHECK-NEXT: sltu $a0, $zero, $a0
827 %class = tail call i1 @llvm.is.fpclass.f32(float %x, i32 782) ; ~(0x90|0x1) = ~"subnormal|snan"
831 define i1 @not_issubnormal_or_zero_or_qnan_f(float %x) {
832 ; CHECK-LABEL: not_issubnormal_or_zero_or_qnan_f:
834 ; CHECK-NEXT: fclass.s $fa0, $fa0
835 ; CHECK-NEXT: movfr2gr.s $a0, $fa0
836 ; CHECK-NEXT: andi $a0, $a0, 205
837 ; CHECK-NEXT: sltu $a0, $zero, $a0
839 %class = tail call i1 @llvm.is.fpclass.f32(float %x, i32 781) ; ~(0x90|0x2) = ~"subnormal|qnan"
843 declare i1 @llvm.is.fpclass.f32(float, i32)