59
59
define <2 x float > @test5 (<2 x float > %x ) nounwind {
60
60
; CHECK-LABEL: @test5(
61
61
; CHECK-NEXT: entry:
62
- ; CHECK-NEXT: [[TMP1:%.*]] = fpext <2 x float> [[X:%.*]] to <2 x double>
63
- ; CHECK-NEXT: [[TMP3:%.*]] = fadd <2 x double> [[TMP1]], zeroinitializer
64
- ; CHECK-NEXT: [[TMP34:%.*]] = fptrunc <2 x double> [[TMP3]] to <2 x float>
62
+ ; CHECK-NEXT: [[TMP34:%.*]] = fadd <2 x float> [[X:%.*]], zeroinitializer
65
63
; CHECK-NEXT: ret <2 x float> [[TMP34]]
66
64
;
67
65
entry:
@@ -75,23 +73,36 @@ entry:
75
73
define <2 x float > @test6 (<2 x float > %x ) nounwind {
76
74
; CHECK-LABEL: @test6(
77
75
; CHECK-NEXT: entry:
76
+ ; CHECK-NEXT: [[TMP34:%.*]] = fadd <2 x float> [[X:%.*]], <float 0.000000e+00, float -0.000000e+00>
77
+ ; CHECK-NEXT: ret <2 x float> [[TMP34]]
78
+ ;
79
+ entry:
80
+ %tmp1 = fpext <2 x float > %x to <2 x double >
81
+ %tmp3 = fadd <2 x double > %tmp1 , <double 0 .000000e+00 , double -0 .000000e+00 >
82
+ %tmp34 = fptrunc <2 x double > %tmp3 to <2 x float >
83
+ ret <2 x float > %tmp34
84
+ }
85
+
86
+ ; Test with an undef element
87
+ ; TODO: Support undef elements.
88
+ define <2 x float > @test6_undef (<2 x float > %x ) nounwind {
89
+ ; CHECK-LABEL: @test6_undef(
90
+ ; CHECK-NEXT: entry:
78
91
; CHECK-NEXT: [[TMP1:%.*]] = fpext <2 x float> [[X:%.*]] to <2 x double>
79
- ; CHECK-NEXT: [[TMP3:%.*]] = fadd <2 x double> [[TMP1]], <double 0.000000e+00, double -0.000000e+00 >
92
+ ; CHECK-NEXT: [[TMP3:%.*]] = fadd <2 x double> [[TMP1]], <double 0.000000e+00, double undef >
80
93
; CHECK-NEXT: [[TMP34:%.*]] = fptrunc <2 x double> [[TMP3]] to <2 x float>
81
94
; CHECK-NEXT: ret <2 x float> [[TMP34]]
82
95
;
83
96
entry:
84
97
%tmp1 = fpext <2 x float > %x to <2 x double >
85
- %tmp3 = fadd <2 x double > %tmp1 , <double 0 .000000e+00 , double - 0 .000000e+ 00 >
98
+ %tmp3 = fadd <2 x double > %tmp1 , <double 0 .000000e+00 , double undef >
86
99
%tmp34 = fptrunc <2 x double > %tmp3 to <2 x float >
87
100
ret <2 x float > %tmp34
88
101
}
89
102
90
103
define <2 x float > @not_half_shrinkable (<2 x float > %x ) {
91
104
; CHECK-LABEL: @not_half_shrinkable(
92
- ; CHECK-NEXT: [[EXT:%.*]] = fpext <2 x float> [[X:%.*]] to <2 x double>
93
- ; CHECK-NEXT: [[ADD:%.*]] = fadd <2 x double> [[EXT]], <double 0.000000e+00, double 2.049000e+03>
94
- ; CHECK-NEXT: [[R:%.*]] = fptrunc <2 x double> [[ADD]] to <2 x float>
105
+ ; CHECK-NEXT: [[R:%.*]] = fadd <2 x float> [[X:%.*]], <float 0.000000e+00, float 2.049000e+03>
95
106
; CHECK-NEXT: ret <2 x float> [[R]]
96
107
;
97
108
%ext = fpext <2 x float > %x to <2 x double >
0 commit comments