@@ -56,26 +56,44 @@ define float @no_mul_zero_3(float %a) {
56
56
57
57
; -X + X --> 0.0 (with nnan on the fadd)
58
58
59
- define float @fadd_fnegx (float %x ) {
60
- ; CHECK-LABEL: @fadd_fnegx (
59
+ define float @fadd_binary_fnegx (float %x ) {
60
+ ; CHECK-LABEL: @fadd_binary_fnegx (
61
61
; CHECK-NEXT: ret float 0.000000e+00
62
62
;
63
63
%negx = fsub float -0 .0 , %x
64
64
%r = fadd nnan float %negx , %x
65
65
ret float %r
66
66
}
67
67
68
+ define float @fadd_unary_fnegx (float %x ) {
69
+ ; CHECK-LABEL: @fadd_unary_fnegx(
70
+ ; CHECK-NEXT: ret float 0.000000e+00
71
+ ;
72
+ %negx = fneg float %x
73
+ %r = fadd nnan float %negx , %x
74
+ ret float %r
75
+ }
76
+
68
77
; X + -X --> 0.0 (with nnan on the fadd)
69
78
70
- define <2 x float > @fadd_fnegx_commute_vec (<2 x float > %x ) {
71
- ; CHECK-LABEL: @fadd_fnegx_commute_vec (
79
+ define <2 x float > @fadd_binary_fnegx_commute_vec (<2 x float > %x ) {
80
+ ; CHECK-LABEL: @fadd_binary_fnegx_commute_vec (
72
81
; CHECK-NEXT: ret <2 x float> zeroinitializer
73
82
;
74
83
%negx = fsub <2 x float > <float -0 .0 , float -0 .0 >, %x
75
84
%r = fadd nnan <2 x float > %x , %negx
76
85
ret <2 x float > %r
77
86
}
78
87
88
+ define <2 x float > @fadd_unary_fnegx_commute_vec (<2 x float > %x ) {
89
+ ; CHECK-LABEL: @fadd_unary_fnegx_commute_vec(
90
+ ; CHECK-NEXT: ret <2 x float> zeroinitializer
91
+ ;
92
+ %negx = fneg <2 x float > %x
93
+ %r = fadd nnan <2 x float > %x , %negx
94
+ ret <2 x float > %r
95
+ }
96
+
79
97
define <2 x float > @fadd_fnegx_commute_vec_undef (<2 x float > %x ) {
80
98
; CHECK-LABEL: @fadd_fnegx_commute_vec_undef(
81
99
; CHECK-NEXT: ret <2 x float> zeroinitializer
0 commit comments