Lines Matching full:float

4 declare float @llvm.maximum.f32(float, float)
5 declare <2 x float> @llvm.maximum.v2f32(<2 x float>, <2 x float>)
6 declare <4 x float> @llvm.maximum.v4f32(<4 x float>, <4 x float>)
11 define float @constant_fold_maximum_f32() {
13 ; CHECK-NEXT: ret float 2.000000e+00
15 %x = call float @llvm.maximum.f32(float 1.0, float 2.0)
16 ret float %x
19 define float @constant_fold_maximum_f32_inv() {
21 ; CHECK-NEXT: ret float 2.000000e+00
23 %x = call float @llvm.maximum.f32(float 2.0, float 1.0)
24 ret float %x
27 define float @constant_fold_maximum_f32_nan0() {
29 ; CHECK-NEXT: ret float 0x7FF8000000000000
31 %x = call float @llvm.maximum.f32(float 0x7FF8000000000000, float 2.0)
32 ret float %x
35 define float @constant_fold_maximum_f32_nan1() {
37 ; CHECK-NEXT: ret float 0x7FF8000000000000
39 %x = call float @llvm.maximum.f32(float 2.0, float 0x7FF8000000000000)
40 ret float %x
43 define float @constant_fold_maximum_f32_nan_nan() {
45 ; CHECK-NEXT: ret float 0x7FF8000000000000
47 %x = call float @llvm.maximum.f32(float 0x7FF8000000000000, float 0x7FF8000000000000)
48 ret float %x
51 define float @constant_fold_maximum_f32_p0_p0() {
53 ; CHECK-NEXT: ret float 0.000000e+00
55 %x = call float @llvm.maximum.f32(float 0.0, float 0.0)
56 ret float %x
59 define float @constant_fold_maximum_f32_p0_n0() {
61 ; CHECK-NEXT: ret float 0.000000e+00
63 %x = call float @llvm.maximum.f32(float 0.0, float -0.0)
64 ret float %x
67 define float @constant_fold_maximum_f32_n0_p0() {
69 ; CHECK-NEXT: ret float 0.000000e+00
71 %x = call float @llvm.maximum.f32(float -0.0, float 0.0)
72 ret float %x
75 define float @constant_fold_maximum_f32_n0_n0() {
77 ; CHECK-NEXT: ret float -0.000000e+00
79 %x = call float @llvm.maximum.f32(float -0.0, float -0.0)
80 ret float %x
83 define <4 x float> @constant_fold_maximum_v4f32() {
85 ; CHECK-NEXT: ret <4 x float> <float 2.000000e+00, float 8.000000e+00, float 1.000000e+01, float
87 …ll <4 x float> @llvm.maximum.v4f32(<4 x float> <float 1.0, float 8.0, float 3.0, float 9.0>, <4 x
88 ret <4 x float> %x
123 define float @canonicalize_constant_maximum_f32(float %x) {
125 ; CHECK-NEXT: [[Y:%.*]] = call float @llvm.maximum.f32(float [[X:%.*]], float 1.000000e+00)
126 ; CHECK-NEXT: ret float [[Y]]
128 %y = call float @llvm.maximum.f32(float 1.0, float %x)
129 ret float %y
132 define float @maximum_f32_nan_val(float %x) {
134 ; CHECK-NEXT: ret float 0x7FF8000000000000
136 %y = call float @llvm.maximum.f32(float 0x7FF8000000000000, float %x)
137 ret float %y
140 define float @maximum_f32_val_nan(float %x) {
142 ; CHECK-NEXT: ret float 0x7FF8000000000000
144 %y = call float @llvm.maximum.f32(float %x, float 0x7FF8000000000000)
145 ret float %y
148 define float @maximum_f32_1_maximum_val_p0(float %x) {
150 ; CHECK-NEXT: [[TMP1:%.*]] = call float @llvm.maximum.f32(float [[X:%.*]], float 1.000000e+00)
151 ; CHECK-NEXT: ret float [[TMP1]]
153 %y = call float @llvm.maximum.f32(float %x, float 0.0)
154 %z = call float @llvm.maximum.f32(float %y, float 1.0)
155 ret float %z
158 define float @maximum_f32_1_maximum_p0_val_fast(float %x) {
160 ; CHECK-NEXT: [[TMP1:%.*]] = call float @llvm.maximum.f32(float [[X:%.*]], float 1.000000e+00)
161 ; CHECK-NEXT: ret float [[TMP1]]
163 %y = call float @llvm.maximum.f32(float 0.0, float %x)
164 %z = call fast float @llvm.maximum.f32(float %y, float 1.0)
165 ret float %z
168 define float @maximum_f32_1_maximum_p0_val_fmf1(float %x) {
170 ; CHECK-NEXT: [[TMP1:%.*]] = call nnan arcp float @llvm.maximum.f32(float [[X:%.*]], float 1.000…
171 ; CHECK-NEXT: ret float [[TMP1]]
173 %y = call arcp nnan float @llvm.maximum.f32(float 0.0, float %x)
174 %z = call arcp nnan ninf float @llvm.maximum.f32(float %y, float 1.0)
175 ret float %z
178 define float @maximum_f32_1_maximum_p0_val_fmf2(float %x) {
180 ; CHECK-NEXT: [[TMP1:%.*]] = call nnan float @llvm.maximum.f32(float [[X:%.*]], float 1.000000e+…
181 ; CHECK-NEXT: ret float [[TMP1]]
183 %y = call arcp nnan ninf float @llvm.maximum.f32(float 0.0, float %x)
184 %z = call nnan float @llvm.maximum.f32(float %y, float 1.0)
185 ret float %z
188 define float @maximum_f32_1_maximum_p0_val_fmf3(float %x) {
190 ; CHECK-NEXT: [[TMP1:%.*]] = call nnan ninf float @llvm.maximum.f32(float [[X:%.*]], float 1.000…
191 ; CHECK-NEXT: ret float [[TMP1]]
193 %y = call nnan ninf float @llvm.maximum.f32(float 0.0, float %x)
194 %z = call arcp nnan ninf float @llvm.maximum.f32(float %y, float 1.0)
195 ret float %z
198 define float @maximum_f32_p0_maximum_val_n0(float %x) {
200 ; CHECK-NEXT: [[TMP1:%.*]] = call float @llvm.maximum.f32(float [[X:%.*]], float 0.000000e+00)
201 ; CHECK-NEXT: ret float [[TMP1]]
203 %y = call float @llvm.maximum.f32(float %x, float -0.0)
204 %z = call float @llvm.maximum.f32(float %y, float 0.0)
205 ret float %z
208 define float @maximum_f32_1_maximum_p0_val(float %x) {
210 ; CHECK-NEXT: [[TMP1:%.*]] = call float @llvm.maximum.f32(float [[X:%.*]], float 1.000000e+00)
211 ; CHECK-NEXT: ret float [[TMP1]]
213 %y = call float @llvm.maximum.f32(float 0.0, float %x)
214 %z = call float @llvm.maximum.f32(float %y, float 1.0)
215 ret float %z
218 define <2 x float> @maximum_f32_1_maximum_val_p0_val_v2f32(<2 x float> %x) {
220 …XT: [[TMP1:%.*]] = call <2 x float> @llvm.maximum.v2f32(<2 x float> [[X:%.*]], <2 x float> <flo…
221 ; CHECK-NEXT: ret <2 x float> [[TMP1]]
223 %y = call <2 x float> @llvm.maximum.v2f32(<2 x float> %x, <2 x float> zeroinitializer)
224 %z = call <2 x float> @llvm.maximum.v2f32(<2 x float> %y, <2 x float><float 1.0, float 1.0>)
225 ret <2 x float> %z
228 define float @maximum4(float %x, float %y, float %z, float %w) {
230 ; CHECK-NEXT: [[A:%.*]] = call float @llvm.maximum.f32(float [[X:%.*]], float [[Y:%.*]])
231 ; CHECK-NEXT: [[B:%.*]] = call float @llvm.maximum.f32(float [[Z:%.*]], float [[W:%.*]])
232 ; CHECK-NEXT: [[C:%.*]] = call float @llvm.maximum.f32(float [[A]], float [[B]])
233 ; CHECK-NEXT: ret float [[C]]
235 %a = call float @llvm.maximum.f32(float %x, float %y)
236 %b = call float @llvm.maximum.f32(float %z, float %w)
237 %c = call float @llvm.maximum.f32(float %a, float %b)
238 ret float %c
243 define <2 x float> @neg_neg(<2 x float> %x, <2 x float> %y) {
245 ; CHECK-NEXT: [[TMP1:%.*]] = call <2 x float> @llvm.minimum.v2f32(<2 x float> [[X:%.*]], <2 x fl…
246 ; CHECK-NEXT: [[R:%.*]] = fneg <2 x float> [[TMP1]]
247 ; CHECK-NEXT: ret <2 x float> [[R]]
249 %negx = fsub <2 x float> <float -0.0, float -0.0>, %x
250 %negy = fsub <2 x float> <float -0.0, float -0.0>, %y
251 %r = call <2 x float> @llvm.maximum.v2f32(<2 x float> %negx, <2 x float> %negy)
252 ret <2 x float> %r
255 define <2 x float> @unary_neg_neg(<2 x float> %x, <2 x float> %y) {
257 ; CHECK-NEXT: [[TMP1:%.*]] = call <2 x float> @llvm.minimum.v2f32(<2 x float> [[X:%.*]], <2 x fl…
258 ; CHECK-NEXT: [[R:%.*]] = fneg <2 x float> [[TMP1]]
259 ; CHECK-NEXT: ret <2 x float> [[R]]
261 %negx = fneg <2 x float> %x
262 %negy = fneg <2 x float> %y
263 %r = call <2 x float> @llvm.maximum.v2f32(<2 x float> %negx, <2 x float> %negy)
264 ret <2 x float> %r
269 define float @neg_neg_vec_fmf(float %x, float %y) {
271 ; CHECK-NEXT: [[TMP1:%.*]] = call fast float @llvm.minimum.f32(float [[X:%.*]], float [[Y:%.*]])
272 ; CHECK-NEXT: [[R:%.*]] = fneg fast float [[TMP1]]
273 ; CHECK-NEXT: ret float [[R]]
275 %negx = fsub arcp float -0.0, %x
276 %negy = fsub afn float -0.0, %y
277 %r = call fast float @llvm.maximum.f32(float %negx, float %negy)
278 ret float %r
281 define float @unary_neg_neg_vec_fmf(float %x, float %y) {
283 ; CHECK-NEXT: [[TMP1:%.*]] = call fast float @llvm.minimum.f32(float [[X:%.*]], float [[Y:%.*]])
284 ; CHECK-NEXT: [[R:%.*]] = fneg fast float [[TMP1]]
285 ; CHECK-NEXT: ret float [[R]]
287 %negx = fneg arcp float %x
288 %negy = fneg afn float %y
289 %r = call fast float @llvm.maximum.f32(float %negx, float %negy)
290 ret float %r
296 declare void @use(float)
297 define float @neg_neg_extra_use_x(float %x, float %y) {
299 ; CHECK-NEXT: [[NEGX:%.*]] = fneg float [[X:%.*]]
300 ; CHECK-NEXT: [[TMP1:%.*]] = call float @llvm.minimum.f32(float [[X]], float [[Y:%.*]])
301 ; CHECK-NEXT: [[R:%.*]] = fneg float [[TMP1]]
302 ; CHECK-NEXT: call void @use(float [[NEGX]])
303 ; CHECK-NEXT: ret float [[R]]
305 %negx = fsub float -0.0, %x
306 %negy = fsub float -0.0, %y
307 %r = call float @llvm.maximum.f32(float %negx, float %negy)
308 call void @use(float %negx)
309 ret float %r
312 define float @unary_neg_neg_extra_use_x(float %x, float %y) {
314 ; CHECK-NEXT: [[NEGX:%.*]] = fneg float [[X:%.*]]
315 ; CHECK-NEXT: [[TMP1:%.*]] = call float @llvm.minimum.f32(float [[X]], float [[Y:%.*]])
316 ; CHECK-NEXT: [[R:%.*]] = fneg float [[TMP1]]
317 ; CHECK-NEXT: call void @use(float [[NEGX]])
318 ; CHECK-NEXT: ret float [[R]]
320 %negx = fneg float %x
321 %negy = fneg float %y
322 %r = call float @llvm.maximum.f32(float %negx, float %negy)
323 call void @use(float %negx)
324 ret float %r
327 define float @neg_neg_extra_use_y(float %x, float %y) {
329 ; CHECK-NEXT: [[NEGY:%.*]] = fneg float [[Y:%.*]]
330 ; CHECK-NEXT: [[TMP1:%.*]] = call float @llvm.minimum.f32(float [[X:%.*]], float [[Y]])
331 ; CHECK-NEXT: [[R:%.*]] = fneg float [[TMP1]]
332 ; CHECK-NEXT: call void @use(float [[NEGY]])
333 ; CHECK-NEXT: ret float [[R]]
335 %negx = fsub float -0.0, %x
336 %negy = fsub float -0.0, %y
337 %r = call float @llvm.maximum.f32(float %negx, float %negy)
338 call void @use(float %negy)
339 ret float %r
342 define float @unary_neg_neg_extra_use_y(float %x, float %y) {
344 ; CHECK-NEXT: [[NEGY:%.*]] = fneg float [[Y:%.*]]
345 ; CHECK-NEXT: [[TMP1:%.*]] = call float @llvm.minimum.f32(float [[X:%.*]], float [[Y]])
346 ; CHECK-NEXT: [[R:%.*]] = fneg float [[TMP1]]
347 ; CHECK-NEXT: call void @use(float [[NEGY]])
348 ; CHECK-NEXT: ret float [[R]]
350 %negx = fneg float %x
351 %negy = fneg float %y
352 %r = call float @llvm.maximum.f32(float %negx, float %negy)
353 call void @use(float %negy)
354 ret float %r
357 define float @neg_neg_extra_use_x_and_y(float %x, float %y) {
359 ; CHECK-NEXT: [[NEGX:%.*]] = fneg float [[X:%.*]]
360 ; CHECK-NEXT: [[NEGY:%.*]] = fneg float [[Y:%.*]]
361 ; CHECK-NEXT: [[R:%.*]] = call float @llvm.maximum.f32(float [[NEGX]], float [[NEGY]])
362 ; CHECK-NEXT: call void @use(float [[NEGX]])
363 ; CHECK-NEXT: call void @use(float [[NEGY]])
364 ; CHECK-NEXT: ret float [[R]]
366 %negx = fsub float -0.0, %x
367 %negy = fsub float -0.0, %y
368 %r = call float @llvm.maximum.f32(float %negx, float %negy)
369 call void @use(float %negx)
370 call void @use(float %negy)
371 ret float %r
374 define float @unary_neg_neg_extra_use_x_and_y(float %x, float %y) {
376 ; CHECK-NEXT: [[NEGX:%.*]] = fneg float [[X:%.*]]
377 ; CHECK-NEXT: [[NEGY:%.*]] = fneg float [[Y:%.*]]
378 ; CHECK-NEXT: [[R:%.*]] = call float @llvm.maximum.f32(float [[NEGX]], float [[NEGY]])
379 ; CHECK-NEXT: call void @use(float [[NEGX]])
380 ; CHECK-NEXT: call void @use(float [[NEGY]])
381 ; CHECK-NEXT: ret float [[R]]
383 %negx = fneg float %x
384 %negy = fneg float %y
385 %r = call float @llvm.maximum.f32(float %negx, float %negy)
386 call void @use(float %negx)
387 call void @use(float %negy)
388 ret float %r
391 define float @reduce_precision(float %x, float %y) {
393 ; CHECK-NEXT: [[MAXIMUM:%.*]] = call float @llvm.maximum.f32(float [[X:%.*]], float [[Y:%.*]])
394 ; CHECK-NEXT: ret float [[MAXIMUM]]
396 %x.ext = fpext float %x to double
397 %y.ext = fpext float %y to double
399 %trunc = fptrunc double %maximum to float
400 ret float %trunc
403 define float @reduce_precision_fmf(float %x, float %y) {
405 ; CHECK-NEXT: [[MAXIMUM:%.*]] = call nnan float @llvm.maximum.f32(float [[X:%.*]], float [[Y:%.*…
406 ; CHECK-NEXT: ret float [[MAXIMUM]]
408 %x.ext = fpext float %x to double
409 %y.ext = fpext float %y to double
411 %trunc = fptrunc double %maximum to float
412 ret float %trunc