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 @@ -7972,6 +7972,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. @@ -7992,15 +7993,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 @@ -1,58 +1,54 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py -; RUN: llc -mcpu=pwr8 -ppc-asm-full-reg-names --enable-unsafe-fp-math \ -; RUN: -verify-machineinstrs --enable-no-signed-zeros-fp-math \ -; RUN: --enable-no-nans-fp-math --enable-no-infs-fp-math \ -; RUN: -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s \ -; RUN: --check-prefix=FAST-P8 -; RUN: llc -mcpu=pwr9 -ppc-asm-full-reg-names --enable-unsafe-fp-math \ -; RUN: -verify-machineinstrs --enable-no-signed-zeros-fp-math \ -; RUN: --enable-no-nans-fp-math --enable-no-infs-fp-math \ -; RUN: -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s \ -; RUN: --check-prefix=FAST-P9 ; RUN: llc -mcpu=pwr9 -ppc-asm-full-reg-names -verify-machineinstrs \ ; RUN: -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s \ -; RUN: --check-prefix=NO-FAST-P9 +; RUN: --check-prefix=P9 ; RUN: llc -mcpu=pwr8 -ppc-asm-full-reg-names -verify-machineinstrs \ ; RUN: -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s \ -; RUN: --check-prefix=NO-FAST-P8 +; RUN: --check-prefix=P8 define double @testoeq(double %a, double %b, double %c, double %d) { -; FAST-P8-LABEL: testoeq: -; 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 +; P9-LABEL: testoeq: +; P9: # %bb.0: # %entry +; P9-NEXT: xscmpudp cr0, f1, f2 +; P9-NEXT: beq cr0, .LBB0_2 +; P9-NEXT: # %bb.1: # %entry +; P9-NEXT: fmr f3, f4 +; P9-NEXT: .LBB0_2: # %entry +; P9-NEXT: fmr f1, f3 +; P9-NEXT: blr ; -; FAST-P9-LABEL: testoeq: -; 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: -; NO-FAST-P9: # %bb.0: # %entry -; NO-FAST-P9-NEXT: xscmpudp cr0, f1, f2 -; NO-FAST-P9-NEXT: beq cr0, .LBB0_2 -; NO-FAST-P9-NEXT: # %bb.1: # %entry -; NO-FAST-P9-NEXT: fmr f3, f4 -; NO-FAST-P9-NEXT: .LBB0_2: # %entry -; NO-FAST-P9-NEXT: fmr f1, f3 -; NO-FAST-P9-NEXT: blr +; P8-LABEL: testoeq: +; P8: # %bb.0: # %entry +; P8-NEXT: xscmpudp cr0, f1, f2 +; P8-NEXT: fmr f1, f3 +; P8-NEXT: beqlr cr0 +; P8-NEXT: # %bb.1: # %entry +; P8-NEXT: fmr f1, f4 +; 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) { +; P9-LABEL: testoeq_fast: +; P9: # %bb.0: # %entry +; P9-NEXT: xssubdp f0, f1, f2 +; P9-NEXT: fsel f1, f0, f3, f4 +; P9-NEXT: xsnegdp f0, f0 +; P9-NEXT: fsel f1, f0, f1, f4 +; P9-NEXT: blr ; -; NO-FAST-P8-LABEL: testoeq: -; 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: blr +; P8-LABEL: testoeq_fast: +; P8: # %bb.0: # %entry +; P8-NEXT: xssubdp f0, f1, f2 +; P8-NEXT: xsnegdp f1, f0 +; P8-NEXT: fsel f0, f0, f3, f4 +; P8-NEXT: fsel f1, f1, f0, f4 +; P8-NEXT: blr entry: - %cmp = fcmp fast oeq double %a, %b - %cond = select fast i1 %cmp, double %c, double %d + %cmp = fcmp nnan ninf oeq double %a, %b + %cond = select nnan ninf i1 %cmp, double %c, double %d ret double %cond } 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 @@ -128,7 +128,7 @@ ; NO-FAST-P8-NEXT: fmr f1, f2 ; NO-FAST-P8-NEXT: blr entry: - %cmp = fcmp fast ogt float %a, %b + %cmp = fcmp ogt float %a, %b %cond = select i1 %cmp, float %a, float %b ret float %cond } @@ -151,7 +151,7 @@ ; NO-FAST-P8-NEXT: fmr f1, f2 ; NO-FAST-P8-NEXT: blr entry: - %cmp = fcmp fast ogt double %a, %b + %cmp = fcmp ogt double %a, %b %cond = select i1 %cmp, double %a, double %b ret double %cond } @@ -174,7 +174,7 @@ ; NO-FAST-P8-NEXT: fmr f1, f2 ; NO-FAST-P8-NEXT: blr entry: - %cmp = fcmp fast olt float %a, %b + %cmp = fcmp olt float %a, %b %cond = select i1 %cmp, float %a, float %b ret float %cond } @@ -197,7 +197,7 @@ ; NO-FAST-P8-NEXT: fmr f1, f2 ; NO-FAST-P8-NEXT: blr entry: - %cmp = fcmp fast olt double %a, %b + %cmp = fcmp olt double %a, %b %cond = select i1 %cmp, double %a, double %b ret double %cond } 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 @@ -1,57 +1,31 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py -; RUN: llc -mcpu=pwr8 -ppc-asm-full-reg-names --enable-unsafe-fp-math \ -; RUN: -verify-machineinstrs --enable-no-signed-zeros-fp-math \ -; RUN: --enable-no-nans-fp-math --enable-no-infs-fp-math \ -; RUN: -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s \ -; RUN: --check-prefix=FAST-P8 -; RUN: llc -mcpu=pwr9 -ppc-asm-full-reg-names --enable-unsafe-fp-math \ -; RUN: -verify-machineinstrs --enable-no-signed-zeros-fp-math \ -; RUN: --enable-no-nans-fp-math --enable-no-infs-fp-math \ -; RUN: -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s \ -; RUN: --check-prefix=FAST-P9 ; RUN: llc -mcpu=pwr8 -ppc-asm-full-reg-names -verify-machineinstrs \ ; RUN: -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s \ -; RUN: --check-prefix=NO-FAST-P8 +; RUN: --check-prefix=P8 ; RUN: llc -mcpu=pwr9 -ppc-asm-full-reg-names -verify-machineinstrs \ ; RUN: -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s \ -; RUN: --check-prefix=NO-FAST-P9 +; RUN: --check-prefix=P9 ; Test oeq define float @select_oeq_float(float %a, float %b, float %c, float %d) { -; FAST-P8-LABEL: select_oeq_float: -; FAST-P8: # %bb.0: # %entry -; FAST-P8-NEXT: xssubsp f0, f1, f2 -; FAST-P8-NEXT: xssubsp f1, f2, f1 -; FAST-P8-NEXT: fsel f0, f0, f3, f4 -; FAST-P8-NEXT: fsel f1, f1, f0, f4 -; FAST-P8-NEXT: blr -; -; FAST-P9-LABEL: select_oeq_float: -; FAST-P9: # %bb.0: # %entry -; FAST-P9-NEXT: xssubsp f0, f2, f1 -; FAST-P9-NEXT: xssubsp f1, f1, f2 -; FAST-P9-NEXT: fsel f1, f1, f3, f4 -; FAST-P9-NEXT: fsel f1, f0, f1, f4 -; FAST-P9-NEXT: blr -; -; NO-FAST-P8-LABEL: select_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: blr -; -; NO-FAST-P9-LABEL: select_oeq_float: -; NO-FAST-P9: # %bb.0: # %entry -; NO-FAST-P9-NEXT: fcmpu cr0, f1, f2 -; NO-FAST-P9-NEXT: beq cr0, .LBB0_2 -; NO-FAST-P9-NEXT: # %bb.1: # %entry -; NO-FAST-P9-NEXT: fmr f3, f4 -; NO-FAST-P9-NEXT: .LBB0_2: # %entry -; NO-FAST-P9-NEXT: fmr f1, f3 -; NO-FAST-P9-NEXT: blr +; P8-LABEL: select_oeq_float: +; P8: # %bb.0: # %entry +; P8-NEXT: fcmpu cr0, f1, f2 +; P8-NEXT: fmr f1, f3 +; P8-NEXT: beqlr cr0 +; P8-NEXT: # %bb.1: # %entry +; P8-NEXT: fmr f1, f4 +; P8-NEXT: blr +; +; P9-LABEL: select_oeq_float: +; P9: # %bb.0: # %entry +; P9-NEXT: fcmpu cr0, f1, f2 +; P9-NEXT: beq cr0, .LBB0_2 +; P9-NEXT: # %bb.1: # %entry +; P9-NEXT: fmr f3, f4 +; P9-NEXT: .LBB0_2: # %entry +; P9-NEXT: fmr f1, f3 +; P9-NEXT: blr entry: %cmp = fcmp oeq float %a, %b %cond = select i1 %cmp, float %c, float %d @@ -59,40 +33,24 @@ } define double @select_oeq_double(double %a, double %b, double %c, double %d) { -; FAST-P8-LABEL: select_oeq_double: -; 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: select_oeq_double: -; 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-P8-LABEL: select_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: blr -; -; NO-FAST-P9-LABEL: select_oeq_double: -; NO-FAST-P9: # %bb.0: # %entry -; NO-FAST-P9-NEXT: xscmpudp cr0, f1, f2 -; NO-FAST-P9-NEXT: beq cr0, .LBB1_2 -; NO-FAST-P9-NEXT: # %bb.1: # %entry -; NO-FAST-P9-NEXT: fmr f3, f4 -; NO-FAST-P9-NEXT: .LBB1_2: # %entry -; NO-FAST-P9-NEXT: fmr f1, f3 -; NO-FAST-P9-NEXT: blr +; P8-LABEL: select_oeq_double: +; P8: # %bb.0: # %entry +; P8-NEXT: xscmpudp cr0, f1, f2 +; P8-NEXT: fmr f1, f3 +; P8-NEXT: beqlr cr0 +; P8-NEXT: # %bb.1: # %entry +; P8-NEXT: fmr f1, f4 +; P8-NEXT: blr +; +; P9-LABEL: select_oeq_double: +; P9: # %bb.0: # %entry +; P9-NEXT: xscmpudp cr0, f1, f2 +; P9-NEXT: beq cr0, .LBB1_2 +; P9-NEXT: # %bb.1: # %entry +; P9-NEXT: fmr f3, f4 +; P9-NEXT: .LBB1_2: # %entry +; P9-NEXT: fmr f1, f3 +; P9-NEXT: blr entry: %cmp = fcmp oeq double %a, %b %cond = select i1 %cmp, double %c, double %d @@ -100,126 +58,72 @@ } define float @select_fast_oeq_float(float %a, float %b, float %c, float %d) { -; FAST-P8-LABEL: select_fast_oeq_float: -; FAST-P8: # %bb.0: # %entry -; FAST-P8-NEXT: xssubsp f0, f1, f2 -; FAST-P8-NEXT: xssubsp f1, f2, f1 -; FAST-P8-NEXT: fsel f0, f0, f3, f4 -; FAST-P8-NEXT: fsel f1, f1, f0, f4 -; FAST-P8-NEXT: blr -; -; FAST-P9-LABEL: select_fast_oeq_float: -; FAST-P9: # %bb.0: # %entry -; FAST-P9-NEXT: xssubsp f0, f2, f1 -; FAST-P9-NEXT: xssubsp f1, f1, f2 -; FAST-P9-NEXT: fsel f1, f1, f3, f4 -; FAST-P9-NEXT: fsel f1, f0, f1, f4 -; FAST-P9-NEXT: blr -; -; 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: 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: blr +; P8-LABEL: select_fast_oeq_float: +; P8: # %bb.0: # %entry +; P8-NEXT: xssubsp f0, f1, f2 +; P8-NEXT: xsnegdp f1, f0 +; P8-NEXT: fsel f0, f0, f3, f4 +; P8-NEXT: fsel f1, f1, f0, f4 +; P8-NEXT: blr +; +; P9-LABEL: select_fast_oeq_float: +; P9: # %bb.0: # %entry +; P9-NEXT: xssubsp f0, f1, f2 +; P9-NEXT: xsnegdp f1, f0 +; P9-NEXT: fsel f0, f0, f3, f4 +; P9-NEXT: fsel f1, f1, f0, f4 +; P9-NEXT: blr entry: - %cmp = fcmp fast oeq float %a, %b - %cond = select fast i1 %cmp, float %c, float %d + %cmp = fcmp nnan ninf oeq float %a, %b + %cond = select nnan ninf i1 %cmp, float %c, float %d ret float %cond } define double @select_fast_oeq_double(double %a, double %b, double %c, double %d) { -; FAST-P8-LABEL: select_fast_oeq_double: -; 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: select_fast_oeq_double: -; 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-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: 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: blr +; P8-LABEL: select_fast_oeq_double: +; P8: # %bb.0: # %entry +; P8-NEXT: xssubdp f0, f1, f2 +; P8-NEXT: xsnegdp f1, f0 +; P8-NEXT: fsel f0, f0, f3, f4 +; P8-NEXT: fsel f1, f1, f0, f4 +; P8-NEXT: blr +; +; P9-LABEL: select_fast_oeq_double: +; P9: # %bb.0: # %entry +; P9-NEXT: xssubdp f0, f1, f2 +; P9-NEXT: fsel f1, f0, f3, f4 +; P9-NEXT: xsnegdp f0, f0 +; P9-NEXT: fsel f1, f0, f1, f4 +; P9-NEXT: blr entry: - %cmp = fcmp fast oeq double %a, %b - %cond = select fast i1 %cmp, double %c, double %d + %cmp = fcmp nnan ninf oeq double %a, %b + %cond = select nnan ninf i1 %cmp, double %c, double %d ret double %cond } ; Test one define float @select_one_float(float %a, float %b, float %c, float %d) { -; FAST-P8-LABEL: select_one_float: -; FAST-P8: # %bb.0: # %entry -; FAST-P8-NEXT: xssubsp f0, f1, f2 -; FAST-P8-NEXT: xssubsp f1, f2, f1 -; FAST-P8-NEXT: fsel f0, f0, f4, f3 -; FAST-P8-NEXT: fsel f1, f1, f0, f3 -; FAST-P8-NEXT: blr -; -; FAST-P9-LABEL: select_one_float: -; FAST-P9: # %bb.0: # %entry -; FAST-P9-NEXT: xssubsp f0, f2, f1 -; FAST-P9-NEXT: xssubsp f1, f1, f2 -; FAST-P9-NEXT: fsel f1, f1, f4, f3 -; FAST-P9-NEXT: fsel f1, f0, f1, f3 -; FAST-P9-NEXT: blr -; -; NO-FAST-P8-LABEL: select_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: crnor 4*cr5+lt, un, eq -; NO-FAST-P8-NEXT: bclr 12, 4*cr5+lt, 0 -; NO-FAST-P8-NEXT: # %bb.1: # %entry -; NO-FAST-P8-NEXT: fmr f1, f4 -; NO-FAST-P8-NEXT: blr -; -; NO-FAST-P9-LABEL: select_one_float: -; NO-FAST-P9: # %bb.0: # %entry -; NO-FAST-P9-NEXT: fcmpu cr0, f1, f2 -; NO-FAST-P9-NEXT: crnor 4*cr5+lt, un, eq -; NO-FAST-P9-NEXT: bc 12, 4*cr5+lt, .LBB4_2 -; NO-FAST-P9-NEXT: # %bb.1: # %entry -; NO-FAST-P9-NEXT: fmr f3, f4 -; NO-FAST-P9-NEXT: .LBB4_2: # %entry -; NO-FAST-P9-NEXT: fmr f1, f3 -; NO-FAST-P9-NEXT: blr +; P8-LABEL: select_one_float: +; P8: # %bb.0: # %entry +; P8-NEXT: fcmpu cr0, f1, f2 +; P8-NEXT: fmr f1, f3 +; P8-NEXT: crnor 4*cr5+lt, un, eq +; P8-NEXT: bclr 12, 4*cr5+lt, 0 +; P8-NEXT: # %bb.1: # %entry +; P8-NEXT: fmr f1, f4 +; P8-NEXT: blr +; +; P9-LABEL: select_one_float: +; P9: # %bb.0: # %entry +; P9-NEXT: fcmpu cr0, f1, f2 +; P9-NEXT: crnor 4*cr5+lt, un, eq +; P9-NEXT: bc 12, 4*cr5+lt, .LBB4_2 +; P9-NEXT: # %bb.1: # %entry +; P9-NEXT: fmr f3, f4 +; P9-NEXT: .LBB4_2: # %entry +; P9-NEXT: fmr f1, f3 +; P9-NEXT: blr entry: %cmp = fcmp one float %a, %b %cond = select i1 %cmp, float %c, float %d @@ -227,42 +131,26 @@ } define double @select_one_double(double %a, double %b, double %c, double %d) { -; FAST-P8-LABEL: select_one_double: -; FAST-P8: # %bb.0: # %entry -; FAST-P8-NEXT: xssubdp f0, f1, f2 -; FAST-P8-NEXT: xsnegdp f1, f0 -; FAST-P8-NEXT: fsel f0, f0, f4, f3 -; FAST-P8-NEXT: fsel f1, f1, f0, f3 -; FAST-P8-NEXT: blr -; -; FAST-P9-LABEL: select_one_double: -; FAST-P9: # %bb.0: # %entry -; FAST-P9-NEXT: xssubdp f0, f1, f2 -; FAST-P9-NEXT: fsel f1, f0, f4, f3 -; FAST-P9-NEXT: xsnegdp f0, f0 -; FAST-P9-NEXT: fsel f1, f0, f1, f3 -; FAST-P9-NEXT: blr -; -; NO-FAST-P8-LABEL: select_one_double: -; 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: crnor 4*cr5+lt, un, eq -; NO-FAST-P8-NEXT: bclr 12, 4*cr5+lt, 0 -; NO-FAST-P8-NEXT: # %bb.1: # %entry -; NO-FAST-P8-NEXT: fmr f1, f4 -; NO-FAST-P8-NEXT: blr -; -; NO-FAST-P9-LABEL: select_one_double: -; NO-FAST-P9: # %bb.0: # %entry -; NO-FAST-P9-NEXT: fcmpu cr0, f1, f2 -; NO-FAST-P9-NEXT: crnor 4*cr5+lt, un, eq -; NO-FAST-P9-NEXT: bc 12, 4*cr5+lt, .LBB5_2 -; NO-FAST-P9-NEXT: # %bb.1: # %entry -; NO-FAST-P9-NEXT: fmr f3, f4 -; NO-FAST-P9-NEXT: .LBB5_2: # %entry -; NO-FAST-P9-NEXT: fmr f1, f3 -; NO-FAST-P9-NEXT: blr +; P8-LABEL: select_one_double: +; P8: # %bb.0: # %entry +; P8-NEXT: fcmpu cr0, f1, f2 +; P8-NEXT: fmr f1, f3 +; P8-NEXT: crnor 4*cr5+lt, un, eq +; P8-NEXT: bclr 12, 4*cr5+lt, 0 +; P8-NEXT: # %bb.1: # %entry +; P8-NEXT: fmr f1, f4 +; P8-NEXT: blr +; +; P9-LABEL: select_one_double: +; P9: # %bb.0: # %entry +; P9-NEXT: fcmpu cr0, f1, f2 +; P9-NEXT: crnor 4*cr5+lt, un, eq +; P9-NEXT: bc 12, 4*cr5+lt, .LBB5_2 +; P9-NEXT: # %bb.1: # %entry +; P9-NEXT: fmr f3, f4 +; P9-NEXT: .LBB5_2: # %entry +; P9-NEXT: fmr f1, f3 +; P9-NEXT: blr entry: %cmp = fcmp one double %a, %b %cond = select i1 %cmp, double %c, double %d @@ -270,122 +158,72 @@ } define float @select_fast_one_float(float %a, float %b, float %c, float %d) { -; FAST-P8-LABEL: select_fast_one_float: -; FAST-P8: # %bb.0: # %entry -; FAST-P8-NEXT: xssubsp f0, f1, f2 -; FAST-P8-NEXT: xssubsp f1, f2, f1 -; FAST-P8-NEXT: fsel f0, f0, f4, f3 -; FAST-P8-NEXT: fsel f1, f1, f0, f3 -; FAST-P8-NEXT: blr -; -; FAST-P9-LABEL: select_fast_one_float: -; FAST-P9: # %bb.0: # %entry -; FAST-P9-NEXT: xssubsp f0, f2, f1 -; FAST-P9-NEXT: xssubsp f1, f1, f2 -; FAST-P9-NEXT: fsel f1, f1, f4, f3 -; FAST-P9-NEXT: fsel f1, f0, f1, f3 -; FAST-P9-NEXT: blr -; -; 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: 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: blr +; P8-LABEL: select_fast_one_float: +; P8: # %bb.0: # %entry +; P8-NEXT: xssubsp f0, f1, f2 +; P8-NEXT: xsnegdp f1, f0 +; P8-NEXT: fsel f0, f0, f4, f3 +; P8-NEXT: fsel f1, f1, f0, f3 +; P8-NEXT: blr +; +; P9-LABEL: select_fast_one_float: +; P9: # %bb.0: # %entry +; P9-NEXT: xssubsp f0, f1, f2 +; P9-NEXT: xsnegdp f1, f0 +; P9-NEXT: fsel f0, f0, f4, f3 +; P9-NEXT: fsel f1, f1, f0, f3 +; P9-NEXT: blr entry: - %cmp = fcmp fast one float %a, %b - %cond = select fast i1 %cmp, float %c, float %d + %cmp = fcmp nnan ninf one float %a, %b + %cond = select nnan ninf i1 %cmp, float %c, float %d ret float %cond } define double @select_fast_one_double(double %a, double %b, double %c, double %d) { -; FAST-P8-LABEL: select_fast_one_double: -; FAST-P8: # %bb.0: # %entry -; FAST-P8-NEXT: xssubdp f0, f1, f2 -; FAST-P8-NEXT: xsnegdp f1, f0 -; FAST-P8-NEXT: fsel f0, f0, f4, f3 -; FAST-P8-NEXT: fsel f1, f1, f0, f3 -; FAST-P8-NEXT: blr -; -; FAST-P9-LABEL: select_fast_one_double: -; FAST-P9: # %bb.0: # %entry -; FAST-P9-NEXT: xssubdp f0, f1, f2 -; FAST-P9-NEXT: fsel f1, f0, f4, f3 -; FAST-P9-NEXT: xsnegdp f0, f0 -; FAST-P9-NEXT: fsel f1, f0, f1, f3 -; FAST-P9-NEXT: blr -; -; 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: 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: blr +; P8-LABEL: select_fast_one_double: +; P8: # %bb.0: # %entry +; P8-NEXT: xssubdp f0, f1, f2 +; P8-NEXT: xsnegdp f1, f0 +; P8-NEXT: fsel f0, f0, f4, f3 +; P8-NEXT: fsel f1, f1, f0, f3 +; P8-NEXT: blr +; +; P9-LABEL: select_fast_one_double: +; P9: # %bb.0: # %entry +; P9-NEXT: xssubdp f0, f1, f2 +; P9-NEXT: fsel f1, f0, f4, f3 +; P9-NEXT: xsnegdp f0, f0 +; P9-NEXT: fsel f1, f0, f1, f3 +; P9-NEXT: blr entry: - %cmp = fcmp fast one double %a, %b - %cond = select fast i1 %cmp, double %c, double %d + %cmp = fcmp nnan ninf one double %a, %b + %cond = select nnan ninf i1 %cmp, double %c, double %d ret double %cond } ; Test oge define float @select_oge_float(float %a, float %b, float %c, float %d) { -; FAST-P8-LABEL: select_oge_float: -; FAST-P8: # %bb.0: # %entry -; FAST-P8-NEXT: xssubsp f0, f1, f2 -; FAST-P8-NEXT: fsel f1, f0, f3, f4 -; FAST-P8-NEXT: blr -; -; FAST-P9-LABEL: select_oge_float: -; FAST-P9: # %bb.0: # %entry -; FAST-P9-NEXT: xssubsp f0, f1, f2 -; FAST-P9-NEXT: fsel f1, f0, f3, f4 -; FAST-P9-NEXT: blr -; -; NO-FAST-P8-LABEL: select_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: crnor 4*cr5+lt, un, lt -; NO-FAST-P8-NEXT: bclr 12, 4*cr5+lt, 0 -; NO-FAST-P8-NEXT: # %bb.1: # %entry -; NO-FAST-P8-NEXT: fmr f1, f4 -; NO-FAST-P8-NEXT: blr -; -; NO-FAST-P9-LABEL: select_oge_float: -; NO-FAST-P9: # %bb.0: # %entry -; NO-FAST-P9-NEXT: fcmpu cr0, f1, f2 -; NO-FAST-P9-NEXT: crnor 4*cr5+lt, un, lt -; NO-FAST-P9-NEXT: bc 12, 4*cr5+lt, .LBB8_2 -; NO-FAST-P9-NEXT: # %bb.1: # %entry -; NO-FAST-P9-NEXT: fmr f3, f4 -; NO-FAST-P9-NEXT: .LBB8_2: # %entry -; NO-FAST-P9-NEXT: fmr f1, f3 -; NO-FAST-P9-NEXT: blr +; P8-LABEL: select_oge_float: +; P8: # %bb.0: # %entry +; P8-NEXT: fcmpu cr0, f1, f2 +; P8-NEXT: fmr f1, f3 +; P8-NEXT: crnor 4*cr5+lt, un, lt +; P8-NEXT: bclr 12, 4*cr5+lt, 0 +; P8-NEXT: # %bb.1: # %entry +; P8-NEXT: fmr f1, f4 +; P8-NEXT: blr +; +; P9-LABEL: select_oge_float: +; P9: # %bb.0: # %entry +; P9-NEXT: fcmpu cr0, f1, f2 +; P9-NEXT: crnor 4*cr5+lt, un, lt +; P9-NEXT: bc 12, 4*cr5+lt, .LBB8_2 +; P9-NEXT: # %bb.1: # %entry +; P9-NEXT: fmr f3, f4 +; P9-NEXT: .LBB8_2: # %entry +; P9-NEXT: fmr f1, f3 +; P9-NEXT: blr entry: %cmp = fcmp oge float %a, %b %cond = select i1 %cmp, float %c, float %d @@ -393,38 +231,26 @@ } define double @select_oge_double(double %a, double %b, double %c, double %d) { -; FAST-P8-LABEL: select_oge_double: -; FAST-P8: # %bb.0: # %entry -; FAST-P8-NEXT: xssubdp f0, f1, f2 -; FAST-P8-NEXT: fsel f1, f0, f3, f4 -; FAST-P8-NEXT: blr -; -; FAST-P9-LABEL: select_oge_double: -; FAST-P9: # %bb.0: # %entry -; FAST-P9-NEXT: xssubdp f0, f1, f2 -; FAST-P9-NEXT: fsel f1, f0, f3, f4 -; FAST-P9-NEXT: blr -; -; NO-FAST-P8-LABEL: select_oge_double: -; 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: crnor 4*cr5+lt, un, lt -; NO-FAST-P8-NEXT: bclr 12, 4*cr5+lt, 0 -; NO-FAST-P8-NEXT: # %bb.1: # %entry -; NO-FAST-P8-NEXT: fmr f1, f4 -; NO-FAST-P8-NEXT: blr -; -; NO-FAST-P9-LABEL: select_oge_double: -; NO-FAST-P9: # %bb.0: # %entry -; NO-FAST-P9-NEXT: fcmpu cr0, f1, f2 -; NO-FAST-P9-NEXT: crnor 4*cr5+lt, un, lt -; NO-FAST-P9-NEXT: bc 12, 4*cr5+lt, .LBB9_2 -; NO-FAST-P9-NEXT: # %bb.1: # %entry -; NO-FAST-P9-NEXT: fmr f3, f4 -; NO-FAST-P9-NEXT: .LBB9_2: # %entry -; NO-FAST-P9-NEXT: fmr f1, f3 -; NO-FAST-P9-NEXT: blr +; P8-LABEL: select_oge_double: +; P8: # %bb.0: # %entry +; P8-NEXT: fcmpu cr0, f1, f2 +; P8-NEXT: fmr f1, f3 +; P8-NEXT: crnor 4*cr5+lt, un, lt +; P8-NEXT: bclr 12, 4*cr5+lt, 0 +; P8-NEXT: # %bb.1: # %entry +; P8-NEXT: fmr f1, f4 +; P8-NEXT: blr +; +; P9-LABEL: select_oge_double: +; P9: # %bb.0: # %entry +; P9-NEXT: fcmpu cr0, f1, f2 +; P9-NEXT: crnor 4*cr5+lt, un, lt +; P9-NEXT: bc 12, 4*cr5+lt, .LBB9_2 +; P9-NEXT: # %bb.1: # %entry +; P9-NEXT: fmr f3, f4 +; P9-NEXT: .LBB9_2: # %entry +; P9-NEXT: fmr f1, f3 +; P9-NEXT: blr entry: %cmp = fcmp oge double %a, %b %cond = select i1 %cmp, double %c, double %d @@ -432,112 +258,62 @@ } define float @select_fast_oge_float(float %a, float %b, float %c, float %d) { -; FAST-P8-LABEL: select_fast_oge_float: -; FAST-P8: # %bb.0: # %entry -; FAST-P8-NEXT: xssubsp f0, f1, f2 -; FAST-P8-NEXT: fsel f1, f0, f3, f4 -; FAST-P8-NEXT: blr -; -; FAST-P9-LABEL: select_fast_oge_float: -; FAST-P9: # %bb.0: # %entry -; FAST-P9-NEXT: xssubsp f0, f1, f2 -; FAST-P9-NEXT: fsel f1, f0, f3, f4 -; FAST-P9-NEXT: blr -; -; 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: 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: blr +; P8-LABEL: select_fast_oge_float: +; P8: # %bb.0: # %entry +; P8-NEXT: xssubsp f0, f1, f2 +; P8-NEXT: fsel f1, f0, f3, f4 +; P8-NEXT: blr +; +; P9-LABEL: select_fast_oge_float: +; P9: # %bb.0: # %entry +; P9-NEXT: xssubsp f0, f1, f2 +; P9-NEXT: fsel f1, f0, f3, f4 +; P9-NEXT: blr entry: - %cmp = fcmp fast oge float %a, %b - %cond = select fast i1 %cmp, float %c, float %d + %cmp = fcmp nnan ninf oge float %a, %b + %cond = select nnan ninf i1 %cmp, float %c, float %d ret float %cond } define double @select_fast_oge_double(double %a, double %b, double %c, double %d) { -; FAST-P8-LABEL: select_fast_oge_double: -; FAST-P8: # %bb.0: # %entry -; FAST-P8-NEXT: xssubdp f0, f1, f2 -; FAST-P8-NEXT: fsel f1, f0, f3, f4 -; FAST-P8-NEXT: blr -; -; FAST-P9-LABEL: select_fast_oge_double: -; FAST-P9: # %bb.0: # %entry -; FAST-P9-NEXT: xssubdp f0, f1, f2 -; FAST-P9-NEXT: fsel f1, f0, f3, f4 -; FAST-P9-NEXT: blr -; -; 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: 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: blr +; P8-LABEL: select_fast_oge_double: +; P8: # %bb.0: # %entry +; P8-NEXT: xssubdp f0, f1, f2 +; P8-NEXT: fsel f1, f0, f3, f4 +; P8-NEXT: blr +; +; P9-LABEL: select_fast_oge_double: +; P9: # %bb.0: # %entry +; P9-NEXT: xssubdp f0, f1, f2 +; P9-NEXT: fsel f1, f0, f3, f4 +; P9-NEXT: blr entry: - %cmp = fcmp fast oge double %a, %b - %cond = select fast i1 %cmp, double %c, double %d + %cmp = fcmp nnan ninf oge double %a, %b + %cond = select nnan ninf i1 %cmp, double %c, double %d ret double %cond } ; Test olt define float @select_olt_float(float %a, float %b, float %c, float %d) { -; FAST-P8-LABEL: select_olt_float: -; FAST-P8: # %bb.0: # %entry -; FAST-P8-NEXT: xssubsp f0, f1, f2 -; FAST-P8-NEXT: fsel f1, f0, f4, f3 -; FAST-P8-NEXT: blr -; -; FAST-P9-LABEL: select_olt_float: -; FAST-P9: # %bb.0: # %entry -; FAST-P9-NEXT: xssubsp f0, f1, f2 -; FAST-P9-NEXT: fsel f1, f0, f4, f3 -; FAST-P9-NEXT: blr -; -; NO-FAST-P8-LABEL: select_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: blr -; -; NO-FAST-P9-LABEL: select_olt_float: -; NO-FAST-P9: # %bb.0: # %entry -; NO-FAST-P9-NEXT: fcmpu cr0, f1, f2 -; NO-FAST-P9-NEXT: blt cr0, .LBB12_2 -; NO-FAST-P9-NEXT: # %bb.1: # %entry -; NO-FAST-P9-NEXT: fmr f3, f4 -; NO-FAST-P9-NEXT: .LBB12_2: # %entry -; NO-FAST-P9-NEXT: fmr f1, f3 -; NO-FAST-P9-NEXT: blr +; P8-LABEL: select_olt_float: +; P8: # %bb.0: # %entry +; P8-NEXT: fcmpu cr0, f1, f2 +; P8-NEXT: fmr f1, f3 +; P8-NEXT: bltlr cr0 +; P8-NEXT: # %bb.1: # %entry +; P8-NEXT: fmr f1, f4 +; P8-NEXT: blr +; +; P9-LABEL: select_olt_float: +; P9: # %bb.0: # %entry +; P9-NEXT: fcmpu cr0, f1, f2 +; P9-NEXT: blt cr0, .LBB12_2 +; P9-NEXT: # %bb.1: # %entry +; P9-NEXT: fmr f3, f4 +; P9-NEXT: .LBB12_2: # %entry +; P9-NEXT: fmr f1, f3 +; P9-NEXT: blr entry: %cmp = fcmp olt float %a, %b %cond = select i1 %cmp, float %c, float %d @@ -545,36 +321,24 @@ } define double @select_olt_double(double %a, double %b, double %c, double %d) { -; FAST-P8-LABEL: select_olt_double: -; FAST-P8: # %bb.0: # %entry -; FAST-P8-NEXT: xssubdp f0, f1, f2 -; FAST-P8-NEXT: fsel f1, f0, f4, f3 -; FAST-P8-NEXT: blr -; -; FAST-P9-LABEL: select_olt_double: -; FAST-P9: # %bb.0: # %entry -; FAST-P9-NEXT: xssubdp f0, f1, f2 -; FAST-P9-NEXT: fsel f1, f0, f4, f3 -; FAST-P9-NEXT: blr -; -; NO-FAST-P8-LABEL: select_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: blr -; -; NO-FAST-P9-LABEL: select_olt_double: -; NO-FAST-P9: # %bb.0: # %entry -; NO-FAST-P9-NEXT: xscmpudp cr0, f1, f2 -; NO-FAST-P9-NEXT: blt cr0, .LBB13_2 -; NO-FAST-P9-NEXT: # %bb.1: # %entry -; NO-FAST-P9-NEXT: fmr f3, f4 -; NO-FAST-P9-NEXT: .LBB13_2: # %entry -; NO-FAST-P9-NEXT: fmr f1, f3 -; NO-FAST-P9-NEXT: blr +; P8-LABEL: select_olt_double: +; P8: # %bb.0: # %entry +; P8-NEXT: xscmpudp cr0, f1, f2 +; P8-NEXT: fmr f1, f3 +; P8-NEXT: bltlr cr0 +; P8-NEXT: # %bb.1: # %entry +; P8-NEXT: fmr f1, f4 +; P8-NEXT: blr +; +; P9-LABEL: select_olt_double: +; P9: # %bb.0: # %entry +; P9-NEXT: xscmpudp cr0, f1, f2 +; P9-NEXT: blt cr0, .LBB13_2 +; P9-NEXT: # %bb.1: # %entry +; P9-NEXT: fmr f3, f4 +; P9-NEXT: .LBB13_2: # %entry +; P9-NEXT: fmr f1, f3 +; P9-NEXT: blr entry: %cmp = fcmp olt double %a, %b %cond = select i1 %cmp, double %c, double %d @@ -582,112 +346,62 @@ } define float @select_fast_olt_float(float %a, float %b, float %c, float %d) { -; FAST-P8-LABEL: select_fast_olt_float: -; FAST-P8: # %bb.0: # %entry -; FAST-P8-NEXT: xssubsp f0, f1, f2 -; FAST-P8-NEXT: fsel f1, f0, f4, f3 -; FAST-P8-NEXT: blr -; -; FAST-P9-LABEL: select_fast_olt_float: -; FAST-P9: # %bb.0: # %entry -; FAST-P9-NEXT: xssubsp f0, f1, f2 -; FAST-P9-NEXT: fsel f1, f0, f4, f3 -; FAST-P9-NEXT: blr -; -; 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: 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: blr +; P8-LABEL: select_fast_olt_float: +; P8: # %bb.0: # %entry +; P8-NEXT: xssubsp f0, f1, f2 +; P8-NEXT: fsel f1, f0, f4, f3 +; P8-NEXT: blr +; +; P9-LABEL: select_fast_olt_float: +; P9: # %bb.0: # %entry +; P9-NEXT: xssubsp f0, f1, f2 +; P9-NEXT: fsel f1, f0, f4, f3 +; P9-NEXT: blr entry: - %cmp = fcmp fast olt float %a, %b - %cond = select fast i1 %cmp, float %c, float %d + %cmp = fcmp nnan ninf olt float %a, %b + %cond = select nnan ninf i1 %cmp, float %c, float %d ret float %cond } define double @select_fast_olt_double(double %a, double %b, double %c, double %d) { -; FAST-P8-LABEL: select_fast_olt_double: -; FAST-P8: # %bb.0: # %entry -; FAST-P8-NEXT: xssubdp f0, f1, f2 -; FAST-P8-NEXT: fsel f1, f0, f4, f3 -; FAST-P8-NEXT: blr -; -; FAST-P9-LABEL: select_fast_olt_double: -; FAST-P9: # %bb.0: # %entry -; FAST-P9-NEXT: xssubdp f0, f1, f2 -; FAST-P9-NEXT: fsel f1, f0, f4, f3 -; FAST-P9-NEXT: blr -; -; 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: 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: blr +; P8-LABEL: select_fast_olt_double: +; P8: # %bb.0: # %entry +; P8-NEXT: xssubdp f0, f1, f2 +; P8-NEXT: fsel f1, f0, f4, f3 +; P8-NEXT: blr +; +; P9-LABEL: select_fast_olt_double: +; P9: # %bb.0: # %entry +; P9-NEXT: xssubdp f0, f1, f2 +; P9-NEXT: fsel f1, f0, f4, f3 +; P9-NEXT: blr entry: - %cmp = fcmp fast olt double %a, %b - %cond = select fast i1 %cmp, double %c, double %d + %cmp = fcmp nnan ninf olt double %a, %b + %cond = select nnan ninf i1 %cmp, double %c, double %d ret double %cond } ; Test ogt define float @select_ogt_float(float %a, float %b, float %c, float %d) { -; FAST-P8-LABEL: select_ogt_float: -; FAST-P8: # %bb.0: # %entry -; FAST-P8-NEXT: xssubsp f0, f2, f1 -; FAST-P8-NEXT: fsel f1, f0, f4, f3 -; FAST-P8-NEXT: blr -; -; FAST-P9-LABEL: select_ogt_float: -; FAST-P9: # %bb.0: # %entry -; FAST-P9-NEXT: xssubsp f0, f2, f1 -; FAST-P9-NEXT: fsel f1, f0, f4, f3 -; FAST-P9-NEXT: blr -; -; NO-FAST-P8-LABEL: select_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: blr -; -; NO-FAST-P9-LABEL: select_ogt_float: -; NO-FAST-P9: # %bb.0: # %entry -; NO-FAST-P9-NEXT: fcmpu cr0, f1, f2 -; NO-FAST-P9-NEXT: bgt cr0, .LBB16_2 -; NO-FAST-P9-NEXT: # %bb.1: # %entry -; NO-FAST-P9-NEXT: fmr f3, f4 -; NO-FAST-P9-NEXT: .LBB16_2: # %entry -; NO-FAST-P9-NEXT: fmr f1, f3 -; NO-FAST-P9-NEXT: blr +; P8-LABEL: select_ogt_float: +; P8: # %bb.0: # %entry +; P8-NEXT: fcmpu cr0, f1, f2 +; P8-NEXT: fmr f1, f3 +; P8-NEXT: bgtlr cr0 +; P8-NEXT: # %bb.1: # %entry +; P8-NEXT: fmr f1, f4 +; P8-NEXT: blr +; +; P9-LABEL: select_ogt_float: +; P9: # %bb.0: # %entry +; P9-NEXT: fcmpu cr0, f1, f2 +; P9-NEXT: bgt cr0, .LBB16_2 +; P9-NEXT: # %bb.1: # %entry +; P9-NEXT: fmr f3, f4 +; P9-NEXT: .LBB16_2: # %entry +; P9-NEXT: fmr f1, f3 +; P9-NEXT: blr entry: %cmp = fcmp ogt float %a, %b %cond = select i1 %cmp, float %c, float %d @@ -695,36 +409,24 @@ } define double @select_ogt_double(double %a, double %b, double %c, double %d) { -; FAST-P8-LABEL: select_ogt_double: -; FAST-P8: # %bb.0: # %entry -; FAST-P8-NEXT: xssubdp f0, f2, f1 -; FAST-P8-NEXT: fsel f1, f0, f4, f3 -; FAST-P8-NEXT: blr -; -; FAST-P9-LABEL: select_ogt_double: -; FAST-P9: # %bb.0: # %entry -; FAST-P9-NEXT: xssubdp f0, f2, f1 -; FAST-P9-NEXT: fsel f1, f0, f4, f3 -; FAST-P9-NEXT: blr -; -; NO-FAST-P8-LABEL: select_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: blr -; -; NO-FAST-P9-LABEL: select_ogt_double: -; NO-FAST-P9: # %bb.0: # %entry -; NO-FAST-P9-NEXT: xscmpudp cr0, f1, f2 -; NO-FAST-P9-NEXT: bgt cr0, .LBB17_2 -; NO-FAST-P9-NEXT: # %bb.1: # %entry -; NO-FAST-P9-NEXT: fmr f3, f4 -; NO-FAST-P9-NEXT: .LBB17_2: # %entry -; NO-FAST-P9-NEXT: fmr f1, f3 -; NO-FAST-P9-NEXT: blr +; P8-LABEL: select_ogt_double: +; P8: # %bb.0: # %entry +; P8-NEXT: xscmpudp cr0, f1, f2 +; P8-NEXT: fmr f1, f3 +; P8-NEXT: bgtlr cr0 +; P8-NEXT: # %bb.1: # %entry +; P8-NEXT: fmr f1, f4 +; P8-NEXT: blr +; +; P9-LABEL: select_ogt_double: +; P9: # %bb.0: # %entry +; P9-NEXT: xscmpudp cr0, f1, f2 +; P9-NEXT: bgt cr0, .LBB17_2 +; P9-NEXT: # %bb.1: # %entry +; P9-NEXT: fmr f3, f4 +; P9-NEXT: .LBB17_2: # %entry +; P9-NEXT: fmr f1, f3 +; P9-NEXT: blr entry: %cmp = fcmp ogt double %a, %b %cond = select i1 %cmp, double %c, double %d @@ -732,114 +434,64 @@ } define float @select_fast_ogt_float(float %a, float %b, float %c, float %d) { -; FAST-P8-LABEL: select_fast_ogt_float: -; FAST-P8: # %bb.0: # %entry -; FAST-P8-NEXT: xssubsp f0, f2, f1 -; FAST-P8-NEXT: fsel f1, f0, f4, f3 -; FAST-P8-NEXT: blr -; -; FAST-P9-LABEL: select_fast_ogt_float: -; FAST-P9: # %bb.0: # %entry -; FAST-P9-NEXT: xssubsp f0, f2, f1 -; FAST-P9-NEXT: fsel f1, f0, f4, f3 -; FAST-P9-NEXT: blr -; -; 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: 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: blr +; P8-LABEL: select_fast_ogt_float: +; P8: # %bb.0: # %entry +; P8-NEXT: xssubsp f0, f2, f1 +; P8-NEXT: fsel f1, f0, f4, f3 +; P8-NEXT: blr +; +; P9-LABEL: select_fast_ogt_float: +; P9: # %bb.0: # %entry +; P9-NEXT: xssubsp f0, f2, f1 +; P9-NEXT: fsel f1, f0, f4, f3 +; P9-NEXT: blr entry: - %cmp = fcmp fast ogt float %a, %b - %cond = select fast i1 %cmp, float %c, float %d + %cmp = fcmp nnan ninf ogt float %a, %b + %cond = select nnan ninf i1 %cmp, float %c, float %d ret float %cond } define double @select_fast_ogt_double(double %a, double %b, double %c, double %d) { -; FAST-P8-LABEL: select_fast_ogt_double: -; FAST-P8: # %bb.0: # %entry -; FAST-P8-NEXT: xssubdp f0, f2, f1 -; FAST-P8-NEXT: fsel f1, f0, f4, f3 -; FAST-P8-NEXT: blr -; -; FAST-P9-LABEL: select_fast_ogt_double: -; FAST-P9: # %bb.0: # %entry -; FAST-P9-NEXT: xssubdp f0, f2, f1 -; FAST-P9-NEXT: fsel f1, f0, f4, f3 -; FAST-P9-NEXT: blr -; -; 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: 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: blr +; P8-LABEL: select_fast_ogt_double: +; P8: # %bb.0: # %entry +; P8-NEXT: xssubdp f0, f2, f1 +; P8-NEXT: fsel f1, f0, f4, f3 +; P8-NEXT: blr +; +; P9-LABEL: select_fast_ogt_double: +; P9: # %bb.0: # %entry +; P9-NEXT: xssubdp f0, f2, f1 +; P9-NEXT: fsel f1, f0, f4, f3 +; P9-NEXT: blr entry: - %cmp = fcmp fast ogt double %a, %b - %cond = select fast i1 %cmp, double %c, double %d + %cmp = fcmp nnan ninf ogt double %a, %b + %cond = select nnan ninf i1 %cmp, double %c, double %d ret double %cond } ; Test ole define float @select_ole_float(float %a, float %b, float %c, float %d) { -; FAST-P8-LABEL: select_ole_float: -; FAST-P8: # %bb.0: # %entry -; FAST-P8-NEXT: xssubsp f0, f2, f1 -; FAST-P8-NEXT: fsel f1, f0, f3, f4 -; FAST-P8-NEXT: blr -; -; FAST-P9-LABEL: select_ole_float: -; FAST-P9: # %bb.0: # %entry -; FAST-P9-NEXT: xssubsp f0, f2, f1 -; FAST-P9-NEXT: fsel f1, f0, f3, f4 -; FAST-P9-NEXT: blr -; -; NO-FAST-P8-LABEL: select_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: crnor 4*cr5+lt, un, gt -; NO-FAST-P8-NEXT: bclr 12, 4*cr5+lt, 0 -; NO-FAST-P8-NEXT: # %bb.1: # %entry -; NO-FAST-P8-NEXT: fmr f1, f4 -; NO-FAST-P8-NEXT: blr -; -; NO-FAST-P9-LABEL: select_ole_float: -; NO-FAST-P9: # %bb.0: # %entry -; NO-FAST-P9-NEXT: fcmpu cr0, f1, f2 -; NO-FAST-P9-NEXT: crnor 4*cr5+lt, un, gt -; NO-FAST-P9-NEXT: bc 12, 4*cr5+lt, .LBB20_2 -; NO-FAST-P9-NEXT: # %bb.1: # %entry -; NO-FAST-P9-NEXT: fmr f3, f4 -; NO-FAST-P9-NEXT: .LBB20_2: # %entry -; NO-FAST-P9-NEXT: fmr f1, f3 -; NO-FAST-P9-NEXT: blr +; P8-LABEL: select_ole_float: +; P8: # %bb.0: # %entry +; P8-NEXT: fcmpu cr0, f1, f2 +; P8-NEXT: fmr f1, f3 +; P8-NEXT: crnor 4*cr5+lt, un, gt +; P8-NEXT: bclr 12, 4*cr5+lt, 0 +; P8-NEXT: # %bb.1: # %entry +; P8-NEXT: fmr f1, f4 +; P8-NEXT: blr +; +; P9-LABEL: select_ole_float: +; P9: # %bb.0: # %entry +; P9-NEXT: fcmpu cr0, f1, f2 +; P9-NEXT: crnor 4*cr5+lt, un, gt +; P9-NEXT: bc 12, 4*cr5+lt, .LBB20_2 +; P9-NEXT: # %bb.1: # %entry +; P9-NEXT: fmr f3, f4 +; P9-NEXT: .LBB20_2: # %entry +; P9-NEXT: fmr f1, f3 +; P9-NEXT: blr entry: %cmp = fcmp ole float %a, %b %cond = select i1 %cmp, float %c, float %d @@ -847,38 +499,26 @@ } define double @select_ole_double(double %a, double %b, double %c, double %d) { -; FAST-P8-LABEL: select_ole_double: -; FAST-P8: # %bb.0: # %entry -; FAST-P8-NEXT: xssubdp f0, f2, f1 -; FAST-P8-NEXT: fsel f1, f0, f3, f4 -; FAST-P8-NEXT: blr -; -; FAST-P9-LABEL: select_ole_double: -; FAST-P9: # %bb.0: # %entry -; FAST-P9-NEXT: xssubdp f0, f2, f1 -; FAST-P9-NEXT: fsel f1, f0, f3, f4 -; FAST-P9-NEXT: blr -; -; NO-FAST-P8-LABEL: select_ole_double: -; 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: crnor 4*cr5+lt, un, gt -; NO-FAST-P8-NEXT: bclr 12, 4*cr5+lt, 0 -; NO-FAST-P8-NEXT: # %bb.1: # %entry -; NO-FAST-P8-NEXT: fmr f1, f4 -; NO-FAST-P8-NEXT: blr -; -; NO-FAST-P9-LABEL: select_ole_double: -; NO-FAST-P9: # %bb.0: # %entry -; NO-FAST-P9-NEXT: fcmpu cr0, f1, f2 -; NO-FAST-P9-NEXT: crnor 4*cr5+lt, un, gt -; NO-FAST-P9-NEXT: bc 12, 4*cr5+lt, .LBB21_2 -; NO-FAST-P9-NEXT: # %bb.1: # %entry -; NO-FAST-P9-NEXT: fmr f3, f4 -; NO-FAST-P9-NEXT: .LBB21_2: # %entry -; NO-FAST-P9-NEXT: fmr f1, f3 -; NO-FAST-P9-NEXT: blr +; P8-LABEL: select_ole_double: +; P8: # %bb.0: # %entry +; P8-NEXT: fcmpu cr0, f1, f2 +; P8-NEXT: fmr f1, f3 +; P8-NEXT: crnor 4*cr5+lt, un, gt +; P8-NEXT: bclr 12, 4*cr5+lt, 0 +; P8-NEXT: # %bb.1: # %entry +; P8-NEXT: fmr f1, f4 +; P8-NEXT: blr +; +; P9-LABEL: select_ole_double: +; P9: # %bb.0: # %entry +; P9-NEXT: fcmpu cr0, f1, f2 +; P9-NEXT: crnor 4*cr5+lt, un, gt +; P9-NEXT: bc 12, 4*cr5+lt, .LBB21_2 +; P9-NEXT: # %bb.1: # %entry +; P9-NEXT: fmr f3, f4 +; P9-NEXT: .LBB21_2: # %entry +; P9-NEXT: fmr f1, f3 +; P9-NEXT: blr entry: %cmp = fcmp ole double %a, %b %cond = select i1 %cmp, double %c, double %d @@ -886,122 +526,68 @@ } define float @select_fast_ole_float(float %a, float %b, float %c, float %d) { -; FAST-P8-LABEL: select_fast_ole_float: -; FAST-P8: # %bb.0: # %entry -; FAST-P8-NEXT: xssubsp f0, f2, f1 -; FAST-P8-NEXT: fsel f1, f0, f3, f4 -; FAST-P8-NEXT: blr -; -; FAST-P9-LABEL: select_fast_ole_float: -; FAST-P9: # %bb.0: # %entry -; FAST-P9-NEXT: xssubsp f0, f2, f1 -; FAST-P9-NEXT: fsel f1, f0, f3, f4 -; FAST-P9-NEXT: blr -; -; 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: 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: blr +; P8-LABEL: select_fast_ole_float: +; P8: # %bb.0: # %entry +; P8-NEXT: xssubsp f0, f2, f1 +; P8-NEXT: fsel f1, f0, f3, f4 +; P8-NEXT: blr +; +; P9-LABEL: select_fast_ole_float: +; P9: # %bb.0: # %entry +; P9-NEXT: xssubsp f0, f2, f1 +; P9-NEXT: fsel f1, f0, f3, f4 +; P9-NEXT: blr entry: - %cmp = fcmp fast ole float %a, %b - %cond = select fast i1 %cmp, float %c, float %d + %cmp = fcmp nnan ninf ole float %a, %b + %cond = select nnan ninf i1 %cmp, float %c, float %d ret float %cond } define double @select_fast_ole_double(double %a, double %b, double %c, double %d) { -; FAST-P8-LABEL: select_fast_ole_double: -; FAST-P8: # %bb.0: # %entry -; FAST-P8-NEXT: xssubdp f0, f2, f1 -; FAST-P8-NEXT: fsel f1, f0, f3, f4 -; FAST-P8-NEXT: blr -; -; FAST-P9-LABEL: select_fast_ole_double: -; FAST-P9: # %bb.0: # %entry -; FAST-P9-NEXT: xssubdp f0, f2, f1 -; FAST-P9-NEXT: fsel f1, f0, f3, f4 -; FAST-P9-NEXT: blr -; -; 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: 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: blr +; P8-LABEL: select_fast_ole_double: +; P8: # %bb.0: # %entry +; P8-NEXT: xssubdp f0, f2, f1 +; P8-NEXT: fsel f1, f0, f3, f4 +; P8-NEXT: blr +; +; P9-LABEL: select_fast_ole_double: +; P9: # %bb.0: # %entry +; P9-NEXT: xssubdp f0, f2, f1 +; P9-NEXT: fsel f1, f0, f3, f4 +; P9-NEXT: blr entry: - %cmp = fcmp fast ole double %a, %b - %cond = select fast i1 %cmp, double %c, double %d + %cmp = fcmp nnan ninf ole double %a, %b + %cond = select nnan ninf i1 %cmp, double %c, double %d ret double %cond } ; Test RHS is 1.000000e+00 define double @onecmp1(double %a, double %y, double %z) { -; FAST-P8-LABEL: onecmp1: -; FAST-P8: # %bb.0: # %entry -; FAST-P8-NEXT: addis r3, r2, .LCPI24_0@toc@ha -; FAST-P8-NEXT: lfs f0, .LCPI24_0@toc@l(r3) -; FAST-P8-NEXT: xssubdp f0, f1, f0 -; FAST-P8-NEXT: fsel f1, f0, f2, f3 -; FAST-P8-NEXT: blr -; -; FAST-P9-LABEL: onecmp1: -; FAST-P9: # %bb.0: # %entry -; FAST-P9-NEXT: addis r3, r2, .LCPI24_0@toc@ha -; FAST-P9-NEXT: lfs f0, .LCPI24_0@toc@l(r3) -; FAST-P9-NEXT: xssubdp f0, f1, f0 -; FAST-P9-NEXT: fsel f1, f0, f2, f3 -; FAST-P9-NEXT: blr -; -; NO-FAST-P8-LABEL: onecmp1: -; NO-FAST-P8: # %bb.0: # %entry -; NO-FAST-P8-NEXT: addis r3, r2, .LCPI24_0@toc@ha -; NO-FAST-P8-NEXT: lfs f0, .LCPI24_0@toc@l(r3) -; NO-FAST-P8-NEXT: fcmpu cr0, f1, f0 -; NO-FAST-P8-NEXT: cror 4*cr5+lt, lt, un -; NO-FAST-P8-NEXT: bc 12, 4*cr5+lt, .LBB24_2 -; NO-FAST-P8-NEXT: # %bb.1: # %entry -; NO-FAST-P8-NEXT: fmr f3, f2 -; NO-FAST-P8-NEXT: .LBB24_2: # %entry -; NO-FAST-P8-NEXT: fmr f1, f3 -; NO-FAST-P8-NEXT: blr -; -; NO-FAST-P9-LABEL: onecmp1: -; NO-FAST-P9: # %bb.0: # %entry -; NO-FAST-P9-NEXT: addis r3, r2, .LCPI24_0@toc@ha -; NO-FAST-P9-NEXT: lfs f0, .LCPI24_0@toc@l(r3) -; NO-FAST-P9-NEXT: fcmpu cr0, f1, f0 -; NO-FAST-P9-NEXT: cror 4*cr5+lt, lt, un -; NO-FAST-P9-NEXT: bc 12, 4*cr5+lt, .LBB24_2 -; NO-FAST-P9-NEXT: # %bb.1: # %entry -; NO-FAST-P9-NEXT: fmr f3, f2 -; NO-FAST-P9-NEXT: .LBB24_2: # %entry -; NO-FAST-P9-NEXT: fmr f1, f3 -; NO-FAST-P9-NEXT: blr +; P8-LABEL: onecmp1: +; P8: # %bb.0: # %entry +; P8-NEXT: addis r3, r2, .LCPI24_0@toc@ha +; P8-NEXT: lfs f0, .LCPI24_0@toc@l(r3) +; P8-NEXT: fcmpu cr0, f1, f0 +; P8-NEXT: cror 4*cr5+lt, lt, un +; P8-NEXT: bc 12, 4*cr5+lt, .LBB24_2 +; P8-NEXT: # %bb.1: # %entry +; P8-NEXT: fmr f3, f2 +; P8-NEXT: .LBB24_2: # %entry +; P8-NEXT: fmr f1, f3 +; P8-NEXT: blr +; +; P9-LABEL: onecmp1: +; P9: # %bb.0: # %entry +; P9-NEXT: addis r3, r2, .LCPI24_0@toc@ha +; P9-NEXT: lfs f0, .LCPI24_0@toc@l(r3) +; P9-NEXT: fcmpu cr0, f1, f0 +; P9-NEXT: cror 4*cr5+lt, lt, un +; P9-NEXT: bc 12, 4*cr5+lt, .LBB24_2 +; P9-NEXT: # %bb.1: # %entry +; P9-NEXT: fmr f3, f2 +; P9-NEXT: .LBB24_2: # %entry +; P9-NEXT: fmr f1, f3 +; P9-NEXT: blr entry: %cmp = fcmp ult double %a, 1.000000e+00 %z.y = select i1 %cmp, double %z, double %y @@ -1009,44 +595,28 @@ } define double @onecmp2(double %a, double %y, double %z) { -; FAST-P8-LABEL: onecmp2: -; FAST-P8: # %bb.0: # %entry -; FAST-P8-NEXT: addis r3, r2, .LCPI25_0@toc@ha -; FAST-P8-NEXT: lfs f0, .LCPI25_0@toc@l(r3) -; FAST-P8-NEXT: xssubdp f0, f0, f1 -; FAST-P8-NEXT: fsel f1, f0, f3, f2 -; FAST-P8-NEXT: blr -; -; FAST-P9-LABEL: onecmp2: -; FAST-P9: # %bb.0: # %entry -; FAST-P9-NEXT: addis r3, r2, .LCPI25_0@toc@ha -; FAST-P9-NEXT: lfs f0, .LCPI25_0@toc@l(r3) -; FAST-P9-NEXT: xssubdp f0, f0, f1 -; FAST-P9-NEXT: fsel f1, f0, f3, f2 -; FAST-P9-NEXT: blr -; -; NO-FAST-P8-LABEL: onecmp2: -; NO-FAST-P8: # %bb.0: # %entry -; NO-FAST-P8-NEXT: addis r3, r2, .LCPI25_0@toc@ha -; NO-FAST-P8-NEXT: lfs f0, .LCPI25_0@toc@l(r3) -; NO-FAST-P8-NEXT: xscmpudp cr0, f1, f0 -; NO-FAST-P8-NEXT: fmr f1, f2 -; NO-FAST-P8-NEXT: bgtlr cr0 -; NO-FAST-P8-NEXT: # %bb.1: # %entry -; NO-FAST-P8-NEXT: fmr f1, f3 -; NO-FAST-P8-NEXT: blr -; -; NO-FAST-P9-LABEL: onecmp2: -; NO-FAST-P9: # %bb.0: # %entry -; NO-FAST-P9-NEXT: addis r3, r2, .LCPI25_0@toc@ha -; NO-FAST-P9-NEXT: lfs f0, .LCPI25_0@toc@l(r3) -; NO-FAST-P9-NEXT: xscmpudp cr0, f1, f0 -; NO-FAST-P9-NEXT: bgt cr0, .LBB25_2 -; NO-FAST-P9-NEXT: # %bb.1: # %entry -; NO-FAST-P9-NEXT: fmr f2, f3 -; NO-FAST-P9-NEXT: .LBB25_2: # %entry -; NO-FAST-P9-NEXT: fmr f1, f2 -; NO-FAST-P9-NEXT: blr +; P8-LABEL: onecmp2: +; P8: # %bb.0: # %entry +; P8-NEXT: addis r3, r2, .LCPI25_0@toc@ha +; P8-NEXT: lfs f0, .LCPI25_0@toc@l(r3) +; P8-NEXT: xscmpudp cr0, f1, f0 +; P8-NEXT: fmr f1, f2 +; P8-NEXT: bgtlr cr0 +; P8-NEXT: # %bb.1: # %entry +; P8-NEXT: fmr f1, f3 +; P8-NEXT: blr +; +; P9-LABEL: onecmp2: +; P9: # %bb.0: # %entry +; P9-NEXT: addis r3, r2, .LCPI25_0@toc@ha +; P9-NEXT: lfs f0, .LCPI25_0@toc@l(r3) +; P9-NEXT: xscmpudp cr0, f1, f0 +; P9-NEXT: bgt cr0, .LBB25_2 +; P9-NEXT: # %bb.1: # %entry +; P9-NEXT: fmr f2, f3 +; P9-NEXT: .LBB25_2: # %entry +; P9-NEXT: fmr f1, f2 +; P9-NEXT: blr entry: %cmp = fcmp ogt double %a, 1.000000e+00 %y.z = select i1 %cmp, double %y, double %z @@ -1054,48 +624,28 @@ } define double @onecmp3(double %a, double %y, double %z) { -; FAST-P8-LABEL: onecmp3: -; FAST-P8: # %bb.0: # %entry -; FAST-P8-NEXT: addis r3, r2, .LCPI26_0@toc@ha -; FAST-P8-NEXT: lfs f0, .LCPI26_0@toc@l(r3) -; FAST-P8-NEXT: xssubdp f0, f1, f0 -; FAST-P8-NEXT: xsnegdp f1, f0 -; FAST-P8-NEXT: fsel f0, f0, f2, f3 -; FAST-P8-NEXT: fsel f1, f1, f0, f3 -; FAST-P8-NEXT: blr -; -; FAST-P9-LABEL: onecmp3: -; FAST-P9: # %bb.0: # %entry -; FAST-P9-NEXT: addis r3, r2, .LCPI26_0@toc@ha -; FAST-P9-NEXT: lfs f0, .LCPI26_0@toc@l(r3) -; FAST-P9-NEXT: xssubdp f0, f1, f0 -; FAST-P9-NEXT: fsel f1, f0, f2, f3 -; FAST-P9-NEXT: xsnegdp f0, f0 -; FAST-P9-NEXT: fsel f1, f0, f1, f3 -; FAST-P9-NEXT: blr -; -; NO-FAST-P8-LABEL: onecmp3: -; NO-FAST-P8: # %bb.0: # %entry -; NO-FAST-P8-NEXT: addis r3, r2, .LCPI26_0@toc@ha -; NO-FAST-P8-NEXT: lfs f0, .LCPI26_0@toc@l(r3) -; NO-FAST-P8-NEXT: xscmpudp cr0, f1, f0 -; NO-FAST-P8-NEXT: fmr f1, f2 -; NO-FAST-P8-NEXT: beqlr cr0 -; NO-FAST-P8-NEXT: # %bb.1: # %entry -; NO-FAST-P8-NEXT: fmr f1, f3 -; NO-FAST-P8-NEXT: blr -; -; NO-FAST-P9-LABEL: onecmp3: -; NO-FAST-P9: # %bb.0: # %entry -; NO-FAST-P9-NEXT: addis r3, r2, .LCPI26_0@toc@ha -; NO-FAST-P9-NEXT: lfs f0, .LCPI26_0@toc@l(r3) -; NO-FAST-P9-NEXT: xscmpudp cr0, f1, f0 -; NO-FAST-P9-NEXT: beq cr0, .LBB26_2 -; NO-FAST-P9-NEXT: # %bb.1: # %entry -; NO-FAST-P9-NEXT: fmr f2, f3 -; NO-FAST-P9-NEXT: .LBB26_2: # %entry -; NO-FAST-P9-NEXT: fmr f1, f2 -; NO-FAST-P9-NEXT: blr +; P8-LABEL: onecmp3: +; P8: # %bb.0: # %entry +; P8-NEXT: addis r3, r2, .LCPI26_0@toc@ha +; P8-NEXT: lfs f0, .LCPI26_0@toc@l(r3) +; P8-NEXT: xscmpudp cr0, f1, f0 +; P8-NEXT: fmr f1, f2 +; P8-NEXT: beqlr cr0 +; P8-NEXT: # %bb.1: # %entry +; P8-NEXT: fmr f1, f3 +; P8-NEXT: blr +; +; P9-LABEL: onecmp3: +; P9: # %bb.0: # %entry +; P9-NEXT: addis r3, r2, .LCPI26_0@toc@ha +; P9-NEXT: lfs f0, .LCPI26_0@toc@l(r3) +; P9-NEXT: xscmpudp cr0, f1, f0 +; P9-NEXT: beq cr0, .LBB26_2 +; P9-NEXT: # %bb.1: # %entry +; P9-NEXT: fmr f2, f3 +; P9-NEXT: .LBB26_2: # %entry +; P9-NEXT: fmr f1, f2 +; P9-NEXT: blr entry: %cmp = fcmp oeq double %a, 1.000000e+00 %y.z = select i1 %cmp, double %y, double %z