1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; Test intrinsic 'is_fpclass'.
4 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
6 declare i1 @llvm.is.fpclass.f32(float, i32)
7 declare i1 @llvm.is.fpclass.f64(double, i32)
8 declare i1 @llvm.is.fpclass.f128(fp128, i32)
11 define i1 @isnan_f(float %x) {
12 ; CHECK-LABEL: isnan_f:
14 ; CHECK-NEXT: tceb %f0, 15
16 ; CHECK-NEXT: srl %r2, 28
18 %1 = call i1 @llvm.is.fpclass.f32(float %x, i32 3) ; nan
22 define i1 @isnan_d(double %x) {
23 ; CHECK-LABEL: isnan_d:
25 ; CHECK-NEXT: tcdb %f0, 15
27 ; CHECK-NEXT: srl %r2, 28
29 %1 = call i1 @llvm.is.fpclass.f64(double %x, i32 3) ; nan
33 define i1 @isnan_x(fp128 %x) {
34 ; CHECK-LABEL: isnan_x:
36 ; CHECK-NEXT: ld %f0, 0(%r2)
37 ; CHECK-NEXT: ld %f2, 8(%r2)
38 ; CHECK-NEXT: tcxb %f0, 15
40 ; CHECK-NEXT: srl %r2, 28
42 %1 = call i1 @llvm.is.fpclass.f128(fp128 %x, i32 3) ; nan
46 define i1 @isqnan_f(float %x) {
47 ; CHECK-LABEL: isqnan_f:
49 ; CHECK-NEXT: tceb %f0, 12
51 ; CHECK-NEXT: srl %r2, 28
53 %1 = call i1 @llvm.is.fpclass.f32(float %x, i32 2) ; qnan
57 define i1 @issnan_f(float %x) {
58 ; CHECK-LABEL: issnan_f:
60 ; CHECK-NEXT: tceb %f0, 3
62 ; CHECK-NEXT: srl %r2, 28
64 %1 = call i1 @llvm.is.fpclass.f32(float %x, i32 1) ; snan
68 define i1 @isinf_f(float %x) {
69 ; CHECK-LABEL: isinf_f:
71 ; CHECK-NEXT: tceb %f0, 48
73 ; CHECK-NEXT: srl %r2, 28
75 %1 = call i1 @llvm.is.fpclass.f32(float %x, i32 516) ; 0x204 = "inf"
79 define i1 @isposinf_f(float %x) {
80 ; CHECK-LABEL: isposinf_f:
82 ; CHECK-NEXT: tceb %f0, 32
84 ; CHECK-NEXT: srl %r2, 28
86 %1 = call i1 @llvm.is.fpclass.f32(float %x, i32 512) ; 0x200 = "+inf"
90 define i1 @isneginf_f(float %x) {
91 ; CHECK-LABEL: isneginf_f:
93 ; CHECK-NEXT: tceb %f0, 16
95 ; CHECK-NEXT: srl %r2, 28
97 %1 = call i1 @llvm.is.fpclass.f32(float %x, i32 4) ; "-inf"
101 define i1 @isfinite_f(float %x) {
102 ; CHECK-LABEL: isfinite_f:
104 ; CHECK-NEXT: tceb %f0, 4032
105 ; CHECK-NEXT: ipm %r2
106 ; CHECK-NEXT: srl %r2, 28
107 ; CHECK-NEXT: br %r14
108 %1 = call i1 @llvm.is.fpclass.f32(float %x, i32 504) ; 0x1f8 = "finite"
112 define i1 @isposfinite_f(float %x) {
113 ; CHECK-LABEL: isposfinite_f:
115 ; CHECK-NEXT: tceb %f0, 2688
116 ; CHECK-NEXT: ipm %r2
117 ; CHECK-NEXT: srl %r2, 28
118 ; CHECK-NEXT: br %r14
119 %1 = call i1 @llvm.is.fpclass.f32(float %x, i32 448) ; 0x1c0 = "+finite"
123 define i1 @isnegfinite_f(float %x) {
124 ; CHECK-LABEL: isnegfinite_f:
126 ; CHECK-NEXT: tceb %f0, 1344
127 ; CHECK-NEXT: ipm %r2
128 ; CHECK-NEXT: srl %r2, 28
129 ; CHECK-NEXT: br %r14
130 %1 = call i1 @llvm.is.fpclass.f32(float %x, i32 56) ; 0x38 = "-finite"
134 define i1 @isnotfinite_f(float %x) {
135 ; CHECK-LABEL: isnotfinite_f:
137 ; CHECK-NEXT: tceb %f0, 63
138 ; CHECK-NEXT: ipm %r2
139 ; CHECK-NEXT: srl %r2, 28
140 ; CHECK-NEXT: br %r14
141 %1 = call i1 @llvm.is.fpclass.f32(float %x, i32 519) ; ox207 = "inf|nan"