ret half %c
}
+; FIXME: This combine isn't working.
+define half @unary_fneg_fptrunc(float %a) {
+; CHECK-LABEL: @unary_fneg_fptrunc(
+; CHECK-NEXT: [[B:%.*]] = fneg float [[A:%.*]]
+; CHECK-NEXT: [[C:%.*]] = fptrunc float [[B]] to half
+; CHECK-NEXT: ret half [[C]]
+;
+ %b = fneg float %a
+ %c = fptrunc float %b to half
+ ret half %c
+}
+
define <2 x half> @fneg_fptrunc_vec_undef(<2 x float> %a) {
; CHECK-LABEL: @fneg_fptrunc_vec_undef(
; CHECK-NEXT: [[TMP1:%.*]] = fptrunc <2 x float> [[A:%.*]] to <2 x half>
ret <2 x half> %c
}
+; FIXME: This combine isn't working.
+define <2 x half> @unary_fneg_fptrunc_vec(<2 x float> %a) {
+; CHECK-LABEL: @unary_fneg_fptrunc_vec(
+; CHECK-NEXT: [[B:%.*]] = fneg <2 x float> [[A:%.*]]
+; CHECK-NEXT: [[C:%.*]] = fptrunc <2 x float> [[B]] to <2 x half>
+; CHECK-NEXT: ret <2 x half> [[C]]
+;
+ %b = fneg <2 x float> %a
+ %c = fptrunc <2 x float> %b to <2 x half>
+ ret <2 x half> %c
+}
+
define half @test4-fast(float %a) {
; CHECK-LABEL: @test4-fast(
; CHECK-NEXT: [[TMP1:%.*]] = fptrunc float [[A:%.*]] to half
ret half %c
}
+; FIXME: This combine isn't working.
+define half @test4_unary_fneg-fast(float %a) {
+; CHECK-LABEL: @test4_unary_fneg-fast(
+; CHECK-NEXT: [[B:%.*]] = fneg fast float [[A:%.*]]
+; CHECK-NEXT: [[C:%.*]] = fptrunc float [[B]] to half
+; CHECK-NEXT: ret half [[C]]
+;
+ %b = fneg fast float %a
+ %c = fptrunc float %b to half
+ ret half %c
+}
+
define half @test5(float %a, float %b, float %c) {
; CHECK-LABEL: @test5(
; CHECK-NEXT: [[D:%.*]] = fcmp ogt float [[A:%.*]], [[B:%.*]]
ret float %tmp34
}
+; FIXME: This combine isn't working.
+define float @test4_unary_fneg(float %x) nounwind {
+; CHECK-LABEL: @test4_unary_fneg(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[TMP1:%.*]] = fpext float [[X:%.*]] to double
+; CHECK-NEXT: [[TMP2:%.*]] = fneg double [[TMP1]]
+; CHECK-NEXT: [[TMP34:%.*]] = fptrunc double [[TMP2]] to float
+; CHECK-NEXT: ret float [[TMP34]]
+;
+entry:
+ %tmp1 = fpext float %x to double
+ %tmp2 = fneg double %tmp1
+ %tmp34 = fptrunc double %tmp2 to float
+ ret float %tmp34
+}
+
; Test with vector splat constant
define <2 x float> @test5(<2 x float> %x) nounwind {
; CHECK-LABEL: @test5(