llvm-project/llvm/test/CodeGen/PowerPC/scalar_cmp.ll

1104 lines
35 KiB
LLVM

; 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: llc -mcpu=pwr9 -ppc-asm-full-reg-names -verify-machineinstrs \
; RUN: -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s \
; RUN: --check-prefix=NO-FAST-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
entry:
%cmp = fcmp oeq float %a, %b
%cond = select i1 %cmp, float %c, float %d
ret float %cond
}
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
entry:
%cmp = fcmp oeq double %a, %b
%cond = select i1 %cmp, double %c, double %d
ret double %cond
}
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
entry:
%cmp = fcmp fast oeq float %a, %b
%cond = select fast 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
entry:
%cmp = fcmp fast oeq double %a, %b
%cond = select fast 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
entry:
%cmp = fcmp one float %a, %b
%cond = select i1 %cmp, float %c, float %d
ret float %cond
}
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
entry:
%cmp = fcmp one double %a, %b
%cond = select i1 %cmp, double %c, double %d
ret double %cond
}
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
entry:
%cmp = fcmp fast one float %a, %b
%cond = select fast 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
entry:
%cmp = fcmp fast one double %a, %b
%cond = select fast 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
entry:
%cmp = fcmp oge float %a, %b
%cond = select i1 %cmp, float %c, float %d
ret float %cond
}
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
entry:
%cmp = fcmp oge double %a, %b
%cond = select i1 %cmp, double %c, double %d
ret double %cond
}
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
entry:
%cmp = fcmp fast oge float %a, %b
%cond = select fast 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
entry:
%cmp = fcmp fast oge double %a, %b
%cond = select fast 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
entry:
%cmp = fcmp olt float %a, %b
%cond = select i1 %cmp, float %c, float %d
ret float %cond
}
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
entry:
%cmp = fcmp olt double %a, %b
%cond = select i1 %cmp, double %c, double %d
ret double %cond
}
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
entry:
%cmp = fcmp fast olt float %a, %b
%cond = select fast 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
entry:
%cmp = fcmp fast olt double %a, %b
%cond = select fast 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
entry:
%cmp = fcmp ogt float %a, %b
%cond = select i1 %cmp, float %c, float %d
ret float %cond
}
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
entry:
%cmp = fcmp ogt double %a, %b
%cond = select i1 %cmp, double %c, double %d
ret double %cond
}
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
entry:
%cmp = fcmp fast ogt float %a, %b
%cond = select fast 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
entry:
%cmp = fcmp fast ogt double %a, %b
%cond = select fast 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
entry:
%cmp = fcmp ole float %a, %b
%cond = select i1 %cmp, float %c, float %d
ret float %cond
}
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
entry:
%cmp = fcmp ole double %a, %b
%cond = select i1 %cmp, double %c, double %d
ret double %cond
}
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
entry:
%cmp = fcmp fast ole float %a, %b
%cond = select fast 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
entry:
%cmp = fcmp fast ole double %a, %b
%cond = select fast 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
entry:
%cmp = fcmp ult double %a, 1.000000e+00
%z.y = select i1 %cmp, double %z, double %y
ret double %z.y
}
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
entry:
%cmp = fcmp ogt double %a, 1.000000e+00
%y.z = select i1 %cmp, double %y, double %z
ret double %y.z
}
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
entry:
%cmp = fcmp oeq double %a, 1.000000e+00
%y.z = select i1 %cmp, double %y, double %z
ret double %y.z
}