1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-- -mcpu=nehalem | FileCheck %s --check-prefixes=NHM
3 ; RUN: llc < %s -mtriple=x86_64-- -mcpu=sandybridge | FileCheck %s --check-prefixes=FAST-SCALAR,SNB
4 ; RUN: llc < %s -mtriple=x86_64-- -mcpu=broadwell | FileCheck %s --check-prefixes=FAST-SCALAR,BDW
5 ; RUN: llc < %s -mtriple=x86_64-- -mcpu=skylake | FileCheck %s --check-prefixes=FAST-SCALAR,FAST-VECTOR
6 ; RUN: llc < %s -mtriple=x86_64-- -mcpu=znver1 | FileCheck %s --check-prefixes=FAST-SCALAR,FAST-VECTOR
7 ; RUN: llc < %s -mtriple=x86_64-- -mcpu=znver3 | FileCheck %s --check-prefixes=FAST-SCALAR,FAST-VECTOR
8 ; RUN: llc < %s -mtriple=x86_64-- -mcpu=znver4 | FileCheck %s --check-prefixes=FAST-SCALAR,FAST-VECTOR
9 ; RUN: llc < %s -mtriple=x86_64-- -mcpu=znver5 | FileCheck %s --check-prefixes=FAST-SCALAR,FAST-VECTOR
10 ; RUN: llc < %s -mtriple=x86_64-- -mcpu=x86-64 | FileCheck %s --check-prefixes=X86-64
12 define float @f32_no_daz(float %f) #0 {
13 ; NHM-LABEL: f32_no_daz:
15 ; NHM-NEXT: rsqrtss %xmm0, %xmm1
16 ; NHM-NEXT: movaps %xmm0, %xmm2
17 ; NHM-NEXT: mulss %xmm1, %xmm2
18 ; NHM-NEXT: movss {{.*#+}} xmm3 = [-5.0E-1,0.0E+0,0.0E+0,0.0E+0]
19 ; NHM-NEXT: mulss %xmm2, %xmm3
20 ; NHM-NEXT: mulss %xmm1, %xmm2
21 ; NHM-NEXT: addss {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2
22 ; NHM-NEXT: mulss %xmm3, %xmm2
23 ; NHM-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
24 ; NHM-NEXT: cmpltss {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
25 ; NHM-NEXT: andnps %xmm2, %xmm0
28 ; FAST-SCALAR-LABEL: f32_no_daz:
29 ; FAST-SCALAR: # %bb.0:
30 ; FAST-SCALAR-NEXT: vsqrtss %xmm0, %xmm0, %xmm0
31 ; FAST-SCALAR-NEXT: retq
33 ; X86-64-LABEL: f32_no_daz:
35 ; X86-64-NEXT: sqrtss %xmm0, %xmm0
37 %call = tail call fast float @llvm.sqrt.f32(float %f) #2
41 define <4 x float> @v4f32_no_daz(<4 x float> %f) #0 {
42 ; NHM-LABEL: v4f32_no_daz:
44 ; NHM-NEXT: rsqrtps %xmm0, %xmm1
45 ; NHM-NEXT: movaps %xmm0, %xmm2
46 ; NHM-NEXT: mulps %xmm1, %xmm2
47 ; NHM-NEXT: movaps {{.*#+}} xmm3 = [-5.0E-1,-5.0E-1,-5.0E-1,-5.0E-1]
48 ; NHM-NEXT: mulps %xmm2, %xmm3
49 ; NHM-NEXT: mulps %xmm1, %xmm2
50 ; NHM-NEXT: addps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2
51 ; NHM-NEXT: mulps %xmm3, %xmm2
52 ; NHM-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
53 ; NHM-NEXT: movaps {{.*#+}} xmm1 = [1.17549435E-38,1.17549435E-38,1.17549435E-38,1.17549435E-38]
54 ; NHM-NEXT: cmpleps %xmm0, %xmm1
55 ; NHM-NEXT: andps %xmm2, %xmm1
56 ; NHM-NEXT: movaps %xmm1, %xmm0
59 ; SNB-LABEL: v4f32_no_daz:
61 ; SNB-NEXT: vrsqrtps %xmm0, %xmm1
62 ; SNB-NEXT: vmulps %xmm1, %xmm0, %xmm2
63 ; SNB-NEXT: vmulps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm3
64 ; SNB-NEXT: vmulps %xmm1, %xmm2, %xmm1
65 ; SNB-NEXT: vaddps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
66 ; SNB-NEXT: vmulps %xmm1, %xmm3, %xmm1
67 ; SNB-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
68 ; SNB-NEXT: vbroadcastss {{.*#+}} xmm2 = [1.17549435E-38,1.17549435E-38,1.17549435E-38,1.17549435E-38]
69 ; SNB-NEXT: vcmpleps %xmm0, %xmm2, %xmm0
70 ; SNB-NEXT: vandps %xmm1, %xmm0, %xmm0
73 ; BDW-LABEL: v4f32_no_daz:
75 ; BDW-NEXT: vrsqrtps %xmm0, %xmm1
76 ; BDW-NEXT: vmulps %xmm1, %xmm0, %xmm2
77 ; BDW-NEXT: vbroadcastss {{.*#+}} xmm3 = [-3.0E+0,-3.0E+0,-3.0E+0,-3.0E+0]
78 ; BDW-NEXT: vfmadd231ps {{.*#+}} xmm3 = (xmm2 * xmm1) + xmm3
79 ; BDW-NEXT: vbroadcastss {{.*#+}} xmm1 = [-5.0E-1,-5.0E-1,-5.0E-1,-5.0E-1]
80 ; BDW-NEXT: vmulps %xmm1, %xmm2, %xmm1
81 ; BDW-NEXT: vmulps %xmm3, %xmm1, %xmm1
82 ; BDW-NEXT: vbroadcastss {{.*#+}} xmm2 = [NaN,NaN,NaN,NaN]
83 ; BDW-NEXT: vandps %xmm2, %xmm0, %xmm0
84 ; BDW-NEXT: vbroadcastss {{.*#+}} xmm2 = [1.17549435E-38,1.17549435E-38,1.17549435E-38,1.17549435E-38]
85 ; BDW-NEXT: vcmpleps %xmm0, %xmm2, %xmm0
86 ; BDW-NEXT: vandps %xmm1, %xmm0, %xmm0
89 ; FAST-VECTOR-LABEL: v4f32_no_daz:
90 ; FAST-VECTOR: # %bb.0:
91 ; FAST-VECTOR-NEXT: vsqrtps %xmm0, %xmm0
92 ; FAST-VECTOR-NEXT: retq
94 ; X86-64-LABEL: v4f32_no_daz:
96 ; X86-64-NEXT: rsqrtps %xmm0, %xmm1
97 ; X86-64-NEXT: movaps %xmm0, %xmm2
98 ; X86-64-NEXT: mulps %xmm1, %xmm2
99 ; X86-64-NEXT: movaps {{.*#+}} xmm3 = [-5.0E-1,-5.0E-1,-5.0E-1,-5.0E-1]
100 ; X86-64-NEXT: mulps %xmm2, %xmm3
101 ; X86-64-NEXT: mulps %xmm1, %xmm2
102 ; X86-64-NEXT: addps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2
103 ; X86-64-NEXT: mulps %xmm3, %xmm2
104 ; X86-64-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
105 ; X86-64-NEXT: movaps {{.*#+}} xmm1 = [1.17549435E-38,1.17549435E-38,1.17549435E-38,1.17549435E-38]
106 ; X86-64-NEXT: cmpleps %xmm0, %xmm1
107 ; X86-64-NEXT: andps %xmm2, %xmm1
108 ; X86-64-NEXT: movaps %xmm1, %xmm0
110 %call = tail call fast <4 x float> @llvm.sqrt.v4f32(<4 x float> %f) #2
111 ret <4 x float> %call
114 define <8 x float> @v8f32_no_daz(<8 x float> %f) #0 {
115 ; NHM-LABEL: v8f32_no_daz:
117 ; NHM-NEXT: rsqrtps %xmm0, %xmm2
118 ; NHM-NEXT: movaps %xmm0, %xmm4
119 ; NHM-NEXT: mulps %xmm2, %xmm4
120 ; NHM-NEXT: movaps {{.*#+}} xmm5 = [-5.0E-1,-5.0E-1,-5.0E-1,-5.0E-1]
121 ; NHM-NEXT: movaps %xmm4, %xmm3
122 ; NHM-NEXT: mulps %xmm5, %xmm3
123 ; NHM-NEXT: mulps %xmm2, %xmm4
124 ; NHM-NEXT: movaps {{.*#+}} xmm6 = [-3.0E+0,-3.0E+0,-3.0E+0,-3.0E+0]
125 ; NHM-NEXT: addps %xmm6, %xmm4
126 ; NHM-NEXT: mulps %xmm3, %xmm4
127 ; NHM-NEXT: movaps {{.*#+}} xmm7 = [NaN,NaN,NaN,NaN]
128 ; NHM-NEXT: andps %xmm7, %xmm0
129 ; NHM-NEXT: movaps {{.*#+}} xmm2 = [1.17549435E-38,1.17549435E-38,1.17549435E-38,1.17549435E-38]
130 ; NHM-NEXT: movaps %xmm2, %xmm3
131 ; NHM-NEXT: cmpleps %xmm0, %xmm3
132 ; NHM-NEXT: andps %xmm4, %xmm3
133 ; NHM-NEXT: rsqrtps %xmm1, %xmm0
134 ; NHM-NEXT: movaps %xmm1, %xmm4
135 ; NHM-NEXT: mulps %xmm0, %xmm4
136 ; NHM-NEXT: mulps %xmm4, %xmm5
137 ; NHM-NEXT: mulps %xmm0, %xmm4
138 ; NHM-NEXT: addps %xmm6, %xmm4
139 ; NHM-NEXT: mulps %xmm5, %xmm4
140 ; NHM-NEXT: andps %xmm7, %xmm1
141 ; NHM-NEXT: cmpleps %xmm1, %xmm2
142 ; NHM-NEXT: andps %xmm4, %xmm2
143 ; NHM-NEXT: movaps %xmm3, %xmm0
144 ; NHM-NEXT: movaps %xmm2, %xmm1
147 ; SNB-LABEL: v8f32_no_daz:
149 ; SNB-NEXT: vrsqrtps %ymm0, %ymm1
150 ; SNB-NEXT: vmulps %ymm1, %ymm0, %ymm2
151 ; SNB-NEXT: vmulps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm2, %ymm3
152 ; SNB-NEXT: vmulps %ymm1, %ymm2, %ymm1
153 ; SNB-NEXT: vaddps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm1, %ymm1
154 ; SNB-NEXT: vmulps %ymm1, %ymm3, %ymm1
155 ; SNB-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0, %ymm0
156 ; SNB-NEXT: vbroadcastss {{.*#+}} ymm2 = [1.17549435E-38,1.17549435E-38,1.17549435E-38,1.17549435E-38,1.17549435E-38,1.17549435E-38,1.17549435E-38,1.17549435E-38]
157 ; SNB-NEXT: vcmpleps %ymm0, %ymm2, %ymm0
158 ; SNB-NEXT: vandps %ymm1, %ymm0, %ymm0
161 ; BDW-LABEL: v8f32_no_daz:
163 ; BDW-NEXT: vrsqrtps %ymm0, %ymm1
164 ; BDW-NEXT: vmulps %ymm1, %ymm0, %ymm2
165 ; BDW-NEXT: vbroadcastss {{.*#+}} ymm3 = [-3.0E+0,-3.0E+0,-3.0E+0,-3.0E+0,-3.0E+0,-3.0E+0,-3.0E+0,-3.0E+0]
166 ; BDW-NEXT: vfmadd231ps {{.*#+}} ymm3 = (ymm2 * ymm1) + ymm3
167 ; BDW-NEXT: vbroadcastss {{.*#+}} ymm1 = [-5.0E-1,-5.0E-1,-5.0E-1,-5.0E-1,-5.0E-1,-5.0E-1,-5.0E-1,-5.0E-1]
168 ; BDW-NEXT: vmulps %ymm1, %ymm2, %ymm1
169 ; BDW-NEXT: vmulps %ymm3, %ymm1, %ymm1
170 ; BDW-NEXT: vbroadcastss {{.*#+}} ymm2 = [NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]
171 ; BDW-NEXT: vandps %ymm2, %ymm0, %ymm0
172 ; BDW-NEXT: vbroadcastss {{.*#+}} ymm2 = [1.17549435E-38,1.17549435E-38,1.17549435E-38,1.17549435E-38,1.17549435E-38,1.17549435E-38,1.17549435E-38,1.17549435E-38]
173 ; BDW-NEXT: vcmpleps %ymm0, %ymm2, %ymm0
174 ; BDW-NEXT: vandps %ymm1, %ymm0, %ymm0
177 ; FAST-VECTOR-LABEL: v8f32_no_daz:
178 ; FAST-VECTOR: # %bb.0:
179 ; FAST-VECTOR-NEXT: vsqrtps %ymm0, %ymm0
180 ; FAST-VECTOR-NEXT: retq
182 ; X86-64-LABEL: v8f32_no_daz:
184 ; X86-64-NEXT: rsqrtps %xmm0, %xmm2
185 ; X86-64-NEXT: movaps %xmm0, %xmm4
186 ; X86-64-NEXT: mulps %xmm2, %xmm4
187 ; X86-64-NEXT: movaps {{.*#+}} xmm5 = [-5.0E-1,-5.0E-1,-5.0E-1,-5.0E-1]
188 ; X86-64-NEXT: movaps %xmm4, %xmm3
189 ; X86-64-NEXT: mulps %xmm5, %xmm3
190 ; X86-64-NEXT: mulps %xmm2, %xmm4
191 ; X86-64-NEXT: movaps {{.*#+}} xmm6 = [-3.0E+0,-3.0E+0,-3.0E+0,-3.0E+0]
192 ; X86-64-NEXT: addps %xmm6, %xmm4
193 ; X86-64-NEXT: mulps %xmm3, %xmm4
194 ; X86-64-NEXT: movaps {{.*#+}} xmm7 = [NaN,NaN,NaN,NaN]
195 ; X86-64-NEXT: andps %xmm7, %xmm0
196 ; X86-64-NEXT: movaps {{.*#+}} xmm2 = [1.17549435E-38,1.17549435E-38,1.17549435E-38,1.17549435E-38]
197 ; X86-64-NEXT: movaps %xmm2, %xmm3
198 ; X86-64-NEXT: cmpleps %xmm0, %xmm3
199 ; X86-64-NEXT: andps %xmm4, %xmm3
200 ; X86-64-NEXT: rsqrtps %xmm1, %xmm0
201 ; X86-64-NEXT: movaps %xmm1, %xmm4
202 ; X86-64-NEXT: mulps %xmm0, %xmm4
203 ; X86-64-NEXT: mulps %xmm4, %xmm5
204 ; X86-64-NEXT: mulps %xmm0, %xmm4
205 ; X86-64-NEXT: addps %xmm6, %xmm4
206 ; X86-64-NEXT: mulps %xmm5, %xmm4
207 ; X86-64-NEXT: andps %xmm7, %xmm1
208 ; X86-64-NEXT: cmpleps %xmm1, %xmm2
209 ; X86-64-NEXT: andps %xmm4, %xmm2
210 ; X86-64-NEXT: movaps %xmm3, %xmm0
211 ; X86-64-NEXT: movaps %xmm2, %xmm1
213 %call = tail call fast <8 x float> @llvm.sqrt.v8f32(<8 x float> %f) #2
214 ret <8 x float> %call
217 ; Repeat all tests with denorms-as-zero enabled.
219 define float @f32_daz(float %f) #1 {
220 ; NHM-LABEL: f32_daz:
222 ; NHM-NEXT: rsqrtss %xmm0, %xmm1
223 ; NHM-NEXT: movaps %xmm0, %xmm2
224 ; NHM-NEXT: mulss %xmm1, %xmm2
225 ; NHM-NEXT: movss {{.*#+}} xmm3 = [-5.0E-1,0.0E+0,0.0E+0,0.0E+0]
226 ; NHM-NEXT: mulss %xmm2, %xmm3
227 ; NHM-NEXT: mulss %xmm1, %xmm2
228 ; NHM-NEXT: addss {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2
229 ; NHM-NEXT: mulss %xmm3, %xmm2
230 ; NHM-NEXT: xorps %xmm1, %xmm1
231 ; NHM-NEXT: cmpeqss %xmm1, %xmm0
232 ; NHM-NEXT: andnps %xmm2, %xmm0
235 ; FAST-SCALAR-LABEL: f32_daz:
236 ; FAST-SCALAR: # %bb.0:
237 ; FAST-SCALAR-NEXT: vsqrtss %xmm0, %xmm0, %xmm0
238 ; FAST-SCALAR-NEXT: retq
240 ; X86-64-LABEL: f32_daz:
242 ; X86-64-NEXT: sqrtss %xmm0, %xmm0
244 %call = tail call fast float @llvm.sqrt.f32(float %f) #2
248 define <4 x float> @v4f32_daz(<4 x float> %f) #1 {
249 ; NHM-LABEL: v4f32_daz:
251 ; NHM-NEXT: rsqrtps %xmm0, %xmm1
252 ; NHM-NEXT: movaps %xmm0, %xmm2
253 ; NHM-NEXT: mulps %xmm1, %xmm2
254 ; NHM-NEXT: movaps {{.*#+}} xmm3 = [-5.0E-1,-5.0E-1,-5.0E-1,-5.0E-1]
255 ; NHM-NEXT: mulps %xmm2, %xmm3
256 ; NHM-NEXT: mulps %xmm1, %xmm2
257 ; NHM-NEXT: addps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2
258 ; NHM-NEXT: mulps %xmm3, %xmm2
259 ; NHM-NEXT: xorps %xmm1, %xmm1
260 ; NHM-NEXT: cmpneqps %xmm1, %xmm0
261 ; NHM-NEXT: andps %xmm2, %xmm0
264 ; SNB-LABEL: v4f32_daz:
266 ; SNB-NEXT: vrsqrtps %xmm0, %xmm1
267 ; SNB-NEXT: vmulps %xmm1, %xmm0, %xmm2
268 ; SNB-NEXT: vmulps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm3
269 ; SNB-NEXT: vmulps %xmm1, %xmm2, %xmm1
270 ; SNB-NEXT: vaddps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
271 ; SNB-NEXT: vmulps %xmm1, %xmm3, %xmm1
272 ; SNB-NEXT: vxorps %xmm2, %xmm2, %xmm2
273 ; SNB-NEXT: vcmpneqps %xmm2, %xmm0, %xmm0
274 ; SNB-NEXT: vandps %xmm1, %xmm0, %xmm0
277 ; BDW-LABEL: v4f32_daz:
279 ; BDW-NEXT: vrsqrtps %xmm0, %xmm1
280 ; BDW-NEXT: vmulps %xmm1, %xmm0, %xmm2
281 ; BDW-NEXT: vbroadcastss {{.*#+}} xmm3 = [-3.0E+0,-3.0E+0,-3.0E+0,-3.0E+0]
282 ; BDW-NEXT: vfmadd231ps {{.*#+}} xmm3 = (xmm2 * xmm1) + xmm3
283 ; BDW-NEXT: vbroadcastss {{.*#+}} xmm1 = [-5.0E-1,-5.0E-1,-5.0E-1,-5.0E-1]
284 ; BDW-NEXT: vmulps %xmm1, %xmm2, %xmm1
285 ; BDW-NEXT: vmulps %xmm3, %xmm1, %xmm1
286 ; BDW-NEXT: vxorps %xmm2, %xmm2, %xmm2
287 ; BDW-NEXT: vcmpneqps %xmm2, %xmm0, %xmm0
288 ; BDW-NEXT: vandps %xmm1, %xmm0, %xmm0
291 ; FAST-VECTOR-LABEL: v4f32_daz:
292 ; FAST-VECTOR: # %bb.0:
293 ; FAST-VECTOR-NEXT: vsqrtps %xmm0, %xmm0
294 ; FAST-VECTOR-NEXT: retq
296 ; X86-64-LABEL: v4f32_daz:
298 ; X86-64-NEXT: rsqrtps %xmm0, %xmm1
299 ; X86-64-NEXT: movaps %xmm0, %xmm2
300 ; X86-64-NEXT: mulps %xmm1, %xmm2
301 ; X86-64-NEXT: movaps {{.*#+}} xmm3 = [-5.0E-1,-5.0E-1,-5.0E-1,-5.0E-1]
302 ; X86-64-NEXT: mulps %xmm2, %xmm3
303 ; X86-64-NEXT: mulps %xmm1, %xmm2
304 ; X86-64-NEXT: addps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2
305 ; X86-64-NEXT: mulps %xmm3, %xmm2
306 ; X86-64-NEXT: xorps %xmm1, %xmm1
307 ; X86-64-NEXT: cmpneqps %xmm1, %xmm0
308 ; X86-64-NEXT: andps %xmm2, %xmm0
310 %call = tail call fast <4 x float> @llvm.sqrt.v4f32(<4 x float> %f) #2
311 ret <4 x float> %call
314 define <8 x float> @v8f32_daz(<8 x float> %f) #1 {
315 ; NHM-LABEL: v8f32_daz:
317 ; NHM-NEXT: rsqrtps %xmm0, %xmm2
318 ; NHM-NEXT: movaps %xmm0, %xmm3
319 ; NHM-NEXT: mulps %xmm2, %xmm3
320 ; NHM-NEXT: movaps {{.*#+}} xmm4 = [-5.0E-1,-5.0E-1,-5.0E-1,-5.0E-1]
321 ; NHM-NEXT: movaps %xmm3, %xmm5
322 ; NHM-NEXT: mulps %xmm4, %xmm5
323 ; NHM-NEXT: mulps %xmm2, %xmm3
324 ; NHM-NEXT: movaps {{.*#+}} xmm2 = [-3.0E+0,-3.0E+0,-3.0E+0,-3.0E+0]
325 ; NHM-NEXT: addps %xmm2, %xmm3
326 ; NHM-NEXT: mulps %xmm5, %xmm3
327 ; NHM-NEXT: xorps %xmm5, %xmm5
328 ; NHM-NEXT: cmpneqps %xmm5, %xmm0
329 ; NHM-NEXT: andps %xmm3, %xmm0
330 ; NHM-NEXT: rsqrtps %xmm1, %xmm3
331 ; NHM-NEXT: movaps %xmm1, %xmm6
332 ; NHM-NEXT: mulps %xmm3, %xmm6
333 ; NHM-NEXT: mulps %xmm6, %xmm4
334 ; NHM-NEXT: mulps %xmm3, %xmm6
335 ; NHM-NEXT: addps %xmm2, %xmm6
336 ; NHM-NEXT: mulps %xmm4, %xmm6
337 ; NHM-NEXT: cmpneqps %xmm5, %xmm1
338 ; NHM-NEXT: andps %xmm6, %xmm1
341 ; SNB-LABEL: v8f32_daz:
343 ; SNB-NEXT: vrsqrtps %ymm0, %ymm1
344 ; SNB-NEXT: vmulps %ymm1, %ymm0, %ymm2
345 ; SNB-NEXT: vmulps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm2, %ymm3
346 ; SNB-NEXT: vmulps %ymm1, %ymm2, %ymm1
347 ; SNB-NEXT: vaddps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm1, %ymm1
348 ; SNB-NEXT: vmulps %ymm1, %ymm3, %ymm1
349 ; SNB-NEXT: vxorps %xmm2, %xmm2, %xmm2
350 ; SNB-NEXT: vcmpneqps %ymm2, %ymm0, %ymm0
351 ; SNB-NEXT: vandps %ymm1, %ymm0, %ymm0
354 ; BDW-LABEL: v8f32_daz:
356 ; BDW-NEXT: vrsqrtps %ymm0, %ymm1
357 ; BDW-NEXT: vmulps %ymm1, %ymm0, %ymm2
358 ; BDW-NEXT: vbroadcastss {{.*#+}} ymm3 = [-3.0E+0,-3.0E+0,-3.0E+0,-3.0E+0,-3.0E+0,-3.0E+0,-3.0E+0,-3.0E+0]
359 ; BDW-NEXT: vfmadd231ps {{.*#+}} ymm3 = (ymm2 * ymm1) + ymm3
360 ; BDW-NEXT: vbroadcastss {{.*#+}} ymm1 = [-5.0E-1,-5.0E-1,-5.0E-1,-5.0E-1,-5.0E-1,-5.0E-1,-5.0E-1,-5.0E-1]
361 ; BDW-NEXT: vmulps %ymm1, %ymm2, %ymm1
362 ; BDW-NEXT: vmulps %ymm3, %ymm1, %ymm1
363 ; BDW-NEXT: vxorps %xmm2, %xmm2, %xmm2
364 ; BDW-NEXT: vcmpneqps %ymm2, %ymm0, %ymm0
365 ; BDW-NEXT: vandps %ymm1, %ymm0, %ymm0
368 ; FAST-VECTOR-LABEL: v8f32_daz:
369 ; FAST-VECTOR: # %bb.0:
370 ; FAST-VECTOR-NEXT: vsqrtps %ymm0, %ymm0
371 ; FAST-VECTOR-NEXT: retq
373 ; X86-64-LABEL: v8f32_daz:
375 ; X86-64-NEXT: rsqrtps %xmm0, %xmm2
376 ; X86-64-NEXT: movaps %xmm0, %xmm3
377 ; X86-64-NEXT: mulps %xmm2, %xmm3
378 ; X86-64-NEXT: movaps {{.*#+}} xmm4 = [-5.0E-1,-5.0E-1,-5.0E-1,-5.0E-1]
379 ; X86-64-NEXT: movaps %xmm3, %xmm5
380 ; X86-64-NEXT: mulps %xmm4, %xmm5
381 ; X86-64-NEXT: mulps %xmm2, %xmm3
382 ; X86-64-NEXT: movaps {{.*#+}} xmm2 = [-3.0E+0,-3.0E+0,-3.0E+0,-3.0E+0]
383 ; X86-64-NEXT: addps %xmm2, %xmm3
384 ; X86-64-NEXT: mulps %xmm5, %xmm3
385 ; X86-64-NEXT: xorps %xmm5, %xmm5
386 ; X86-64-NEXT: cmpneqps %xmm5, %xmm0
387 ; X86-64-NEXT: andps %xmm3, %xmm0
388 ; X86-64-NEXT: rsqrtps %xmm1, %xmm3
389 ; X86-64-NEXT: movaps %xmm1, %xmm6
390 ; X86-64-NEXT: mulps %xmm3, %xmm6
391 ; X86-64-NEXT: mulps %xmm6, %xmm4
392 ; X86-64-NEXT: mulps %xmm3, %xmm6
393 ; X86-64-NEXT: addps %xmm2, %xmm6
394 ; X86-64-NEXT: mulps %xmm4, %xmm6
395 ; X86-64-NEXT: cmpneqps %xmm5, %xmm1
396 ; X86-64-NEXT: andps %xmm6, %xmm1
398 %call = tail call fast <8 x float> @llvm.sqrt.v8f32(<8 x float> %f) #2
399 ret <8 x float> %call
402 declare float @llvm.sqrt.f32(float) #2
403 declare <4 x float> @llvm.sqrt.v4f32(<4 x float>) #2
404 declare <8 x float> @llvm.sqrt.v8f32(<8 x float>) #2
406 attributes #0 = { "denormal-fp-math"="ieee,ieee" }
407 attributes #1 = { "denormal-fp-math"="ieee,preserve-sign" }
408 attributes #2 = { nounwind readnone }