diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp --- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp @@ -7992,6 +7992,7 @@ SDValue LHS = Op.getOperand(0), RHS = Op.getOperand(1); SDValue TV = Op.getOperand(2), FV = Op.getOperand(3); SDLoc dl(Op); + SDNodeFlags Flags = Op.getNode()->getFlags(); // We have xsmaxcdp/xsmincdp which are OK to emit even in the // presence of infinities. @@ -8012,15 +8013,10 @@ // general, fsel-based lowering of select is a finite-math-only optimization. // For more information, see section F.3 of the 2.06 ISA specification. // With ISA 3.0 - if (!DAG.getTarget().Options.NoInfsFPMath || - !DAG.getTarget().Options.NoNaNsFPMath) + if ((!DAG.getTarget().Options.NoInfsFPMath && !Flags.hasNoInfs()) || + (!DAG.getTarget().Options.NoNaNsFPMath && !Flags.hasNoNaNs())) return Op; - // TODO: Propagate flags from the select rather than global settings. - SDNodeFlags Flags; - Flags.setNoInfs(true); - Flags.setNoNaNs(true); - // If the RHS of the comparison is a 0.0, we don't need to do the // subtraction at all. SDValue Sel1; diff --git a/llvm/test/CodeGen/PowerPC/scalar-equal.ll b/llvm/test/CodeGen/PowerPC/scalar-equal.ll --- a/llvm/test/CodeGen/PowerPC/scalar-equal.ll +++ b/llvm/test/CodeGen/PowerPC/scalar-equal.ll @@ -51,6 +51,44 @@ ; NO-FAST-P8-NEXT: # %bb.1: # %entry ; NO-FAST-P8-NEXT: fmr f1, f4 ; NO-FAST-P8-NEXT: blr +entry: + %cmp = fcmp oeq double %a, %b + %cond = select i1 %cmp, double %c, double %d + ret double %cond +} + +define double @testoeq_fast(double %a, double %b, double %c, double %d) { +; FAST-P8-LABEL: testoeq_fast: +; FAST-P8: # %bb.0: # %entry +; FAST-P8-NEXT: xssubdp f0, f1, f2 +; FAST-P8-NEXT: xsnegdp f1, f0 +; FAST-P8-NEXT: fsel f0, f0, f3, f4 +; FAST-P8-NEXT: fsel f1, f1, f0, f4 +; FAST-P8-NEXT: blr +; +; FAST-P9-LABEL: testoeq_fast: +; FAST-P9: # %bb.0: # %entry +; FAST-P9-NEXT: xssubdp f0, f1, f2 +; FAST-P9-NEXT: fsel f1, f0, f3, f4 +; FAST-P9-NEXT: xsnegdp f0, f0 +; FAST-P9-NEXT: fsel f1, f0, f1, f4 +; FAST-P9-NEXT: blr +; +; NO-FAST-P9-LABEL: testoeq_fast: +; NO-FAST-P9: # %bb.0: # %entry +; NO-FAST-P9-NEXT: xssubdp f0, f1, f2 +; NO-FAST-P9-NEXT: fsel f1, f0, f3, f4 +; NO-FAST-P9-NEXT: xsnegdp f0, f0 +; NO-FAST-P9-NEXT: fsel f1, f0, f1, f4 +; NO-FAST-P9-NEXT: blr +; +; NO-FAST-P8-LABEL: testoeq_fast: +; NO-FAST-P8: # %bb.0: # %entry +; NO-FAST-P8-NEXT: xssubdp f0, f1, f2 +; NO-FAST-P8-NEXT: xsnegdp f1, f0 +; NO-FAST-P8-NEXT: fsel f0, f0, f3, f4 +; NO-FAST-P8-NEXT: fsel f1, f1, f0, f4 +; NO-FAST-P8-NEXT: blr entry: %cmp = fcmp fast oeq double %a, %b %cond = select fast i1 %cmp, double %c, double %d diff --git a/llvm/test/CodeGen/PowerPC/scalar-min-max.ll b/llvm/test/CodeGen/PowerPC/scalar-min-max.ll --- a/llvm/test/CodeGen/PowerPC/scalar-min-max.ll +++ b/llvm/test/CodeGen/PowerPC/scalar-min-max.ll @@ -122,10 +122,8 @@ ; ; NO-FAST-P8-LABEL: testfmax_fast: ; NO-FAST-P8: # %bb.0: # %entry -; NO-FAST-P8-NEXT: fcmpu cr0, f1, f2 -; NO-FAST-P8-NEXT: bgtlr cr0 -; NO-FAST-P8-NEXT: # %bb.1: # %entry -; NO-FAST-P8-NEXT: fmr f1, f2 +; NO-FAST-P8-NEXT: xssubsp f0, f2, f1 +; NO-FAST-P8-NEXT: fsel f1, f0, f2, f1 ; NO-FAST-P8-NEXT: blr entry: %cmp = fcmp fast ogt float %a, %b @@ -145,10 +143,8 @@ ; ; NO-FAST-P8-LABEL: testdmax_fast: ; NO-FAST-P8: # %bb.0: # %entry -; NO-FAST-P8-NEXT: xscmpudp cr0, f1, f2 -; NO-FAST-P8-NEXT: bgtlr cr0 -; NO-FAST-P8-NEXT: # %bb.1: # %entry -; NO-FAST-P8-NEXT: fmr f1, f2 +; NO-FAST-P8-NEXT: xssubdp f0, f2, f1 +; NO-FAST-P8-NEXT: fsel f1, f0, f2, f1 ; NO-FAST-P8-NEXT: blr entry: %cmp = fcmp fast ogt double %a, %b @@ -168,10 +164,8 @@ ; ; NO-FAST-P8-LABEL: testfmin_fast: ; NO-FAST-P8: # %bb.0: # %entry -; NO-FAST-P8-NEXT: fcmpu cr0, f1, f2 -; NO-FAST-P8-NEXT: bltlr cr0 -; NO-FAST-P8-NEXT: # %bb.1: # %entry -; NO-FAST-P8-NEXT: fmr f1, f2 +; NO-FAST-P8-NEXT: xssubsp f0, f1, f2 +; NO-FAST-P8-NEXT: fsel f1, f0, f2, f1 ; NO-FAST-P8-NEXT: blr entry: %cmp = fcmp fast olt float %a, %b @@ -191,10 +185,8 @@ ; ; NO-FAST-P8-LABEL: testdmin_fast: ; NO-FAST-P8: # %bb.0: # %entry -; NO-FAST-P8-NEXT: xscmpudp cr0, f1, f2 -; NO-FAST-P8-NEXT: bltlr cr0 -; NO-FAST-P8-NEXT: # %bb.1: # %entry -; NO-FAST-P8-NEXT: fmr f1, f2 +; NO-FAST-P8-NEXT: xssubdp f0, f1, f2 +; NO-FAST-P8-NEXT: fsel f1, f0, f2, f1 ; NO-FAST-P8-NEXT: blr entry: %cmp = fcmp fast olt double %a, %b diff --git a/llvm/test/CodeGen/PowerPC/scalar_cmp.ll b/llvm/test/CodeGen/PowerPC/scalar_cmp.ll --- a/llvm/test/CodeGen/PowerPC/scalar_cmp.ll +++ b/llvm/test/CodeGen/PowerPC/scalar_cmp.ll @@ -118,21 +118,18 @@ ; ; NO-FAST-P8-LABEL: select_fast_oeq_float: ; NO-FAST-P8: # %bb.0: # %entry -; NO-FAST-P8-NEXT: fcmpu cr0, f1, f2 -; NO-FAST-P8-NEXT: fmr f1, f3 -; NO-FAST-P8-NEXT: beqlr cr0 -; NO-FAST-P8-NEXT: # %bb.1: # %entry -; NO-FAST-P8-NEXT: fmr f1, f4 +; NO-FAST-P8-NEXT: xssubsp f0, f1, f2 +; NO-FAST-P8-NEXT: xssubsp f1, f2, f1 +; NO-FAST-P8-NEXT: fsel f0, f0, f3, f4 +; NO-FAST-P8-NEXT: fsel f1, f1, f0, f4 ; NO-FAST-P8-NEXT: blr ; ; NO-FAST-P9-LABEL: select_fast_oeq_float: ; NO-FAST-P9: # %bb.0: # %entry -; NO-FAST-P9-NEXT: fcmpu cr0, f1, f2 -; NO-FAST-P9-NEXT: beq cr0, .LBB2_2 -; NO-FAST-P9-NEXT: # %bb.1: # %entry -; NO-FAST-P9-NEXT: fmr f3, f4 -; NO-FAST-P9-NEXT: .LBB2_2: # %entry -; NO-FAST-P9-NEXT: fmr f1, f3 +; NO-FAST-P9-NEXT: xssubsp f0, f2, f1 +; NO-FAST-P9-NEXT: xssubsp f1, f1, f2 +; NO-FAST-P9-NEXT: fsel f1, f1, f3, f4 +; NO-FAST-P9-NEXT: fsel f1, f0, f1, f4 ; NO-FAST-P9-NEXT: blr entry: %cmp = fcmp fast oeq float %a, %b @@ -159,21 +156,18 @@ ; ; NO-FAST-P8-LABEL: select_fast_oeq_double: ; NO-FAST-P8: # %bb.0: # %entry -; NO-FAST-P8-NEXT: xscmpudp cr0, f1, f2 -; NO-FAST-P8-NEXT: fmr f1, f3 -; NO-FAST-P8-NEXT: beqlr cr0 -; NO-FAST-P8-NEXT: # %bb.1: # %entry -; NO-FAST-P8-NEXT: fmr f1, f4 +; NO-FAST-P8-NEXT: xssubdp f0, f1, f2 +; NO-FAST-P8-NEXT: xsnegdp f1, f0 +; NO-FAST-P8-NEXT: fsel f0, f0, f3, f4 +; NO-FAST-P8-NEXT: fsel f1, f1, f0, f4 ; NO-FAST-P8-NEXT: blr ; ; NO-FAST-P9-LABEL: select_fast_oeq_double: ; NO-FAST-P9: # %bb.0: # %entry -; NO-FAST-P9-NEXT: xscmpudp cr0, f1, f2 -; NO-FAST-P9-NEXT: beq cr0, .LBB3_2 -; NO-FAST-P9-NEXT: # %bb.1: # %entry -; NO-FAST-P9-NEXT: fmr f3, f4 -; NO-FAST-P9-NEXT: .LBB3_2: # %entry -; NO-FAST-P9-NEXT: fmr f1, f3 +; NO-FAST-P9-NEXT: xssubdp f0, f1, f2 +; NO-FAST-P9-NEXT: fsel f1, f0, f3, f4 +; NO-FAST-P9-NEXT: xsnegdp f0, f0 +; NO-FAST-P9-NEXT: fsel f1, f0, f1, f4 ; NO-FAST-P9-NEXT: blr entry: %cmp = fcmp fast oeq double %a, %b @@ -288,21 +282,18 @@ ; ; NO-FAST-P8-LABEL: select_fast_one_float: ; NO-FAST-P8: # %bb.0: # %entry -; NO-FAST-P8-NEXT: fcmpu cr0, f1, f2 -; NO-FAST-P8-NEXT: fmr f1, f3 -; NO-FAST-P8-NEXT: bnelr cr0 -; NO-FAST-P8-NEXT: # %bb.1: # %entry -; NO-FAST-P8-NEXT: fmr f1, f4 +; NO-FAST-P8-NEXT: xssubsp f0, f1, f2 +; NO-FAST-P8-NEXT: xssubsp f1, f2, f1 +; NO-FAST-P8-NEXT: fsel f0, f0, f4, f3 +; NO-FAST-P8-NEXT: fsel f1, f1, f0, f3 ; NO-FAST-P8-NEXT: blr ; ; NO-FAST-P9-LABEL: select_fast_one_float: ; NO-FAST-P9: # %bb.0: # %entry -; NO-FAST-P9-NEXT: fcmpu cr0, f1, f2 -; NO-FAST-P9-NEXT: bne cr0, .LBB6_2 -; NO-FAST-P9-NEXT: # %bb.1: # %entry -; NO-FAST-P9-NEXT: fmr f3, f4 -; NO-FAST-P9-NEXT: .LBB6_2: # %entry -; NO-FAST-P9-NEXT: fmr f1, f3 +; NO-FAST-P9-NEXT: xssubsp f0, f2, f1 +; NO-FAST-P9-NEXT: xssubsp f1, f1, f2 +; NO-FAST-P9-NEXT: fsel f1, f1, f4, f3 +; NO-FAST-P9-NEXT: fsel f1, f0, f1, f3 ; NO-FAST-P9-NEXT: blr entry: %cmp = fcmp fast one float %a, %b @@ -329,21 +320,18 @@ ; ; NO-FAST-P8-LABEL: select_fast_one_double: ; NO-FAST-P8: # %bb.0: # %entry -; NO-FAST-P8-NEXT: xscmpudp cr0, f1, f2 -; NO-FAST-P8-NEXT: fmr f1, f3 -; NO-FAST-P8-NEXT: bnelr cr0 -; NO-FAST-P8-NEXT: # %bb.1: # %entry -; NO-FAST-P8-NEXT: fmr f1, f4 +; NO-FAST-P8-NEXT: xssubdp f0, f1, f2 +; NO-FAST-P8-NEXT: xsnegdp f1, f0 +; NO-FAST-P8-NEXT: fsel f0, f0, f4, f3 +; NO-FAST-P8-NEXT: fsel f1, f1, f0, f3 ; NO-FAST-P8-NEXT: blr ; ; NO-FAST-P9-LABEL: select_fast_one_double: ; NO-FAST-P9: # %bb.0: # %entry -; NO-FAST-P9-NEXT: xscmpudp cr0, f1, f2 -; NO-FAST-P9-NEXT: bne cr0, .LBB7_2 -; NO-FAST-P9-NEXT: # %bb.1: # %entry -; NO-FAST-P9-NEXT: fmr f3, f4 -; NO-FAST-P9-NEXT: .LBB7_2: # %entry -; NO-FAST-P9-NEXT: fmr f1, f3 +; NO-FAST-P9-NEXT: xssubdp f0, f1, f2 +; NO-FAST-P9-NEXT: fsel f1, f0, f4, f3 +; NO-FAST-P9-NEXT: xsnegdp f0, f0 +; NO-FAST-P9-NEXT: fsel f1, f0, f1, f3 ; NO-FAST-P9-NEXT: blr entry: %cmp = fcmp fast one double %a, %b @@ -446,21 +434,14 @@ ; ; NO-FAST-P8-LABEL: select_fast_oge_float: ; NO-FAST-P8: # %bb.0: # %entry -; NO-FAST-P8-NEXT: fcmpu cr0, f1, f2 -; NO-FAST-P8-NEXT: fmr f1, f3 -; NO-FAST-P8-NEXT: bgelr cr0 -; NO-FAST-P8-NEXT: # %bb.1: # %entry -; NO-FAST-P8-NEXT: fmr f1, f4 +; NO-FAST-P8-NEXT: xssubsp f0, f1, f2 +; NO-FAST-P8-NEXT: fsel f1, f0, f3, f4 ; NO-FAST-P8-NEXT: blr ; ; NO-FAST-P9-LABEL: select_fast_oge_float: ; NO-FAST-P9: # %bb.0: # %entry -; NO-FAST-P9-NEXT: fcmpu cr0, f1, f2 -; NO-FAST-P9-NEXT: bge cr0, .LBB10_2 -; NO-FAST-P9-NEXT: # %bb.1: # %entry -; NO-FAST-P9-NEXT: fmr f3, f4 -; NO-FAST-P9-NEXT: .LBB10_2: # %entry -; NO-FAST-P9-NEXT: fmr f1, f3 +; NO-FAST-P9-NEXT: xssubsp f0, f1, f2 +; NO-FAST-P9-NEXT: fsel f1, f0, f3, f4 ; NO-FAST-P9-NEXT: blr entry: %cmp = fcmp fast oge float %a, %b @@ -483,21 +464,14 @@ ; ; NO-FAST-P8-LABEL: select_fast_oge_double: ; NO-FAST-P8: # %bb.0: # %entry -; NO-FAST-P8-NEXT: xscmpudp cr0, f1, f2 -; NO-FAST-P8-NEXT: fmr f1, f3 -; NO-FAST-P8-NEXT: bgelr cr0 -; NO-FAST-P8-NEXT: # %bb.1: # %entry -; NO-FAST-P8-NEXT: fmr f1, f4 +; NO-FAST-P8-NEXT: xssubdp f0, f1, f2 +; NO-FAST-P8-NEXT: fsel f1, f0, f3, f4 ; NO-FAST-P8-NEXT: blr ; ; NO-FAST-P9-LABEL: select_fast_oge_double: ; NO-FAST-P9: # %bb.0: # %entry -; NO-FAST-P9-NEXT: xscmpudp cr0, f1, f2 -; NO-FAST-P9-NEXT: bge cr0, .LBB11_2 -; NO-FAST-P9-NEXT: # %bb.1: # %entry -; NO-FAST-P9-NEXT: fmr f3, f4 -; NO-FAST-P9-NEXT: .LBB11_2: # %entry -; NO-FAST-P9-NEXT: fmr f1, f3 +; NO-FAST-P9-NEXT: xssubdp f0, f1, f2 +; NO-FAST-P9-NEXT: fsel f1, f0, f3, f4 ; NO-FAST-P9-NEXT: blr entry: %cmp = fcmp fast oge double %a, %b @@ -596,21 +570,14 @@ ; ; NO-FAST-P8-LABEL: select_fast_olt_float: ; NO-FAST-P8: # %bb.0: # %entry -; NO-FAST-P8-NEXT: fcmpu cr0, f1, f2 -; NO-FAST-P8-NEXT: fmr f1, f3 -; NO-FAST-P8-NEXT: bltlr cr0 -; NO-FAST-P8-NEXT: # %bb.1: # %entry -; NO-FAST-P8-NEXT: fmr f1, f4 +; NO-FAST-P8-NEXT: xssubsp f0, f1, f2 +; NO-FAST-P8-NEXT: fsel f1, f0, f4, f3 ; NO-FAST-P8-NEXT: blr ; ; NO-FAST-P9-LABEL: select_fast_olt_float: ; NO-FAST-P9: # %bb.0: # %entry -; NO-FAST-P9-NEXT: fcmpu cr0, f1, f2 -; NO-FAST-P9-NEXT: blt cr0, .LBB14_2 -; NO-FAST-P9-NEXT: # %bb.1: # %entry -; NO-FAST-P9-NEXT: fmr f3, f4 -; NO-FAST-P9-NEXT: .LBB14_2: # %entry -; NO-FAST-P9-NEXT: fmr f1, f3 +; NO-FAST-P9-NEXT: xssubsp f0, f1, f2 +; NO-FAST-P9-NEXT: fsel f1, f0, f4, f3 ; NO-FAST-P9-NEXT: blr entry: %cmp = fcmp fast olt float %a, %b @@ -633,21 +600,14 @@ ; ; NO-FAST-P8-LABEL: select_fast_olt_double: ; NO-FAST-P8: # %bb.0: # %entry -; NO-FAST-P8-NEXT: xscmpudp cr0, f1, f2 -; NO-FAST-P8-NEXT: fmr f1, f3 -; NO-FAST-P8-NEXT: bltlr cr0 -; NO-FAST-P8-NEXT: # %bb.1: # %entry -; NO-FAST-P8-NEXT: fmr f1, f4 +; NO-FAST-P8-NEXT: xssubdp f0, f1, f2 +; NO-FAST-P8-NEXT: fsel f1, f0, f4, f3 ; NO-FAST-P8-NEXT: blr ; ; NO-FAST-P9-LABEL: select_fast_olt_double: ; NO-FAST-P9: # %bb.0: # %entry -; NO-FAST-P9-NEXT: xscmpudp cr0, f1, f2 -; NO-FAST-P9-NEXT: blt cr0, .LBB15_2 -; NO-FAST-P9-NEXT: # %bb.1: # %entry -; NO-FAST-P9-NEXT: fmr f3, f4 -; NO-FAST-P9-NEXT: .LBB15_2: # %entry -; NO-FAST-P9-NEXT: fmr f1, f3 +; NO-FAST-P9-NEXT: xssubdp f0, f1, f2 +; NO-FAST-P9-NEXT: fsel f1, f0, f4, f3 ; NO-FAST-P9-NEXT: blr entry: %cmp = fcmp fast olt double %a, %b @@ -746,21 +706,14 @@ ; ; NO-FAST-P8-LABEL: select_fast_ogt_float: ; NO-FAST-P8: # %bb.0: # %entry -; NO-FAST-P8-NEXT: fcmpu cr0, f1, f2 -; NO-FAST-P8-NEXT: fmr f1, f3 -; NO-FAST-P8-NEXT: bgtlr cr0 -; NO-FAST-P8-NEXT: # %bb.1: # %entry -; NO-FAST-P8-NEXT: fmr f1, f4 +; NO-FAST-P8-NEXT: xssubsp f0, f2, f1 +; NO-FAST-P8-NEXT: fsel f1, f0, f4, f3 ; NO-FAST-P8-NEXT: blr ; ; NO-FAST-P9-LABEL: select_fast_ogt_float: ; NO-FAST-P9: # %bb.0: # %entry -; NO-FAST-P9-NEXT: fcmpu cr0, f1, f2 -; NO-FAST-P9-NEXT: bgt cr0, .LBB18_2 -; NO-FAST-P9-NEXT: # %bb.1: # %entry -; NO-FAST-P9-NEXT: fmr f3, f4 -; NO-FAST-P9-NEXT: .LBB18_2: # %entry -; NO-FAST-P9-NEXT: fmr f1, f3 +; NO-FAST-P9-NEXT: xssubsp f0, f2, f1 +; NO-FAST-P9-NEXT: fsel f1, f0, f4, f3 ; NO-FAST-P9-NEXT: blr entry: %cmp = fcmp fast ogt float %a, %b @@ -783,21 +736,14 @@ ; ; NO-FAST-P8-LABEL: select_fast_ogt_double: ; NO-FAST-P8: # %bb.0: # %entry -; NO-FAST-P8-NEXT: xscmpudp cr0, f1, f2 -; NO-FAST-P8-NEXT: fmr f1, f3 -; NO-FAST-P8-NEXT: bgtlr cr0 -; NO-FAST-P8-NEXT: # %bb.1: # %entry -; NO-FAST-P8-NEXT: fmr f1, f4 +; NO-FAST-P8-NEXT: xssubdp f0, f2, f1 +; NO-FAST-P8-NEXT: fsel f1, f0, f4, f3 ; NO-FAST-P8-NEXT: blr ; ; NO-FAST-P9-LABEL: select_fast_ogt_double: ; NO-FAST-P9: # %bb.0: # %entry -; NO-FAST-P9-NEXT: xscmpudp cr0, f1, f2 -; NO-FAST-P9-NEXT: bgt cr0, .LBB19_2 -; NO-FAST-P9-NEXT: # %bb.1: # %entry -; NO-FAST-P9-NEXT: fmr f3, f4 -; NO-FAST-P9-NEXT: .LBB19_2: # %entry -; NO-FAST-P9-NEXT: fmr f1, f3 +; NO-FAST-P9-NEXT: xssubdp f0, f2, f1 +; NO-FAST-P9-NEXT: fsel f1, f0, f4, f3 ; NO-FAST-P9-NEXT: blr entry: %cmp = fcmp fast ogt double %a, %b @@ -900,21 +846,14 @@ ; ; NO-FAST-P8-LABEL: select_fast_ole_float: ; NO-FAST-P8: # %bb.0: # %entry -; NO-FAST-P8-NEXT: fcmpu cr0, f1, f2 -; NO-FAST-P8-NEXT: fmr f1, f3 -; NO-FAST-P8-NEXT: blelr cr0 -; NO-FAST-P8-NEXT: # %bb.1: # %entry -; NO-FAST-P8-NEXT: fmr f1, f4 +; NO-FAST-P8-NEXT: xssubsp f0, f2, f1 +; NO-FAST-P8-NEXT: fsel f1, f0, f3, f4 ; NO-FAST-P8-NEXT: blr ; ; NO-FAST-P9-LABEL: select_fast_ole_float: ; NO-FAST-P9: # %bb.0: # %entry -; NO-FAST-P9-NEXT: fcmpu cr0, f1, f2 -; NO-FAST-P9-NEXT: ble cr0, .LBB22_2 -; NO-FAST-P9-NEXT: # %bb.1: # %entry -; NO-FAST-P9-NEXT: fmr f3, f4 -; NO-FAST-P9-NEXT: .LBB22_2: # %entry -; NO-FAST-P9-NEXT: fmr f1, f3 +; NO-FAST-P9-NEXT: xssubsp f0, f2, f1 +; NO-FAST-P9-NEXT: fsel f1, f0, f3, f4 ; NO-FAST-P9-NEXT: blr entry: %cmp = fcmp fast ole float %a, %b @@ -937,21 +876,14 @@ ; ; NO-FAST-P8-LABEL: select_fast_ole_double: ; NO-FAST-P8: # %bb.0: # %entry -; NO-FAST-P8-NEXT: xscmpudp cr0, f1, f2 -; NO-FAST-P8-NEXT: fmr f1, f3 -; NO-FAST-P8-NEXT: blelr cr0 -; NO-FAST-P8-NEXT: # %bb.1: # %entry -; NO-FAST-P8-NEXT: fmr f1, f4 +; NO-FAST-P8-NEXT: xssubdp f0, f2, f1 +; NO-FAST-P8-NEXT: fsel f1, f0, f3, f4 ; NO-FAST-P8-NEXT: blr ; ; NO-FAST-P9-LABEL: select_fast_ole_double: ; NO-FAST-P9: # %bb.0: # %entry -; NO-FAST-P9-NEXT: xscmpudp cr0, f1, f2 -; NO-FAST-P9-NEXT: ble cr0, .LBB23_2 -; NO-FAST-P9-NEXT: # %bb.1: # %entry -; NO-FAST-P9-NEXT: fmr f3, f4 -; NO-FAST-P9-NEXT: .LBB23_2: # %entry -; NO-FAST-P9-NEXT: fmr f1, f3 +; NO-FAST-P9-NEXT: xssubdp f0, f2, f1 +; NO-FAST-P9-NEXT: fsel f1, f0, f3, f4 ; NO-FAST-P9-NEXT: blr entry: %cmp = fcmp fast ole double %a, %b