mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
2b68172fec
A lot of tests under PowerPC are using fast flag, while fast is just alias of 7 fast-math flags. This change makes test points clearer. mc-instrlat.ll and sms-iterator.ll keeps unchanged since they are not testing fast-math behavior. (one for machine combiner crash, one for machine pipeliner bug) Reviewed By: steven.zhang, spatel Differential Revision: https://reviews.llvm.org/D78989
1036 lines
32 KiB
LLVM
1036 lines
32 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: 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: 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 nnan ninf nsz oeq float %a, %b
|
|
%cond = select 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: 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: 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 nnan ninf nsz oeq double %a, %b
|
|
%cond = select 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: 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: 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 nnan ninf nsz one float %a, %b
|
|
%cond = select 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: 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: 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 nnan ninf nsz one double %a, %b
|
|
%cond = select 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: 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: xssubsp f0, f1, f2
|
|
; NO-FAST-P9-NEXT: fsel f1, f0, f3, f4
|
|
; NO-FAST-P9-NEXT: blr
|
|
entry:
|
|
%cmp = fcmp nnan ninf nsz oge float %a, %b
|
|
%cond = select 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: 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: xssubdp f0, f1, f2
|
|
; NO-FAST-P9-NEXT: fsel f1, f0, f3, f4
|
|
; NO-FAST-P9-NEXT: blr
|
|
entry:
|
|
%cmp = fcmp nnan ninf nsz oge double %a, %b
|
|
%cond = select 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: 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: xssubsp f0, f1, f2
|
|
; NO-FAST-P9-NEXT: fsel f1, f0, f4, f3
|
|
; NO-FAST-P9-NEXT: blr
|
|
entry:
|
|
%cmp = fcmp ninf nnan nsz olt float %a, %b
|
|
%cond = select 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: 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: xssubdp f0, f1, f2
|
|
; NO-FAST-P9-NEXT: fsel f1, f0, f4, f3
|
|
; NO-FAST-P9-NEXT: blr
|
|
entry:
|
|
%cmp = fcmp nnan ninf nsz olt double %a, %b
|
|
%cond = select 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: 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: xssubsp f0, f2, f1
|
|
; NO-FAST-P9-NEXT: fsel f1, f0, f4, f3
|
|
; NO-FAST-P9-NEXT: blr
|
|
entry:
|
|
%cmp = fcmp nnan ninf nsz ogt float %a, %b
|
|
%cond = select 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: 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: xssubdp f0, f2, f1
|
|
; NO-FAST-P9-NEXT: fsel f1, f0, f4, f3
|
|
; NO-FAST-P9-NEXT: blr
|
|
entry:
|
|
%cmp = fcmp nnan ninf nsz ogt double %a, %b
|
|
%cond = select 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: 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: xssubsp f0, f2, f1
|
|
; NO-FAST-P9-NEXT: fsel f1, f0, f3, f4
|
|
; NO-FAST-P9-NEXT: blr
|
|
entry:
|
|
%cmp = fcmp nnan ninf nsz ole float %a, %b
|
|
%cond = select 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: 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: xssubdp f0, f2, f1
|
|
; NO-FAST-P9-NEXT: fsel f1, f0, f3, f4
|
|
; NO-FAST-P9-NEXT: blr
|
|
entry:
|
|
%cmp = fcmp nnan ninf nsz ole double %a, %b
|
|
%cond = select 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
|
|
}
|