1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr8 < %s \
3 ; RUN: -verify-machineinstrs | FileCheck %s --check-prefix=P8
4 ; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr9 < %s \
5 ; RUN: -verify-machineinstrs | FileCheck %s --check-prefix=P9
7 define zeroext i1 @abs_isinff(float %x) {
8 ; P8-LABEL: abs_isinff:
9 ; P8: # %bb.0: # %entry
10 ; P8-NEXT: addis 3, 2, .LCPI0_0@toc@ha
11 ; P8-NEXT: xsabsdp 0, 1
13 ; P8-NEXT: lfs 1, .LCPI0_0@toc@l(3)
15 ; P8-NEXT: fcmpu 0, 0, 1
16 ; P8-NEXT: iseleq 3, 4, 3
19 ; P9-LABEL: abs_isinff:
20 ; P9: # %bb.0: # %entry
21 ; P9-NEXT: addis 3, 2, .LCPI0_0@toc@ha
22 ; P9-NEXT: xsabsdp 0, 1
24 ; P9-NEXT: lfs 1, .LCPI0_0@toc@l(3)
26 ; P9-NEXT: fcmpu 0, 0, 1
27 ; P9-NEXT: iseleq 3, 4, 3
30 %0 = tail call float @llvm.fabs.f32(float %x)
31 %cmpinf = fcmp oeq float %0, 0x7FF0000000000000
35 define zeroext i1 @abs_isinf(double %x) {
36 ; P8-LABEL: abs_isinf:
37 ; P8: # %bb.0: # %entry
38 ; P8-NEXT: addis 3, 2, .LCPI1_0@toc@ha
39 ; P8-NEXT: xsabsdp 0, 1
41 ; P8-NEXT: lfs 1, .LCPI1_0@toc@l(3)
43 ; P8-NEXT: fcmpu 0, 0, 1
44 ; P8-NEXT: iseleq 3, 4, 3
47 ; P9-LABEL: abs_isinf:
48 ; P9: # %bb.0: # %entry
49 ; P9-NEXT: addis 3, 2, .LCPI1_0@toc@ha
50 ; P9-NEXT: xsabsdp 0, 1
52 ; P9-NEXT: lfs 1, .LCPI1_0@toc@l(3)
54 ; P9-NEXT: fcmpu 0, 0, 1
55 ; P9-NEXT: iseleq 3, 4, 3
58 %0 = tail call double @llvm.fabs.f64(double %x)
59 %cmpinf = fcmp oeq double %0, 0x7FF0000000000000
63 define zeroext i1 @abs_isinfq(fp128 %x) {
64 ; P8-LABEL: abs_isinfq:
65 ; P8: # %bb.0: # %entry
67 ; P8-NEXT: stdu 1, -48(1)
68 ; P8-NEXT: std 0, 64(1)
69 ; P8-NEXT: .cfi_def_cfa_offset 48
70 ; P8-NEXT: .cfi_offset lr, 16
71 ; P8-NEXT: xxswapd 0, 34
72 ; P8-NEXT: addi 3, 1, 32
73 ; P8-NEXT: stxvd2x 0, 0, 3
74 ; P8-NEXT: lbz 4, 47(1)
75 ; P8-NEXT: clrlwi 4, 4, 25
76 ; P8-NEXT: stb 4, 47(1)
77 ; P8-NEXT: lxvd2x 0, 0, 3
78 ; P8-NEXT: addis 3, 2, .LCPI2_0@toc@ha
79 ; P8-NEXT: addi 3, 3, .LCPI2_0@toc@l
80 ; P8-NEXT: xxswapd 34, 0
81 ; P8-NEXT: lxvd2x 0, 0, 3
82 ; P8-NEXT: xxswapd 35, 0
85 ; P8-NEXT: cntlzw 3, 3
86 ; P8-NEXT: srwi 3, 3, 5
87 ; P8-NEXT: addi 1, 1, 48
88 ; P8-NEXT: ld 0, 16(1)
92 ; P9-LABEL: abs_isinfq:
93 ; P9: # %bb.0: # %entry
94 ; P9-NEXT: addis 3, 2, .LCPI2_0@toc@ha
95 ; P9-NEXT: xsabsqp 2, 2
97 ; P9-NEXT: addi 3, 3, .LCPI2_0@toc@l
98 ; P9-NEXT: lxv 35, 0(3)
100 ; P9-NEXT: xscmpuqp 0, 2, 3
101 ; P9-NEXT: iseleq 3, 4, 3
104 %0 = tail call fp128 @llvm.fabs.f128(fp128 %x)
105 %cmpinf = fcmp oeq fp128 %0, 0xL00000000000000007FFF000000000000
109 define <4 x i1> @abs_isinfv4f32(<4 x float> %x) {
110 ; P8-LABEL: abs_isinfv4f32:
111 ; P8: # %bb.0: # %entry
112 ; P8-NEXT: addis 3, 2, .LCPI3_0@toc@ha
113 ; P8-NEXT: xvabssp 0, 34
114 ; P8-NEXT: addi 3, 3, .LCPI3_0@toc@l
115 ; P8-NEXT: lxvd2x 1, 0, 3
116 ; P8-NEXT: xvcmpeqsp 34, 0, 1
119 ; P9-LABEL: abs_isinfv4f32:
120 ; P9: # %bb.0: # %entry
121 ; P9-NEXT: addis 3, 2, .LCPI3_0@toc@ha
122 ; P9-NEXT: xvabssp 0, 34
123 ; P9-NEXT: addi 3, 3, .LCPI3_0@toc@l
124 ; P9-NEXT: lxv 1, 0(3)
125 ; P9-NEXT: xvcmpeqsp 34, 0, 1
128 %0 = tail call <4 x float> @llvm.fabs.v4f32(<4 x float> %x)
129 %cmpinf = fcmp oeq <4 x float> %0, <float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000>
133 define <2 x i1> @abs_isinfv2f64(<2 x double> %x) {
134 ; P8-LABEL: abs_isinfv2f64:
135 ; P8: # %bb.0: # %entry
136 ; P8-NEXT: addis 3, 2, .LCPI4_0@toc@ha
137 ; P8-NEXT: xvabsdp 0, 34
138 ; P8-NEXT: addi 3, 3, .LCPI4_0@toc@l
139 ; P8-NEXT: lxvd2x 1, 0, 3
140 ; P8-NEXT: xvcmpeqdp 34, 0, 1
143 ; P9-LABEL: abs_isinfv2f64:
144 ; P9: # %bb.0: # %entry
145 ; P9-NEXT: addis 3, 2, .LCPI4_0@toc@ha
146 ; P9-NEXT: xvabsdp 0, 34
147 ; P9-NEXT: addi 3, 3, .LCPI4_0@toc@l
148 ; P9-NEXT: lxv 1, 0(3)
149 ; P9-NEXT: xvcmpeqdp 34, 0, 1
152 %0 = tail call <2 x double> @llvm.fabs.v2f64(<2 x double> %x)
153 %cmpinf = fcmp oeq <2 x double> %0, <double 0x7FF0000000000000, double 0x7FF0000000000000>
157 define zeroext i1 @iszerof(float %x) {
159 ; P8: # %bb.0: # %entry
160 ; P8-NEXT: xxlxor 0, 0, 0
163 ; P8-NEXT: fcmpu 0, 1, 0
164 ; P8-NEXT: iseleq 3, 4, 3
168 ; P9: # %bb.0: # %entry
169 ; P9-NEXT: xxlxor 0, 0, 0
172 ; P9-NEXT: fcmpu 0, 1, 0
173 ; P9-NEXT: iseleq 3, 4, 3
176 %cmp = fcmp oeq float %x, 0.000000e+00
180 define zeroext i1 @iszero(double %x) {
182 ; P8: # %bb.0: # %entry
183 ; P8-NEXT: xxlxor 0, 0, 0
186 ; P8-NEXT: fcmpu 0, 1, 0
187 ; P8-NEXT: iseleq 3, 4, 3
191 ; P9: # %bb.0: # %entry
192 ; P9-NEXT: xxlxor 0, 0, 0
195 ; P9-NEXT: fcmpu 0, 1, 0
196 ; P9-NEXT: iseleq 3, 4, 3
199 %cmp = fcmp oeq double %x, 0.000000e+00
203 define zeroext i1 @iszeroq(fp128 %x) {
205 ; P8: # %bb.0: # %entry
207 ; P8-NEXT: stdu 1, -32(1)
208 ; P8-NEXT: std 0, 48(1)
209 ; P8-NEXT: .cfi_def_cfa_offset 32
210 ; P8-NEXT: .cfi_offset lr, 16
211 ; P8-NEXT: addis 3, 2, .LCPI7_0@toc@ha
212 ; P8-NEXT: addi 3, 3, .LCPI7_0@toc@l
213 ; P8-NEXT: lxvd2x 0, 0, 3
214 ; P8-NEXT: xxswapd 35, 0
215 ; P8-NEXT: bl __eqkf2
217 ; P8-NEXT: cntlzw 3, 3
218 ; P8-NEXT: srwi 3, 3, 5
219 ; P8-NEXT: addi 1, 1, 32
220 ; P8-NEXT: ld 0, 16(1)
225 ; P9: # %bb.0: # %entry
226 ; P9-NEXT: addis 3, 2, .LCPI7_0@toc@ha
228 ; P9-NEXT: addi 3, 3, .LCPI7_0@toc@l
229 ; P9-NEXT: lxv 35, 0(3)
231 ; P9-NEXT: xscmpuqp 0, 2, 3
232 ; P9-NEXT: iseleq 3, 4, 3
235 %cmp = fcmp oeq fp128 %x, 0xL00000000000000000000000000000000
239 define <4 x i1> @iszerov4f32(<4 x float> %x) {
240 ; P8-LABEL: iszerov4f32:
241 ; P8: # %bb.0: # %entry
242 ; P8-NEXT: xxlxor 0, 0, 0
243 ; P8-NEXT: xvcmpeqsp 34, 34, 0
246 ; P9-LABEL: iszerov4f32:
247 ; P9: # %bb.0: # %entry
248 ; P9-NEXT: xxlxor 0, 0, 0
249 ; P9-NEXT: xvcmpeqsp 34, 34, 0
252 %cmp = fcmp oeq <4 x float> %x, <float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00>
256 define <2 x i1> @iszerov2f64(<2 x double> %x) {
257 ; P8-LABEL: iszerov2f64:
258 ; P8: # %bb.0: # %entry
259 ; P8-NEXT: xxlxor 0, 0, 0
260 ; P8-NEXT: xvcmpeqdp 34, 34, 0
263 ; P9-LABEL: iszerov2f64:
264 ; P9: # %bb.0: # %entry
265 ; P9-NEXT: xxlxor 0, 0, 0
266 ; P9-NEXT: xvcmpeqdp 34, 34, 0
269 %cmp = fcmp oeq <2 x double> %x, <double 0.000000e+00, double 0.000000e+00>
273 declare float @llvm.fabs.f32(float)
274 declare double @llvm.fabs.f64(double)
275 declare fp128 @llvm.fabs.f128(fp128)
276 declare <4 x float> @llvm.fabs.v4f32(<4 x float>)
277 declare <2 x double> @llvm.fabs.v2f64(<2 x double>)