ret <2 x i1> %r
}
+define i1 @UIToFP_is_positive_or_zero(i32 %x) {
+; CHECK-LABEL: @UIToFP_is_positive_or_zero(
+; CHECK-NEXT: [[A:%.*]] = uitofp i32 [[X:%.*]] to float
+; CHECK-NEXT: [[R:%.*]] = fcmp oge float [[A]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[R]]
+;
+ %a = uitofp i32 %x to float
+ %r = fcmp oge float %a, 0.000000e+00
+ ret i1 %r
+}
+
+define <2 x i1> @UIToFP_is_positive_or_zero_vec(<2 x i32> %x) {
+; CHECK-LABEL: @UIToFP_is_positive_or_zero_vec(
+; CHECK-NEXT: [[A:%.*]] = uitofp <2 x i32> [[X:%.*]] to <2 x float>
+; CHECK-NEXT: [[R:%.*]] = fcmp oge <2 x float> [[A]], zeroinitializer
+; CHECK-NEXT: ret <2 x i1> [[R]]
+;
+ %a = uitofp <2 x i32> %x to <2 x float>
+ %r = fcmp oge <2 x float> %a, zeroinitializer
+ ret <2 x i1> %r
+}
+
define i1 @UIToFP_nnan_is_positive_or_zero(i32 %x) {
; CHECK-LABEL: @UIToFP_nnan_is_positive_or_zero(
; CHECK-NEXT: ret i1 true
define i1 @fabs_nnan_is_positive_or_zero(double %x) {
; CHECK-LABEL: @fabs_nnan_is_positive_or_zero(
+; CHECK-NEXT: [[FABS:%.*]] = tail call nnan double @llvm.fabs.f64(double [[X:%.*]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oge double [[FABS]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %fabs = tail call nnan double @llvm.fabs.f64(double %x)
+ %cmp = fcmp oge double %fabs, 0.0
+ ret i1 %cmp
+}
+
+define <2 x i1> @fabs_nnan_is_positive_or_zero_vec(<2 x double> %x) {
+; CHECK-LABEL: @fabs_nnan_is_positive_or_zero_vec(
+; CHECK-NEXT: [[FABS:%.*]] = tail call nnan <2 x double> @llvm.fabs.v2f64(<2 x double> [[X:%.*]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oge <2 x double> [[FABS]], zeroinitializer
+; CHECK-NEXT: ret <2 x i1> [[CMP]]
+;
+ %fabs = tail call nnan <2 x double> @llvm.fabs.v2f64(<2 x double> %x)
+ %cmp = fcmp oge <2 x double> %fabs, zeroinitializer
+ ret <2 x i1> %cmp
+}
+
+define i1 @fabs_fcmp-nnan_is_positive_or_zero(double %x) {
+; CHECK-LABEL: @fabs_fcmp-nnan_is_positive_or_zero(
; CHECK-NEXT: ret i1 true
;
%fabs = tail call double @llvm.fabs.f64(double %x)
ret i1 %cmp
}
-define <2 x i1> @fabs_nnan_is_positive_or_zero_vec(<2 x double> %x) {
-; CHECK-LABEL: @fabs_nnan_is_positive_or_zero_vec(
+define <2 x i1> @fabs_fcmp-nnan_is_positive_or_zero_vec(<2 x double> %x) {
+; CHECK-LABEL: @fabs_fcmp-nnan_is_positive_or_zero_vec(
; CHECK-NEXT: ret <2 x i1> <i1 true, i1 true>
;
%fabs = tail call <2 x double> @llvm.fabs.v2f64(<2 x double> %x)