2017-06-13 01:31:36 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
2016-11-16 06:42:20 +08:00
|
|
|
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=sse4.2 | FileCheck %s
|
X86: Turn fp selects into mask operations.
double test(double a, double b, double c, double d) { return a<b ? c : d; }
before:
_test:
ucomisd %xmm0, %xmm1
ja LBB0_2
movaps %xmm3, %xmm2
LBB0_2:
movaps %xmm2, %xmm0
after:
_test:
cmpltsd %xmm1, %xmm0
andpd %xmm0, %xmm2
andnpd %xmm3, %xmm0
orpd %xmm2, %xmm0
Small speedup on Benchmarks/SmallPT
llvm-svn: 187706
2013-08-04 20:05:16 +08:00
|
|
|
|
|
|
|
define double @test1(double %a, double %b, double %eps) {
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-LABEL: test1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-NEXT: cmpltsd %xmm2, %xmm0
|
2017-02-26 14:45:59 +08:00
|
|
|
; CHECK-NEXT: andpd %xmm1, %xmm0
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-NEXT: retq
|
X86: Turn fp selects into mask operations.
double test(double a, double b, double c, double d) { return a<b ? c : d; }
before:
_test:
ucomisd %xmm0, %xmm1
ja LBB0_2
movaps %xmm3, %xmm2
LBB0_2:
movaps %xmm2, %xmm0
after:
_test:
cmpltsd %xmm1, %xmm0
andpd %xmm0, %xmm2
andnpd %xmm3, %xmm0
orpd %xmm2, %xmm0
Small speedup on Benchmarks/SmallPT
llvm-svn: 187706
2013-08-04 20:05:16 +08:00
|
|
|
%cmp = fcmp olt double %a, %eps
|
|
|
|
%cond = select i1 %cmp, double %b, double 0.000000e+00
|
|
|
|
ret double %cond
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @test2(double %a, double %b, double %eps) {
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-LABEL: test2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-NEXT: cmplesd %xmm2, %xmm0
|
2017-02-26 14:45:59 +08:00
|
|
|
; CHECK-NEXT: andpd %xmm1, %xmm0
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-NEXT: retq
|
X86: Turn fp selects into mask operations.
double test(double a, double b, double c, double d) { return a<b ? c : d; }
before:
_test:
ucomisd %xmm0, %xmm1
ja LBB0_2
movaps %xmm3, %xmm2
LBB0_2:
movaps %xmm2, %xmm0
after:
_test:
cmpltsd %xmm1, %xmm0
andpd %xmm0, %xmm2
andnpd %xmm3, %xmm0
orpd %xmm2, %xmm0
Small speedup on Benchmarks/SmallPT
llvm-svn: 187706
2013-08-04 20:05:16 +08:00
|
|
|
%cmp = fcmp ole double %a, %eps
|
|
|
|
%cond = select i1 %cmp, double %b, double 0.000000e+00
|
|
|
|
ret double %cond
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @test3(double %a, double %b, double %eps) {
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-LABEL: test3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-NEXT: cmpltsd %xmm0, %xmm2
|
2017-02-26 14:45:59 +08:00
|
|
|
; CHECK-NEXT: andpd %xmm1, %xmm2
|
|
|
|
; CHECK-NEXT: movapd %xmm2, %xmm0
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-NEXT: retq
|
X86: Turn fp selects into mask operations.
double test(double a, double b, double c, double d) { return a<b ? c : d; }
before:
_test:
ucomisd %xmm0, %xmm1
ja LBB0_2
movaps %xmm3, %xmm2
LBB0_2:
movaps %xmm2, %xmm0
after:
_test:
cmpltsd %xmm1, %xmm0
andpd %xmm0, %xmm2
andnpd %xmm3, %xmm0
orpd %xmm2, %xmm0
Small speedup on Benchmarks/SmallPT
llvm-svn: 187706
2013-08-04 20:05:16 +08:00
|
|
|
%cmp = fcmp ogt double %a, %eps
|
|
|
|
%cond = select i1 %cmp, double %b, double 0.000000e+00
|
|
|
|
ret double %cond
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @test4(double %a, double %b, double %eps) {
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-LABEL: test4:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-NEXT: cmplesd %xmm0, %xmm2
|
2017-02-26 14:45:59 +08:00
|
|
|
; CHECK-NEXT: andpd %xmm1, %xmm2
|
|
|
|
; CHECK-NEXT: movapd %xmm2, %xmm0
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-NEXT: retq
|
X86: Turn fp selects into mask operations.
double test(double a, double b, double c, double d) { return a<b ? c : d; }
before:
_test:
ucomisd %xmm0, %xmm1
ja LBB0_2
movaps %xmm3, %xmm2
LBB0_2:
movaps %xmm2, %xmm0
after:
_test:
cmpltsd %xmm1, %xmm0
andpd %xmm0, %xmm2
andnpd %xmm3, %xmm0
orpd %xmm2, %xmm0
Small speedup on Benchmarks/SmallPT
llvm-svn: 187706
2013-08-04 20:05:16 +08:00
|
|
|
%cmp = fcmp oge double %a, %eps
|
|
|
|
%cond = select i1 %cmp, double %b, double 0.000000e+00
|
|
|
|
ret double %cond
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @test5(double %a, double %b, double %eps) {
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-LABEL: test5:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-NEXT: cmpltsd %xmm2, %xmm0
|
2017-02-26 14:45:59 +08:00
|
|
|
; CHECK-NEXT: andnpd %xmm1, %xmm0
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-NEXT: retq
|
X86: Turn fp selects into mask operations.
double test(double a, double b, double c, double d) { return a<b ? c : d; }
before:
_test:
ucomisd %xmm0, %xmm1
ja LBB0_2
movaps %xmm3, %xmm2
LBB0_2:
movaps %xmm2, %xmm0
after:
_test:
cmpltsd %xmm1, %xmm0
andpd %xmm0, %xmm2
andnpd %xmm3, %xmm0
orpd %xmm2, %xmm0
Small speedup on Benchmarks/SmallPT
llvm-svn: 187706
2013-08-04 20:05:16 +08:00
|
|
|
%cmp = fcmp olt double %a, %eps
|
|
|
|
%cond = select i1 %cmp, double 0.000000e+00, double %b
|
|
|
|
ret double %cond
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @test6(double %a, double %b, double %eps) {
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-LABEL: test6:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-NEXT: cmplesd %xmm2, %xmm0
|
2017-02-26 14:45:59 +08:00
|
|
|
; CHECK-NEXT: andnpd %xmm1, %xmm0
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-NEXT: retq
|
X86: Turn fp selects into mask operations.
double test(double a, double b, double c, double d) { return a<b ? c : d; }
before:
_test:
ucomisd %xmm0, %xmm1
ja LBB0_2
movaps %xmm3, %xmm2
LBB0_2:
movaps %xmm2, %xmm0
after:
_test:
cmpltsd %xmm1, %xmm0
andpd %xmm0, %xmm2
andnpd %xmm3, %xmm0
orpd %xmm2, %xmm0
Small speedup on Benchmarks/SmallPT
llvm-svn: 187706
2013-08-04 20:05:16 +08:00
|
|
|
%cmp = fcmp ole double %a, %eps
|
|
|
|
%cond = select i1 %cmp, double 0.000000e+00, double %b
|
|
|
|
ret double %cond
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @test7(double %a, double %b, double %eps) {
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-LABEL: test7:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-NEXT: cmpltsd %xmm0, %xmm2
|
2017-02-26 14:45:59 +08:00
|
|
|
; CHECK-NEXT: andnpd %xmm1, %xmm2
|
|
|
|
; CHECK-NEXT: movapd %xmm2, %xmm0
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-NEXT: retq
|
X86: Turn fp selects into mask operations.
double test(double a, double b, double c, double d) { return a<b ? c : d; }
before:
_test:
ucomisd %xmm0, %xmm1
ja LBB0_2
movaps %xmm3, %xmm2
LBB0_2:
movaps %xmm2, %xmm0
after:
_test:
cmpltsd %xmm1, %xmm0
andpd %xmm0, %xmm2
andnpd %xmm3, %xmm0
orpd %xmm2, %xmm0
Small speedup on Benchmarks/SmallPT
llvm-svn: 187706
2013-08-04 20:05:16 +08:00
|
|
|
%cmp = fcmp ogt double %a, %eps
|
|
|
|
%cond = select i1 %cmp, double 0.000000e+00, double %b
|
|
|
|
ret double %cond
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @test8(double %a, double %b, double %eps) {
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-LABEL: test8:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-NEXT: cmplesd %xmm0, %xmm2
|
2017-02-26 14:45:59 +08:00
|
|
|
; CHECK-NEXT: andnpd %xmm1, %xmm2
|
|
|
|
; CHECK-NEXT: movapd %xmm2, %xmm0
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-NEXT: retq
|
X86: Turn fp selects into mask operations.
double test(double a, double b, double c, double d) { return a<b ? c : d; }
before:
_test:
ucomisd %xmm0, %xmm1
ja LBB0_2
movaps %xmm3, %xmm2
LBB0_2:
movaps %xmm2, %xmm0
after:
_test:
cmpltsd %xmm1, %xmm0
andpd %xmm0, %xmm2
andnpd %xmm3, %xmm0
orpd %xmm2, %xmm0
Small speedup on Benchmarks/SmallPT
llvm-svn: 187706
2013-08-04 20:05:16 +08:00
|
|
|
%cmp = fcmp oge double %a, %eps
|
|
|
|
%cond = select i1 %cmp, double 0.000000e+00, double %b
|
|
|
|
ret double %cond
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @test9(float %a, float %b, float %eps) {
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-LABEL: test9:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-NEXT: cmpltss %xmm2, %xmm0
|
|
|
|
; CHECK-NEXT: andps %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
X86: Turn fp selects into mask operations.
double test(double a, double b, double c, double d) { return a<b ? c : d; }
before:
_test:
ucomisd %xmm0, %xmm1
ja LBB0_2
movaps %xmm3, %xmm2
LBB0_2:
movaps %xmm2, %xmm0
after:
_test:
cmpltsd %xmm1, %xmm0
andpd %xmm0, %xmm2
andnpd %xmm3, %xmm0
orpd %xmm2, %xmm0
Small speedup on Benchmarks/SmallPT
llvm-svn: 187706
2013-08-04 20:05:16 +08:00
|
|
|
%cmp = fcmp olt float %a, %eps
|
|
|
|
%cond = select i1 %cmp, float %b, float 0.000000e+00
|
|
|
|
ret float %cond
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @test10(float %a, float %b, float %eps) {
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-LABEL: test10:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-NEXT: cmpless %xmm2, %xmm0
|
|
|
|
; CHECK-NEXT: andps %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
X86: Turn fp selects into mask operations.
double test(double a, double b, double c, double d) { return a<b ? c : d; }
before:
_test:
ucomisd %xmm0, %xmm1
ja LBB0_2
movaps %xmm3, %xmm2
LBB0_2:
movaps %xmm2, %xmm0
after:
_test:
cmpltsd %xmm1, %xmm0
andpd %xmm0, %xmm2
andnpd %xmm3, %xmm0
orpd %xmm2, %xmm0
Small speedup on Benchmarks/SmallPT
llvm-svn: 187706
2013-08-04 20:05:16 +08:00
|
|
|
%cmp = fcmp ole float %a, %eps
|
|
|
|
%cond = select i1 %cmp, float %b, float 0.000000e+00
|
|
|
|
ret float %cond
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @test11(float %a, float %b, float %eps) {
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-LABEL: test11:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-NEXT: cmpltss %xmm0, %xmm2
|
|
|
|
; CHECK-NEXT: andps %xmm1, %xmm2
|
|
|
|
; CHECK-NEXT: movaps %xmm2, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
X86: Turn fp selects into mask operations.
double test(double a, double b, double c, double d) { return a<b ? c : d; }
before:
_test:
ucomisd %xmm0, %xmm1
ja LBB0_2
movaps %xmm3, %xmm2
LBB0_2:
movaps %xmm2, %xmm0
after:
_test:
cmpltsd %xmm1, %xmm0
andpd %xmm0, %xmm2
andnpd %xmm3, %xmm0
orpd %xmm2, %xmm0
Small speedup on Benchmarks/SmallPT
llvm-svn: 187706
2013-08-04 20:05:16 +08:00
|
|
|
%cmp = fcmp ogt float %a, %eps
|
|
|
|
%cond = select i1 %cmp, float %b, float 0.000000e+00
|
|
|
|
ret float %cond
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @test12(float %a, float %b, float %eps) {
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-LABEL: test12:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-NEXT: cmpless %xmm0, %xmm2
|
|
|
|
; CHECK-NEXT: andps %xmm1, %xmm2
|
|
|
|
; CHECK-NEXT: movaps %xmm2, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
X86: Turn fp selects into mask operations.
double test(double a, double b, double c, double d) { return a<b ? c : d; }
before:
_test:
ucomisd %xmm0, %xmm1
ja LBB0_2
movaps %xmm3, %xmm2
LBB0_2:
movaps %xmm2, %xmm0
after:
_test:
cmpltsd %xmm1, %xmm0
andpd %xmm0, %xmm2
andnpd %xmm3, %xmm0
orpd %xmm2, %xmm0
Small speedup on Benchmarks/SmallPT
llvm-svn: 187706
2013-08-04 20:05:16 +08:00
|
|
|
%cmp = fcmp oge float %a, %eps
|
|
|
|
%cond = select i1 %cmp, float %b, float 0.000000e+00
|
|
|
|
ret float %cond
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @test13(float %a, float %b, float %eps) {
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-LABEL: test13:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-NEXT: cmpltss %xmm2, %xmm0
|
|
|
|
; CHECK-NEXT: andnps %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
X86: Turn fp selects into mask operations.
double test(double a, double b, double c, double d) { return a<b ? c : d; }
before:
_test:
ucomisd %xmm0, %xmm1
ja LBB0_2
movaps %xmm3, %xmm2
LBB0_2:
movaps %xmm2, %xmm0
after:
_test:
cmpltsd %xmm1, %xmm0
andpd %xmm0, %xmm2
andnpd %xmm3, %xmm0
orpd %xmm2, %xmm0
Small speedup on Benchmarks/SmallPT
llvm-svn: 187706
2013-08-04 20:05:16 +08:00
|
|
|
%cmp = fcmp olt float %a, %eps
|
|
|
|
%cond = select i1 %cmp, float 0.000000e+00, float %b
|
|
|
|
ret float %cond
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @test14(float %a, float %b, float %eps) {
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-LABEL: test14:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-NEXT: cmpless %xmm2, %xmm0
|
|
|
|
; CHECK-NEXT: andnps %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
X86: Turn fp selects into mask operations.
double test(double a, double b, double c, double d) { return a<b ? c : d; }
before:
_test:
ucomisd %xmm0, %xmm1
ja LBB0_2
movaps %xmm3, %xmm2
LBB0_2:
movaps %xmm2, %xmm0
after:
_test:
cmpltsd %xmm1, %xmm0
andpd %xmm0, %xmm2
andnpd %xmm3, %xmm0
orpd %xmm2, %xmm0
Small speedup on Benchmarks/SmallPT
llvm-svn: 187706
2013-08-04 20:05:16 +08:00
|
|
|
%cmp = fcmp ole float %a, %eps
|
|
|
|
%cond = select i1 %cmp, float 0.000000e+00, float %b
|
|
|
|
ret float %cond
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @test15(float %a, float %b, float %eps) {
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-LABEL: test15:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-NEXT: cmpltss %xmm0, %xmm2
|
|
|
|
; CHECK-NEXT: andnps %xmm1, %xmm2
|
|
|
|
; CHECK-NEXT: movaps %xmm2, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
X86: Turn fp selects into mask operations.
double test(double a, double b, double c, double d) { return a<b ? c : d; }
before:
_test:
ucomisd %xmm0, %xmm1
ja LBB0_2
movaps %xmm3, %xmm2
LBB0_2:
movaps %xmm2, %xmm0
after:
_test:
cmpltsd %xmm1, %xmm0
andpd %xmm0, %xmm2
andnpd %xmm3, %xmm0
orpd %xmm2, %xmm0
Small speedup on Benchmarks/SmallPT
llvm-svn: 187706
2013-08-04 20:05:16 +08:00
|
|
|
%cmp = fcmp ogt float %a, %eps
|
|
|
|
%cond = select i1 %cmp, float 0.000000e+00, float %b
|
|
|
|
ret float %cond
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @test16(float %a, float %b, float %eps) {
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-LABEL: test16:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-NEXT: cmpless %xmm0, %xmm2
|
|
|
|
; CHECK-NEXT: andnps %xmm1, %xmm2
|
|
|
|
; CHECK-NEXT: movaps %xmm2, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
X86: Turn fp selects into mask operations.
double test(double a, double b, double c, double d) { return a<b ? c : d; }
before:
_test:
ucomisd %xmm0, %xmm1
ja LBB0_2
movaps %xmm3, %xmm2
LBB0_2:
movaps %xmm2, %xmm0
after:
_test:
cmpltsd %xmm1, %xmm0
andpd %xmm0, %xmm2
andnpd %xmm3, %xmm0
orpd %xmm2, %xmm0
Small speedup on Benchmarks/SmallPT
llvm-svn: 187706
2013-08-04 20:05:16 +08:00
|
|
|
%cmp = fcmp oge float %a, %eps
|
|
|
|
%cond = select i1 %cmp, float 0.000000e+00, float %b
|
|
|
|
ret float %cond
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @test17(float %a, float %b, float %c, float %eps) {
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-LABEL: test17:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-NEXT: cmpless %xmm0, %xmm3
|
|
|
|
; CHECK-NEXT: andps %xmm3, %xmm2
|
|
|
|
; CHECK-NEXT: andnps %xmm1, %xmm3
|
|
|
|
; CHECK-NEXT: orps %xmm2, %xmm3
|
|
|
|
; CHECK-NEXT: movaps %xmm3, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
X86: Turn fp selects into mask operations.
double test(double a, double b, double c, double d) { return a<b ? c : d; }
before:
_test:
ucomisd %xmm0, %xmm1
ja LBB0_2
movaps %xmm3, %xmm2
LBB0_2:
movaps %xmm2, %xmm0
after:
_test:
cmpltsd %xmm1, %xmm0
andpd %xmm0, %xmm2
andnpd %xmm3, %xmm0
orpd %xmm2, %xmm0
Small speedup on Benchmarks/SmallPT
llvm-svn: 187706
2013-08-04 20:05:16 +08:00
|
|
|
%cmp = fcmp oge float %a, %eps
|
|
|
|
%cond = select i1 %cmp, float %c, float %b
|
|
|
|
ret float %cond
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @test18(double %a, double %b, double %c, double %eps) {
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-LABEL: test18:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-NEXT: cmplesd %xmm0, %xmm3
|
2017-02-26 14:45:59 +08:00
|
|
|
; CHECK-NEXT: andpd %xmm3, %xmm2
|
|
|
|
; CHECK-NEXT: andnpd %xmm1, %xmm3
|
|
|
|
; CHECK-NEXT: orpd %xmm2, %xmm3
|
|
|
|
; CHECK-NEXT: movapd %xmm3, %xmm0
|
2016-11-16 06:42:20 +08:00
|
|
|
; CHECK-NEXT: retq
|
X86: Turn fp selects into mask operations.
double test(double a, double b, double c, double d) { return a<b ? c : d; }
before:
_test:
ucomisd %xmm0, %xmm1
ja LBB0_2
movaps %xmm3, %xmm2
LBB0_2:
movaps %xmm2, %xmm0
after:
_test:
cmpltsd %xmm1, %xmm0
andpd %xmm0, %xmm2
andnpd %xmm3, %xmm0
orpd %xmm2, %xmm0
Small speedup on Benchmarks/SmallPT
llvm-svn: 187706
2013-08-04 20:05:16 +08:00
|
|
|
%cmp = fcmp oge double %a, %eps
|
|
|
|
%cond = select i1 %cmp, double %c, double %b
|
|
|
|
ret double %cond
|
|
|
|
}
|
2016-11-16 06:42:20 +08:00
|
|
|
|