%r = frem fast float %x, undef
ret float %r
}
+
+define double @fdiv_ninf_nan_op0(double %x) {
+; CHECK-LABEL: @fdiv_ninf_nan_op0(
+; CHECK-NEXT: ret double 0xFFF8000000000000
+;
+ %r = fdiv ninf double 0xfff8000000000000, %x
+ ret double %r
+}
+
+define double @fadd_ninf_nan_op1(double %x) {
+; CHECK-LABEL: @fadd_ninf_nan_op1(
+; CHECK-NEXT: ret double 0x7FF8000000000000
+;
+ %r = fadd ninf double %x, 0x7ff8000000000000
+ ret double %r
+}
+
+; TODO: Should simplify to undef.
+
+define double @fdiv_ninf_inf_op0(double %x) {
+; CHECK-LABEL: @fdiv_ninf_inf_op0(
+; CHECK-NEXT: [[R:%.*]] = fdiv ninf double 0x7FF0000000000000, [[X:%.*]]
+; CHECK-NEXT: ret double [[R]]
+;
+ %r = fdiv ninf double 0x7ff0000000000000, %x
+ ret double %r
+}
+
+; TODO: Should simplify to undef.
+
+define double @fadd_ninf_inf_op1(double %x) {
+; CHECK-LABEL: @fadd_ninf_inf_op1(
+; CHECK-NEXT: [[R:%.*]] = fadd ninf double [[X:%.*]], 0xFFF0000000000000
+; CHECK-NEXT: ret double [[R]]
+;
+ %r = fadd ninf double %x, 0xfff0000000000000
+ ret double %r
+}
+
+; TODO: Should simplify to inf.
+
+define double @fsub_nnan_inf_op0(double %x) {
+; CHECK-LABEL: @fsub_nnan_inf_op0(
+; CHECK-NEXT: [[R:%.*]] = fsub nnan double 0x7FF0000000000000, [[X:%.*]]
+; CHECK-NEXT: ret double [[R]]
+;
+ %r = fsub nnan double 0x7ff0000000000000, %x
+ ret double %r
+}
+
+; TODO: Should simplify to -inf.
+
+define double @fmul_nnan_inf_op1(double %x) {
+; CHECK-LABEL: @fmul_nnan_inf_op1(
+; CHECK-NEXT: [[R:%.*]] = fmul nnan double [[X:%.*]], 0xFFF0000000000000
+; CHECK-NEXT: ret double [[R]]
+;
+ %r = fmul nnan double %x, 0xfff0000000000000
+ ret double %r
+}