1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -instcombine -S | FileCheck %s
4 define float @fadd_fpext_op0(float %x, double %y) {
5 ; CHECK-LABEL: @fadd_fpext_op0(
6 ; CHECK-NEXT: [[EXT:%.*]] = fpext float [[X:%.*]] to double
7 ; CHECK-NEXT: [[BO:%.*]] = fadd reassoc double [[EXT]], [[Y:%.*]]
8 ; CHECK-NEXT: [[R:%.*]] = fptrunc double [[BO]] to float
9 ; CHECK-NEXT: ret float [[R]]
11 %ext = fpext float %x to double
12 %bo = fadd reassoc double %ext, %y
13 %r = fptrunc double %bo to float
17 define half @fsub_fpext_op1(half %x, double %y) {
18 ; CHECK-LABEL: @fsub_fpext_op1(
19 ; CHECK-NEXT: [[EXT:%.*]] = fpext half [[X:%.*]] to double
20 ; CHECK-NEXT: [[BO:%.*]] = fsub reassoc double [[Y:%.*]], [[EXT]]
21 ; CHECK-NEXT: [[R:%.*]] = fptrunc double [[BO]] to half
22 ; CHECK-NEXT: ret half [[R]]
24 %ext = fpext half %x to double
25 %bo = fsub reassoc double %y, %ext
26 %r = fptrunc double %bo to half
30 define <2 x float> @fdiv_constant_op0(<2 x double> %x) {
31 ; CHECK-LABEL: @fdiv_constant_op0(
32 ; CHECK-NEXT: [[BO:%.*]] = fdiv reassoc <2 x double> <double 4.210000e+01, double -1.000000e-01>, [[X:%.*]]
33 ; CHECK-NEXT: [[R:%.*]] = fptrunc <2 x double> [[BO]] to <2 x float>
34 ; CHECK-NEXT: ret <2 x float> [[R]]
36 %bo = fdiv reassoc <2 x double> <double 42.1, double -0.1>, %x
37 %r = fptrunc <2 x double> %bo to <2 x float>
41 define <2 x half> @fmul_constant_op1(<2 x float> %x) {
42 ; CHECK-LABEL: @fmul_constant_op1(
43 ; CHECK-NEXT: [[BO:%.*]] = fmul reassoc <2 x float> [[X:%.*]], <float 0x47EFFFFFE0000000, float 5.000000e-01>
44 ; CHECK-NEXT: [[R:%.*]] = fptrunc <2 x float> [[BO]] to <2 x half>
45 ; CHECK-NEXT: ret <2 x half> [[R]]
47 %bo = fmul reassoc <2 x float> %x, <float 0x47efffffe0000000, float 0.5>
48 %r = fptrunc <2 x float> %bo to <2 x half>