1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr9 -verify-machineinstrs -o - %s | FileCheck %s
5 define i1 @isnan_float(float %x) nounwind {
6 ; CHECK-LABEL: isnan_float:
8 ; CHECK-NEXT: xststdcsp 0, 1, 64
11 ; CHECK-NEXT: iseleq 3, 4, 3
13 %1 = call i1 @llvm.is.fpclass.f32(float %x, i32 3) ; nan
17 define i1 @isnan_double(double %x) nounwind {
18 ; CHECK-LABEL: isnan_double:
20 ; CHECK-NEXT: xststdcdp 0, 1, 64
23 ; CHECK-NEXT: iseleq 3, 4, 3
25 %1 = call i1 @llvm.is.fpclass.f64(double %x, i32 3) ; nan
29 define i1 @isnan_ppc_fp128(ppc_fp128 %x) nounwind {
30 ; CHECK-LABEL: isnan_ppc_fp128:
32 ; CHECK-NEXT: xststdcdp 0, 1, 64
35 ; CHECK-NEXT: iseleq 3, 4, 3
37 %1 = call i1 @llvm.is.fpclass.ppcf128(ppc_fp128 %x, i32 3) ; nan
41 define i1 @isnan_f128(fp128 %x) nounwind {
42 ; CHECK-LABEL: isnan_f128:
44 ; CHECK-NEXT: xststdcqp 0, 2, 64
47 ; CHECK-NEXT: iseleq 3, 4, 3
49 %1 = call i1 @llvm.is.fpclass.f128(fp128 %x, i32 3) ; nan
53 define i1 @isnan_float_strictfp(float %x) strictfp nounwind {
54 ; CHECK-LABEL: isnan_float_strictfp:
56 ; CHECK-NEXT: xststdcsp 0, 1, 64
59 ; CHECK-NEXT: iseleq 3, 4, 3
61 %1 = call i1 @llvm.is.fpclass.f32(float %x, i32 3) strictfp ; nan
65 define i1 @isnan_double_strictfp(double %x) strictfp nounwind {
66 ; CHECK-LABEL: isnan_double_strictfp:
68 ; CHECK-NEXT: xststdcdp 0, 1, 64
71 ; CHECK-NEXT: iseleq 3, 4, 3
73 %1 = call i1 @llvm.is.fpclass.f64(double %x, i32 3) strictfp ; nan
77 define i1 @isnan_ppc_fp128_strictfp(ppc_fp128 %x) strictfp nounwind {
78 ; CHECK-LABEL: isnan_ppc_fp128_strictfp:
80 ; CHECK-NEXT: xststdcdp 0, 1, 64
83 ; CHECK-NEXT: iseleq 3, 4, 3
85 %1 = call i1 @llvm.is.fpclass.ppcf128(ppc_fp128 %x, i32 3) strictfp ; nan
89 define i1 @isnan_f128_strictfp(fp128 %x) strictfp nounwind {
90 ; CHECK-LABEL: isnan_f128_strictfp:
92 ; CHECK-NEXT: xststdcqp 0, 2, 64
95 ; CHECK-NEXT: iseleq 3, 4, 3
97 %1 = call i1 @llvm.is.fpclass.f128(fp128 %x, i32 3) strictfp ; nan
101 define i1 @isinf_float(float %x) nounwind {
102 ; CHECK-LABEL: isinf_float:
104 ; CHECK-NEXT: xststdcsp 0, 1, 48
105 ; CHECK-NEXT: li 3, 0
106 ; CHECK-NEXT: li 4, 1
107 ; CHECK-NEXT: iseleq 3, 4, 3
109 %1 = call i1 @llvm.is.fpclass.f32(float %x, i32 516) ; 0x204 = "inf"
113 define i1 @isinf_ppc_fp128(ppc_fp128 %x) nounwind {
114 ; CHECK-LABEL: isinf_ppc_fp128:
116 ; CHECK-NEXT: xststdcdp 0, 1, 48
117 ; CHECK-NEXT: li 3, 0
118 ; CHECK-NEXT: li 4, 1
119 ; CHECK-NEXT: iseleq 3, 4, 3
121 %1 = call i1 @llvm.is.fpclass.ppcf128(ppc_fp128 %x, i32 516) ; 0x204 = "inf"
125 define i1 @isinf_f128(fp128 %x) nounwind {
126 ; CHECK-LABEL: isinf_f128:
128 ; CHECK-NEXT: xststdcqp 0, 2, 48
129 ; CHECK-NEXT: li 3, 0
130 ; CHECK-NEXT: li 4, 1
131 ; CHECK-NEXT: iseleq 3, 4, 3
133 %1 = call i1 @llvm.is.fpclass.f128(fp128 %x, i32 516) ; 0x204 = "inf"
137 define i1 @isfinite_float(float %x) nounwind {
138 ; CHECK-LABEL: isfinite_float:
140 ; CHECK-NEXT: xststdcsp 0, 1, 112
141 ; CHECK-NEXT: li 3, 1
142 ; CHECK-NEXT: iseleq 3, 0, 3
144 %1 = call i1 @llvm.is.fpclass.f32(float %x, i32 504) ; 0x1f8 = "finite"
148 define i1 @isfinite_f128(fp128 %x) nounwind {
149 ; CHECK-LABEL: isfinite_f128:
151 ; CHECK-NEXT: xststdcqp 0, 2, 112
152 ; CHECK-NEXT: li 3, 1
153 ; CHECK-NEXT: iseleq 3, 0, 3
155 %1 = call i1 @llvm.is.fpclass.f128(fp128 %x, i32 504) ; 0x1f8 = "finite"
159 define i1 @isnormal_float(float %x) nounwind {
160 ; CHECK-LABEL: isnormal_float:
162 ; CHECK-NEXT: xststdcsp 0, 1, 127
163 ; CHECK-NEXT: li 3, 1
164 ; CHECK-NEXT: iseleq 3, 0, 3
166 %1 = call i1 @llvm.is.fpclass.f32(float %x, i32 264) ; 0x108 = "normal"
170 define i1 @isnormal_f128(fp128 %x) nounwind {
171 ; CHECK-LABEL: isnormal_f128:
173 ; CHECK-NEXT: xststdcqp 0, 2, 127
174 ; CHECK-NEXT: li 3, 1
175 ; CHECK-NEXT: iseleq 3, 0, 3
177 %1 = call i1 @llvm.is.fpclass.f128(fp128 %x, i32 264) ; 0x108 = "normal"
181 define i1 @issubnormal_float(float %x) nounwind {
182 ; CHECK-LABEL: issubnormal_float:
184 ; CHECK-NEXT: xststdcsp 0, 1, 3
185 ; CHECK-NEXT: li 3, 0
186 ; CHECK-NEXT: li 4, 1
187 ; CHECK-NEXT: iseleq 3, 4, 3
189 %1 = call i1 @llvm.is.fpclass.f32(float %x, i32 144) ; 0x90 = "subnormal"
193 define i1 @issubnormal_f128(fp128 %x) nounwind {
194 ; CHECK-LABEL: issubnormal_f128:
196 ; CHECK-NEXT: xststdcqp 0, 2, 3
197 ; CHECK-NEXT: li 3, 0
198 ; CHECK-NEXT: li 4, 1
199 ; CHECK-NEXT: iseleq 3, 4, 3
201 %1 = call i1 @llvm.is.fpclass.f128(fp128 %x, i32 144) ; 0x90 = "subnormal"
205 define i1 @iszero_float(float %x) nounwind {
206 ; CHECK-LABEL: iszero_float:
208 ; CHECK-NEXT: xststdcsp 0, 1, 12
209 ; CHECK-NEXT: li 3, 0
210 ; CHECK-NEXT: li 4, 1
211 ; CHECK-NEXT: iseleq 3, 4, 3
213 %1 = call i1 @llvm.is.fpclass.f32(float %x, i32 96) ; 0x60 = "zero"
217 define i1 @iszero_f128(fp128 %x) nounwind {
218 ; CHECK-LABEL: iszero_f128:
220 ; CHECK-NEXT: xststdcqp 0, 2, 12
221 ; CHECK-NEXT: li 3, 0
222 ; CHECK-NEXT: li 4, 1
223 ; CHECK-NEXT: iseleq 3, 4, 3
225 %1 = call i1 @llvm.is.fpclass.f128(fp128 %x, i32 96) ; 0x60 = "zero"
229 define i1 @issnan_float(float %x) nounwind {
230 ; CHECK-LABEL: issnan_float:
232 ; CHECK-NEXT: xscvdpspn 0, 1
233 ; CHECK-NEXT: xststdcsp 1, 1, 64
234 ; CHECK-NEXT: mffprwz 3, 0
235 ; CHECK-NEXT: andis. 3, 3, 64
236 ; CHECK-NEXT: li 3, 1
237 ; CHECK-NEXT: crnand 20, 6, 2
238 ; CHECK-NEXT: isel 3, 0, 3, 20
240 %1 = call i1 @llvm.is.fpclass.f32(float %x, i32 1)
244 define i1 @issnan_double(double %x) nounwind {
245 ; CHECK-LABEL: issnan_double:
247 ; CHECK-NEXT: mffprd 3, 1
248 ; CHECK-NEXT: xststdcdp 1, 1, 64
249 ; CHECK-NEXT: rldicl 3, 3, 32, 32
250 ; CHECK-NEXT: andis. 3, 3, 8
251 ; CHECK-NEXT: li 3, 1
252 ; CHECK-NEXT: crnand 20, 6, 2
253 ; CHECK-NEXT: isel 3, 0, 3, 20
255 %1 = call i1 @llvm.is.fpclass.f64(double %x, i32 1)
259 define i1 @issnan_fp128(fp128 %x) nounwind {
260 ; CHECK-LABEL: issnan_fp128:
262 ; CHECK-NEXT: li 3, 12
263 ; CHECK-NEXT: xststdcqp 1, 2, 64
264 ; CHECK-NEXT: vextuwrx 3, 3, 2
265 ; CHECK-NEXT: andi. 3, 3, 32768
266 ; CHECK-NEXT: li 3, 1
267 ; CHECK-NEXT: crnand 20, 6, 2
268 ; CHECK-NEXT: isel 3, 0, 3, 20
270 %1 = call i1 @llvm.is.fpclass.f128(fp128 %x, i32 1)
274 define i1 @issnan_ppc_fp128(ppc_fp128 %x) nounwind {
275 ; CHECK-LABEL: issnan_ppc_fp128:
277 ; CHECK-NEXT: mffprd 3, 1
278 ; CHECK-NEXT: xststdcdp 1, 1, 64
279 ; CHECK-NEXT: rldicl 3, 3, 32, 32
280 ; CHECK-NEXT: andis. 3, 3, 8
281 ; CHECK-NEXT: li 3, 1
282 ; CHECK-NEXT: crnand 20, 6, 2
283 ; CHECK-NEXT: isel 3, 0, 3, 20
285 %1 = call i1 @llvm.is.fpclass.ppcf128(ppc_fp128 %x, i32 1)
289 define i1 @isqnan_float(float %x) nounwind {
290 ; CHECK-LABEL: isqnan_float:
292 ; CHECK-NEXT: xscvdpspn 0, 1
293 ; CHECK-NEXT: xststdcsp 1, 1, 64
294 ; CHECK-NEXT: mffprwz 3, 0
295 ; CHECK-NEXT: srwi 3, 3, 22
296 ; CHECK-NEXT: andi. 3, 3, 1
297 ; CHECK-NEXT: li 3, 1
298 ; CHECK-NEXT: crnand 20, 6, 1
299 ; CHECK-NEXT: isel 3, 0, 3, 20
301 %1 = call i1 @llvm.is.fpclass.f32(float %x, i32 2)
305 define i1 @isqnan_double(double %x) nounwind {
306 ; CHECK-LABEL: isqnan_double:
308 ; CHECK-NEXT: mffprd 3, 1
309 ; CHECK-NEXT: xststdcdp 1, 1, 64
310 ; CHECK-NEXT: rldicl 3, 3, 13, 51
311 ; CHECK-NEXT: andi. 3, 3, 1
312 ; CHECK-NEXT: li 3, 1
313 ; CHECK-NEXT: crnand 20, 6, 1
314 ; CHECK-NEXT: isel 3, 0, 3, 20
316 %1 = call i1 @llvm.is.fpclass.f64(double %x, i32 2)
320 define i1 @isqnan_fp128(fp128 %x) nounwind {
321 ; CHECK-LABEL: isqnan_fp128:
323 ; CHECK-NEXT: li 3, 12
324 ; CHECK-NEXT: xststdcqp 1, 2, 64
325 ; CHECK-NEXT: vextuwrx 3, 3, 2
326 ; CHECK-NEXT: srwi 3, 3, 15
327 ; CHECK-NEXT: andi. 3, 3, 1
328 ; CHECK-NEXT: li 3, 1
329 ; CHECK-NEXT: crnand 20, 6, 1
330 ; CHECK-NEXT: isel 3, 0, 3, 20
332 %1 = call i1 @llvm.is.fpclass.f128(fp128 %x, i32 2)
336 define i1 @isqnan_ppc_fp128(ppc_fp128 %x) nounwind {
337 ; CHECK-LABEL: isqnan_ppc_fp128:
339 ; CHECK-NEXT: mffprd 3, 1
340 ; CHECK-NEXT: xststdcdp 1, 1, 64
341 ; CHECK-NEXT: rldicl 3, 3, 13, 51
342 ; CHECK-NEXT: andi. 3, 3, 1
343 ; CHECK-NEXT: li 3, 1
344 ; CHECK-NEXT: crnand 20, 6, 1
345 ; CHECK-NEXT: isel 3, 0, 3, 20
347 %1 = call i1 @llvm.is.fpclass.ppcf128(ppc_fp128 %x, i32 2)
351 define i1 @isposzero_double(double %x) nounwind {
352 ; CHECK-LABEL: isposzero_double:
354 ; CHECK-NEXT: xststdcdp 0, 1, 8
355 ; CHECK-NEXT: li 3, 0
356 ; CHECK-NEXT: li 4, 1
357 ; CHECK-NEXT: iseleq 3, 4, 3
359 %1 = call i1 @llvm.is.fpclass.f64(double %x, i32 64)
363 define i1 @isnegzero_double(double %x) nounwind {
364 ; CHECK-LABEL: isnegzero_double:
366 ; CHECK-NEXT: xststdcdp 0, 1, 4
367 ; CHECK-NEXT: li 3, 0
368 ; CHECK-NEXT: li 4, 1
369 ; CHECK-NEXT: iseleq 3, 4, 3
371 %1 = call i1 @llvm.is.fpclass.f64(double %x, i32 32)
375 define i1 @isposnormal_double(double %x) nounwind {
376 ; CHECK-LABEL: isposnormal_double:
378 ; CHECK-NEXT: xststdcdp 0, 1, 127
379 ; CHECK-NEXT: li 3, 1
380 ; CHECK-NEXT: cror 20, 0, 2
381 ; CHECK-NEXT: isel 3, 0, 3, 20
383 %1 = call i1 @llvm.is.fpclass.f64(double %x, i32 256)
387 define i1 @isnegnormal_double(double %x) nounwind {
388 ; CHECK-LABEL: isnegnormal_double:
390 ; CHECK-NEXT: xststdcdp 0, 1, 127
391 ; CHECK-NEXT: li 3, 1
392 ; CHECK-NEXT: crorc 20, 2, 0
393 ; CHECK-NEXT: isel 3, 0, 3, 20
395 %1 = call i1 @llvm.is.fpclass.f64(double %x, i32 8)
399 define i1 @isnormal_double(double %x) nounwind {
400 ; CHECK-LABEL: isnormal_double:
402 ; CHECK-NEXT: xststdcdp 0, 1, 127
403 ; CHECK-NEXT: li 3, 1
404 ; CHECK-NEXT: iseleq 3, 0, 3
406 %1 = call i1 @llvm.is.fpclass.f64(double %x, i32 264)
410 define i1 @isclass_00d_double(double %x) nounwind {
411 ; CHECK-LABEL: isclass_00d_double:
413 ; CHECK-NEXT: mffprd 3, 1
414 ; CHECK-NEXT: xststdcdp 0, 1, 127
415 ; CHECK-NEXT: xststdcdp 1, 1, 64
416 ; CHECK-NEXT: rldicl 3, 3, 32, 32
417 ; CHECK-NEXT: crandc 20, 0, 2
418 ; CHECK-NEXT: andis. 3, 3, 8
419 ; CHECK-NEXT: li 3, 1
420 ; CHECK-NEXT: crand 21, 6, 2
421 ; CHECK-NEXT: xststdcdp 0, 1, 16
422 ; CHECK-NEXT: cror 21, 2, 21
423 ; CHECK-NEXT: crnor 20, 21, 20
424 ; CHECK-NEXT: isel 3, 0, 3, 20
426 %1 = call i1 @llvm.is.fpclass.f64(double %x, i32 13)
430 define i1 @isclass_1c0_float(float %x) nounwind {
431 ; CHECK-LABEL: isclass_1c0_float:
433 ; CHECK-NEXT: xststdcsp 0, 1, 127
434 ; CHECK-NEXT: li 3, 1
435 ; CHECK-NEXT: crnor 20, 0, 2
436 ; CHECK-NEXT: xststdcsp 0, 1, 10
437 ; CHECK-NEXT: crnor 20, 2, 20
438 ; CHECK-NEXT: isel 3, 0, 3, 20
440 %1 = call i1 @llvm.is.fpclass.f32(float %x, i32 448)
444 declare i1 @llvm.is.fpclass.f32(float, i32)
445 declare i1 @llvm.is.fpclass.f64(double, i32)
446 declare i1 @llvm.is.fpclass.ppcf128(ppc_fp128, i32)
447 declare i1 @llvm.is.fpclass.f128(fp128, i32)