2012-08-02 08:56:42 +08:00
|
|
|
; RUN: llc < %s -march=x86-64 -mtriple=x86_64-apple-darwin -mcpu=nehalem -asm-verbose=false | FileCheck %s
|
|
|
|
; RUN: llc < %s -march=x86-64 -mtriple=x86_64-apple-darwin -mcpu=nehalem -asm-verbose=false -enable-unsafe-fp-math -enable-no-nans-fp-math | FileCheck -check-prefix=UNSAFE %s
|
|
|
|
; RUN: llc < %s -march=x86-64 -mtriple=x86_64-apple-darwin -mcpu=nehalem -asm-verbose=false -enable-no-nans-fp-math | FileCheck -check-prefix=FINITE %s
|
2009-09-22 02:03:22 +08:00
|
|
|
|
|
|
|
; Some of these patterns can be matched as SSE min or max. Some of
|
|
|
|
; then can be matched provided that the operands are swapped.
|
|
|
|
; Some of them can't be matched at all and require a comparison
|
|
|
|
; and a conditional branch.
|
|
|
|
|
2010-02-24 14:52:40 +08:00
|
|
|
; The naming convention is {,x_,y_}{o,u}{gt,lt,ge,le}{,_inverse}
|
2012-05-18 07:44:19 +08:00
|
|
|
; _x: use 0.0 instead of %y
|
|
|
|
; _y: use -0.0 instead of %y
|
2009-09-22 02:03:22 +08:00
|
|
|
; _inverse : swap the arms of the select.
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: ogt:
|
2009-09-22 02:03:22 +08:00
|
|
|
; CHECK-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: ogt:
|
2010-02-23 02:53:26 +08:00
|
|
|
; UNSAFE-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: ogt:
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2009-09-22 02:03:22 +08:00
|
|
|
define double @ogt(double %x, double %y) nounwind {
|
|
|
|
%c = fcmp ogt double %x, %y
|
|
|
|
%d = select i1 %c, double %x, double %y
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: olt:
|
2009-09-22 02:03:22 +08:00
|
|
|
; CHECK-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: olt:
|
2010-02-23 02:53:26 +08:00
|
|
|
; UNSAFE-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: olt:
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2009-09-22 02:03:22 +08:00
|
|
|
define double @olt(double %x, double %y) nounwind {
|
|
|
|
%c = fcmp olt double %x, %y
|
|
|
|
%d = select i1 %c, double %x, double %y
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: ogt_inverse:
|
2009-09-22 02:03:22 +08:00
|
|
|
; CHECK-NEXT: minsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; CHECK-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2009-09-22 02:03:22 +08:00
|
|
|
; CHECK-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: ogt_inverse:
|
2012-08-19 21:06:16 +08:00
|
|
|
; UNSAFE-NEXT: minsd %xmm1, %xmm0
|
2010-02-23 02:53:26 +08:00
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: ogt_inverse:
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: ret
|
2009-09-22 02:03:22 +08:00
|
|
|
define double @ogt_inverse(double %x, double %y) nounwind {
|
|
|
|
%c = fcmp ogt double %x, %y
|
|
|
|
%d = select i1 %c, double %y, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: olt_inverse:
|
2009-09-22 02:03:22 +08:00
|
|
|
; CHECK-NEXT: maxsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; CHECK-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2009-09-22 02:03:22 +08:00
|
|
|
; CHECK-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: olt_inverse:
|
2012-08-19 21:06:16 +08:00
|
|
|
; UNSAFE-NEXT: maxsd %xmm1, %xmm0
|
2010-02-23 02:53:26 +08:00
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: olt_inverse:
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: ret
|
2009-09-22 02:03:22 +08:00
|
|
|
define double @olt_inverse(double %x, double %y) nounwind {
|
|
|
|
%c = fcmp olt double %x, %y
|
|
|
|
%d = select i1 %c, double %y, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: oge:
|
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
|
|
|
; CHECK: cmplesd %xmm0
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: oge:
|
2010-02-23 02:53:26 +08:00
|
|
|
; UNSAFE-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: oge:
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2009-09-22 02:03:22 +08:00
|
|
|
define double @oge(double %x, double %y) nounwind {
|
|
|
|
%c = fcmp oge double %x, %y
|
|
|
|
%d = select i1 %c, double %x, double %y
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: ole:
|
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
|
|
|
; CHECK: cmplesd %xmm1
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: ole:
|
2010-02-23 02:53:26 +08:00
|
|
|
; UNSAFE-NEXT: minsd %xmm1, %xmm0
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: ole:
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: minsd %xmm1, %xmm0
|
2009-09-22 02:03:22 +08:00
|
|
|
define double @ole(double %x, double %y) nounwind {
|
|
|
|
%c = fcmp ole double %x, %y
|
|
|
|
%d = select i1 %c, double %x, double %y
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: oge_inverse:
|
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
|
|
|
; CHECK: cmplesd %xmm0
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: oge_inverse:
|
2012-08-19 21:06:16 +08:00
|
|
|
; UNSAFE-NEXT: minsd %xmm1, %xmm0
|
2010-02-23 02:53:26 +08:00
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: oge_inverse:
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: ret
|
2009-09-22 02:03:22 +08:00
|
|
|
define double @oge_inverse(double %x, double %y) nounwind {
|
|
|
|
%c = fcmp oge double %x, %y
|
|
|
|
%d = select i1 %c, double %y, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: ole_inverse:
|
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
|
|
|
; CHECK: cmplesd %xmm1
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: ole_inverse:
|
2012-08-19 21:06:16 +08:00
|
|
|
; UNSAFE-NEXT: maxsd %xmm1, %xmm0
|
2010-02-23 02:53:26 +08:00
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: ole_inverse:
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: ret
|
2009-09-22 02:03:22 +08:00
|
|
|
define double @ole_inverse(double %x, double %y) nounwind {
|
|
|
|
%c = fcmp ole double %x, %y
|
|
|
|
%d = select i1 %c, double %y, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: ogt_x:
|
2012-08-03 03:37:32 +08:00
|
|
|
; CHECK-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
|
|
|
; CHECK-NEXT: maxsd %xmm1, %xmm0
|
2009-09-22 02:03:22 +08:00
|
|
|
; CHECK-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: ogt_x:
|
2012-08-03 03:37:32 +08:00
|
|
|
; UNSAFE-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
2014-11-05 14:43:02 +08:00
|
|
|
; UNSAFE-NEXT: maxsd %xmm1, %xmm0
|
2010-02-23 02:53:26 +08:00
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: ogt_x:
|
2012-08-03 03:37:32 +08:00
|
|
|
; FINITE-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
|
|
|
; FINITE-NEXT: maxsd %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: ret
|
2012-05-18 07:44:19 +08:00
|
|
|
define double @ogt_x(double %x) nounwind {
|
2009-09-22 02:03:22 +08:00
|
|
|
%c = fcmp ogt double %x, 0.000000e+00
|
|
|
|
%d = select i1 %c, double %x, double 0.000000e+00
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: olt_x:
|
2012-08-03 03:37:32 +08:00
|
|
|
; CHECK-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
|
|
|
; CHECK-NEXT: minsd %xmm1, %xmm0
|
2009-09-22 02:03:22 +08:00
|
|
|
; CHECK-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: olt_x:
|
2012-08-03 03:37:32 +08:00
|
|
|
; UNSAFE-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
2014-11-05 14:43:02 +08:00
|
|
|
; UNSAFE-NEXT: minsd %xmm1, %xmm0
|
2010-02-23 02:53:26 +08:00
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: olt_x:
|
2012-08-03 03:37:32 +08:00
|
|
|
; FINITE-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
|
|
|
; FINITE-NEXT: minsd %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: ret
|
2012-05-18 07:44:19 +08:00
|
|
|
define double @olt_x(double %x) nounwind {
|
2009-09-22 02:03:22 +08:00
|
|
|
%c = fcmp olt double %x, 0.000000e+00
|
|
|
|
%d = select i1 %c, double %x, double 0.000000e+00
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: ogt_inverse_x:
|
2011-11-30 06:27:25 +08:00
|
|
|
; CHECK-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
2009-09-22 02:03:22 +08:00
|
|
|
; CHECK-NEXT: minsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; CHECK-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2009-09-22 02:03:22 +08:00
|
|
|
; CHECK-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: ogt_inverse_x:
|
2011-11-30 06:27:25 +08:00
|
|
|
; UNSAFE-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
2014-11-05 14:43:02 +08:00
|
|
|
; UNSAFE-NEXT: minsd %xmm1, %xmm0
|
2010-02-23 02:53:26 +08:00
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: ogt_inverse_x:
|
2011-11-30 06:27:25 +08:00
|
|
|
; FINITE-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: ret
|
2012-05-18 07:44:19 +08:00
|
|
|
define double @ogt_inverse_x(double %x) nounwind {
|
2009-09-22 02:03:22 +08:00
|
|
|
%c = fcmp ogt double %x, 0.000000e+00
|
|
|
|
%d = select i1 %c, double 0.000000e+00, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: olt_inverse_x:
|
2011-11-30 06:27:25 +08:00
|
|
|
; CHECK-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
2009-09-22 02:03:22 +08:00
|
|
|
; CHECK-NEXT: maxsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; CHECK-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2009-09-22 02:03:22 +08:00
|
|
|
; CHECK-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: olt_inverse_x:
|
2011-11-30 06:27:25 +08:00
|
|
|
; UNSAFE-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
2014-11-05 14:43:02 +08:00
|
|
|
; UNSAFE-NEXT: maxsd %xmm1, %xmm0
|
2010-02-23 02:53:26 +08:00
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: olt_inverse_x:
|
2011-11-30 06:27:25 +08:00
|
|
|
; FINITE-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: ret
|
2012-05-18 07:44:19 +08:00
|
|
|
define double @olt_inverse_x(double %x) nounwind {
|
2009-09-22 02:03:22 +08:00
|
|
|
%c = fcmp olt double %x, 0.000000e+00
|
|
|
|
%d = select i1 %c, double 0.000000e+00, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: oge_x:
|
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
|
|
|
; CHECK: cmplesd %xmm
|
|
|
|
; CHECK-NEXT: andpd
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: oge_x:
|
2012-08-03 03:37:32 +08:00
|
|
|
; UNSAFE-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
2014-11-05 14:43:02 +08:00
|
|
|
; UNSAFE-NEXT: maxsd %xmm1, %xmm0
|
2010-02-23 02:53:26 +08:00
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: oge_x:
|
2012-08-03 03:37:32 +08:00
|
|
|
; FINITE-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
|
|
|
; FINITE-NEXT: maxsd %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: ret
|
2012-05-18 07:44:19 +08:00
|
|
|
define double @oge_x(double %x) nounwind {
|
2009-09-22 02:03:22 +08:00
|
|
|
%c = fcmp oge double %x, 0.000000e+00
|
|
|
|
%d = select i1 %c, double %x, double 0.000000e+00
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: ole_x:
|
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
|
|
|
; CHECK: cmplesd %xmm
|
|
|
|
; CHECK-NEXT: andpd
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: ole_x:
|
2012-08-03 03:37:32 +08:00
|
|
|
; UNSAFE-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
2014-11-05 14:43:02 +08:00
|
|
|
; UNSAFE-NEXT: minsd %xmm1, %xmm0
|
2010-02-23 02:53:26 +08:00
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: ole_x:
|
2012-08-03 03:37:32 +08:00
|
|
|
; FINITE-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
|
|
|
; FINITE-NEXT: minsd %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: ret
|
2012-05-18 07:44:19 +08:00
|
|
|
define double @ole_x(double %x) nounwind {
|
2009-09-22 02:03:22 +08:00
|
|
|
%c = fcmp ole double %x, 0.000000e+00
|
|
|
|
%d = select i1 %c, double %x, double 0.000000e+00
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: oge_inverse_x:
|
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
|
|
|
; CHECK: cmplesd %xmm
|
|
|
|
; CHECK-NEXT: andnpd
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: oge_inverse_x:
|
2011-11-30 06:27:25 +08:00
|
|
|
; UNSAFE-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
2014-11-05 14:43:02 +08:00
|
|
|
; UNSAFE-NEXT: minsd %xmm1, %xmm0
|
2010-02-23 02:53:26 +08:00
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: oge_inverse_x:
|
2011-11-30 06:27:25 +08:00
|
|
|
; FINITE-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: ret
|
2012-05-18 07:44:19 +08:00
|
|
|
define double @oge_inverse_x(double %x) nounwind {
|
2009-09-22 02:03:22 +08:00
|
|
|
%c = fcmp oge double %x, 0.000000e+00
|
|
|
|
%d = select i1 %c, double 0.000000e+00, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: ole_inverse_x:
|
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
|
|
|
; CHECK: cmplesd %xmm
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: ole_inverse_x:
|
2011-11-30 06:27:25 +08:00
|
|
|
; UNSAFE-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
2014-11-05 14:43:02 +08:00
|
|
|
; UNSAFE-NEXT: maxsd %xmm1, %xmm0
|
2010-02-23 02:53:26 +08:00
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: ole_inverse_x:
|
2011-11-30 06:27:25 +08:00
|
|
|
; FINITE-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: ret
|
2012-05-18 07:44:19 +08:00
|
|
|
define double @ole_inverse_x(double %x) nounwind {
|
2009-09-22 02:03:22 +08:00
|
|
|
%c = fcmp ole double %x, 0.000000e+00
|
|
|
|
%d = select i1 %c, double 0.000000e+00, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: ugt:
|
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
|
|
|
; CHECK: cmpnlesd %xmm1
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: ugt:
|
2010-02-23 02:53:26 +08:00
|
|
|
; UNSAFE-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: ugt:
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2009-09-22 02:03:22 +08:00
|
|
|
define double @ugt(double %x, double %y) nounwind {
|
|
|
|
%c = fcmp ugt double %x, %y
|
|
|
|
%d = select i1 %c, double %x, double %y
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: ult:
|
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
|
|
|
; CHECK: cmpnlesd %xmm0
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: ult:
|
2010-02-23 02:53:26 +08:00
|
|
|
; UNSAFE-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: ult:
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2009-09-22 02:03:22 +08:00
|
|
|
define double @ult(double %x, double %y) nounwind {
|
|
|
|
%c = fcmp ult double %x, %y
|
|
|
|
%d = select i1 %c, double %x, double %y
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: ugt_inverse:
|
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
|
|
|
; CHECK: cmpnlesd %xmm1
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: ugt_inverse:
|
2012-08-19 21:06:16 +08:00
|
|
|
; UNSAFE-NEXT: minsd %xmm1, %xmm0
|
2010-02-23 02:53:26 +08:00
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: ugt_inverse:
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: ret
|
2009-09-22 02:03:22 +08:00
|
|
|
define double @ugt_inverse(double %x, double %y) nounwind {
|
|
|
|
%c = fcmp ugt double %x, %y
|
|
|
|
%d = select i1 %c, double %y, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: ult_inverse:
|
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
|
|
|
; CHECK: cmpnlesd %xmm0
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: ult_inverse:
|
2012-08-19 21:06:16 +08:00
|
|
|
; UNSAFE-NEXT: maxsd %xmm1, %xmm0
|
2010-02-23 02:53:26 +08:00
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: ult_inverse:
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: ret
|
2009-09-22 02:03:22 +08:00
|
|
|
define double @ult_inverse(double %x, double %y) nounwind {
|
|
|
|
%c = fcmp ult double %x, %y
|
|
|
|
%d = select i1 %c, double %y, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: uge:
|
2010-02-24 14:52:40 +08:00
|
|
|
; CHECK-NEXT: maxsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; CHECK-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2009-09-22 02:03:22 +08:00
|
|
|
; CHECK-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: uge:
|
2010-02-23 02:53:26 +08:00
|
|
|
; UNSAFE-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: uge:
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2009-09-22 02:03:22 +08:00
|
|
|
define double @uge(double %x, double %y) nounwind {
|
|
|
|
%c = fcmp uge double %x, %y
|
|
|
|
%d = select i1 %c, double %x, double %y
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: ule:
|
2010-02-24 14:52:40 +08:00
|
|
|
; CHECK-NEXT: minsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; CHECK-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2009-09-22 02:03:22 +08:00
|
|
|
; CHECK-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: ule:
|
2010-02-23 02:53:26 +08:00
|
|
|
; UNSAFE-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: ule:
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2009-09-22 02:03:22 +08:00
|
|
|
define double @ule(double %x, double %y) nounwind {
|
|
|
|
%c = fcmp ule double %x, %y
|
|
|
|
%d = select i1 %c, double %x, double %y
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: uge_inverse:
|
2010-02-24 14:52:40 +08:00
|
|
|
; CHECK-NEXT: minsd %xmm1, %xmm0
|
2009-09-22 02:03:22 +08:00
|
|
|
; CHECK-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: uge_inverse:
|
2012-08-19 21:06:16 +08:00
|
|
|
; UNSAFE-NEXT: minsd %xmm1, %xmm0
|
2010-02-23 02:53:26 +08:00
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: uge_inverse:
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: ret
|
2009-09-22 02:03:22 +08:00
|
|
|
define double @uge_inverse(double %x, double %y) nounwind {
|
|
|
|
%c = fcmp uge double %x, %y
|
|
|
|
%d = select i1 %c, double %y, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: ule_inverse:
|
2010-02-24 14:52:40 +08:00
|
|
|
; CHECK-NEXT: maxsd %xmm1, %xmm0
|
2009-09-22 02:03:22 +08:00
|
|
|
; CHECK-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: ule_inverse:
|
2012-08-19 21:06:16 +08:00
|
|
|
; UNSAFE-NEXT: maxsd %xmm1, %xmm0
|
2010-02-23 02:53:26 +08:00
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: ule_inverse:
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: ret
|
2009-09-22 02:03:22 +08:00
|
|
|
define double @ule_inverse(double %x, double %y) nounwind {
|
|
|
|
%c = fcmp ule double %x, %y
|
|
|
|
%d = select i1 %c, double %y, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: ugt_x:
|
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
|
|
|
; CHECK: cmpnlesd %xmm
|
|
|
|
; CHECK-NEXT: andpd
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: ugt_x:
|
2012-08-03 03:37:32 +08:00
|
|
|
; UNSAFE-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
2014-11-05 14:43:02 +08:00
|
|
|
; UNSAFE-NEXT: maxsd %xmm1, %xmm0
|
2010-02-23 02:53:26 +08:00
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: ugt_x:
|
2012-08-03 03:37:32 +08:00
|
|
|
; FINITE-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
|
|
|
; FINITE-NEXT: maxsd %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: ret
|
2012-05-18 07:44:19 +08:00
|
|
|
define double @ugt_x(double %x) nounwind {
|
2009-09-22 02:03:22 +08:00
|
|
|
%c = fcmp ugt double %x, 0.000000e+00
|
|
|
|
%d = select i1 %c, double %x, double 0.000000e+00
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: ult_x:
|
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
|
|
|
; CHECK: cmpnlesd %xmm
|
|
|
|
; CHECK-NEXT: andpd
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: ult_x:
|
2012-08-03 03:37:32 +08:00
|
|
|
; UNSAFE-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
2014-11-05 14:43:02 +08:00
|
|
|
; UNSAFE-NEXT: minsd %xmm1, %xmm0
|
2010-02-23 02:53:26 +08:00
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: ult_x:
|
2012-08-03 03:37:32 +08:00
|
|
|
; FINITE-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
|
|
|
; FINITE-NEXT: minsd %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: ret
|
2012-05-18 07:44:19 +08:00
|
|
|
define double @ult_x(double %x) nounwind {
|
2009-09-22 02:03:22 +08:00
|
|
|
%c = fcmp ult double %x, 0.000000e+00
|
|
|
|
%d = select i1 %c, double %x, double 0.000000e+00
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: ugt_inverse_x:
|
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
|
|
|
; CHECK: cmpnlesd %xmm
|
|
|
|
; CHECK-NEXT: andnpd
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: ugt_inverse_x:
|
2011-11-30 06:27:25 +08:00
|
|
|
; UNSAFE-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
2014-11-05 14:43:02 +08:00
|
|
|
; UNSAFE-NEXT: minsd %xmm1, %xmm0
|
2010-02-23 02:53:26 +08:00
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: ugt_inverse_x:
|
2011-11-30 06:27:25 +08:00
|
|
|
; FINITE-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: ret
|
2012-05-18 07:44:19 +08:00
|
|
|
define double @ugt_inverse_x(double %x) nounwind {
|
2009-09-22 02:03:22 +08:00
|
|
|
%c = fcmp ugt double %x, 0.000000e+00
|
|
|
|
%d = select i1 %c, double 0.000000e+00, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: ult_inverse_x:
|
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
|
|
|
; CHECK: cmpnlesd %xmm
|
|
|
|
; CHECK-NEXT: andnpd
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: ult_inverse_x:
|
2011-11-30 06:27:25 +08:00
|
|
|
; UNSAFE-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
2014-11-05 14:43:02 +08:00
|
|
|
; UNSAFE-NEXT: maxsd %xmm1, %xmm0
|
2010-02-23 02:53:26 +08:00
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: ult_inverse_x:
|
2011-11-30 06:27:25 +08:00
|
|
|
; FINITE-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: ret
|
2012-05-18 07:44:19 +08:00
|
|
|
define double @ult_inverse_x(double %x) nounwind {
|
2009-09-22 02:03:22 +08:00
|
|
|
%c = fcmp ult double %x, 0.000000e+00
|
|
|
|
%d = select i1 %c, double 0.000000e+00, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: uge_x:
|
2011-11-30 06:27:25 +08:00
|
|
|
; CHECK-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
2010-02-24 14:52:40 +08:00
|
|
|
; CHECK-NEXT: maxsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; CHECK-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2009-09-22 02:03:22 +08:00
|
|
|
; CHECK-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: uge_x:
|
2012-08-03 03:37:32 +08:00
|
|
|
; UNSAFE-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
2014-11-05 14:43:02 +08:00
|
|
|
; UNSAFE-NEXT: maxsd %xmm1, %xmm0
|
2010-02-23 02:53:26 +08:00
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: uge_x:
|
2012-08-03 03:37:32 +08:00
|
|
|
; FINITE-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
|
|
|
; FINITE-NEXT: maxsd %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: ret
|
2012-05-18 07:44:19 +08:00
|
|
|
define double @uge_x(double %x) nounwind {
|
2009-09-22 02:03:22 +08:00
|
|
|
%c = fcmp uge double %x, 0.000000e+00
|
|
|
|
%d = select i1 %c, double %x, double 0.000000e+00
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: ule_x:
|
2011-11-30 06:27:25 +08:00
|
|
|
; CHECK-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
2010-02-24 14:52:40 +08:00
|
|
|
; CHECK-NEXT: minsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; CHECK-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2009-09-22 02:03:22 +08:00
|
|
|
; CHECK-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: ule_x:
|
2012-08-03 03:37:32 +08:00
|
|
|
; UNSAFE-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
2014-11-05 14:43:02 +08:00
|
|
|
; UNSAFE-NEXT: minsd %xmm1, %xmm0
|
2010-02-23 02:53:26 +08:00
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: ule_x:
|
2012-08-03 03:37:32 +08:00
|
|
|
; FINITE-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
|
|
|
; FINITE-NEXT: minsd %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: ret
|
2012-05-18 07:44:19 +08:00
|
|
|
define double @ule_x(double %x) nounwind {
|
2009-09-22 02:03:22 +08:00
|
|
|
%c = fcmp ule double %x, 0.000000e+00
|
|
|
|
%d = select i1 %c, double %x, double 0.000000e+00
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: uge_inverse_x:
|
2012-08-03 03:37:32 +08:00
|
|
|
; CHECK-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
|
|
|
; CHECK-NEXT: minsd %xmm1, %xmm0
|
2009-09-22 02:03:22 +08:00
|
|
|
; CHECK-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: uge_inverse_x:
|
2011-11-30 06:27:25 +08:00
|
|
|
; UNSAFE-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
2014-11-05 14:43:02 +08:00
|
|
|
; UNSAFE-NEXT: minsd %xmm1, %xmm0
|
2010-02-23 02:53:26 +08:00
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: uge_inverse_x:
|
2011-11-30 06:27:25 +08:00
|
|
|
; FINITE-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: ret
|
2012-05-18 07:44:19 +08:00
|
|
|
define double @uge_inverse_x(double %x) nounwind {
|
2009-09-22 02:03:22 +08:00
|
|
|
%c = fcmp uge double %x, 0.000000e+00
|
|
|
|
%d = select i1 %c, double 0.000000e+00, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: ule_inverse_x:
|
2012-08-03 03:37:32 +08:00
|
|
|
; CHECK-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
|
|
|
; CHECK-NEXT: maxsd %xmm1, %xmm0
|
2009-09-22 02:03:22 +08:00
|
|
|
; CHECK-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: ule_inverse_x:
|
2011-11-30 06:27:25 +08:00
|
|
|
; UNSAFE-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
2014-11-05 14:43:02 +08:00
|
|
|
; UNSAFE-NEXT: maxsd %xmm1, %xmm0
|
2010-02-23 02:53:26 +08:00
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: ule_inverse_x:
|
2011-11-30 06:27:25 +08:00
|
|
|
; FINITE-NEXT: xorp{{[sd]}} %xmm1, %xmm1
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: ret
|
2012-05-18 07:44:19 +08:00
|
|
|
define double @ule_inverse_x(double %x) nounwind {
|
2009-09-22 02:03:22 +08:00
|
|
|
%c = fcmp ule double %x, 0.000000e+00
|
|
|
|
%d = select i1 %c, double 0.000000e+00, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: ogt_y:
|
2010-02-24 14:52:40 +08:00
|
|
|
; CHECK-NEXT: maxsd {{[^,]*}}, %xmm0
|
|
|
|
; CHECK-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: ogt_y:
|
2010-02-24 14:52:40 +08:00
|
|
|
; UNSAFE-NEXT: maxsd {{[^,]*}}, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: ogt_y:
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: maxsd {{[^,]*}}, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2012-05-18 07:44:19 +08:00
|
|
|
define double @ogt_y(double %x) nounwind {
|
2010-02-24 14:52:40 +08:00
|
|
|
%c = fcmp ogt double %x, -0.000000e+00
|
|
|
|
%d = select i1 %c, double %x, double -0.000000e+00
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: olt_y:
|
2010-02-24 14:52:40 +08:00
|
|
|
; CHECK-NEXT: minsd {{[^,]*}}, %xmm0
|
|
|
|
; CHECK-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: olt_y:
|
2010-02-24 14:52:40 +08:00
|
|
|
; UNSAFE-NEXT: minsd {{[^,]*}}, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: olt_y:
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: minsd {{[^,]*}}, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2012-05-18 07:44:19 +08:00
|
|
|
define double @olt_y(double %x) nounwind {
|
2010-02-24 14:52:40 +08:00
|
|
|
%c = fcmp olt double %x, -0.000000e+00
|
|
|
|
%d = select i1 %c, double %x, double -0.000000e+00
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: ogt_inverse_y:
|
2010-02-24 14:52:40 +08:00
|
|
|
; CHECK-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; CHECK-NEXT: minsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; CHECK-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; CHECK-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: ogt_inverse_y:
|
2012-08-19 21:06:16 +08:00
|
|
|
; UNSAFE-NEXT: minsd {{[^,]*}}, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: ogt_inverse_y:
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: ret
|
2012-05-18 07:44:19 +08:00
|
|
|
define double @ogt_inverse_y(double %x) nounwind {
|
2010-02-24 14:52:40 +08:00
|
|
|
%c = fcmp ogt double %x, -0.000000e+00
|
|
|
|
%d = select i1 %c, double -0.000000e+00, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: olt_inverse_y:
|
2010-02-24 14:52:40 +08:00
|
|
|
; CHECK-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; CHECK-NEXT: maxsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; CHECK-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; CHECK-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: olt_inverse_y:
|
2012-08-19 21:06:16 +08:00
|
|
|
; UNSAFE-NEXT: maxsd {{[^,]*}}, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: olt_inverse_y:
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: ret
|
2012-05-18 07:44:19 +08:00
|
|
|
define double @olt_inverse_y(double %x) nounwind {
|
2010-02-24 14:52:40 +08:00
|
|
|
%c = fcmp olt double %x, -0.000000e+00
|
|
|
|
%d = select i1 %c, double -0.000000e+00, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: oge_y:
|
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
|
|
|
; CHECK: cmplesd %xmm0
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: oge_y:
|
2010-02-24 14:52:40 +08:00
|
|
|
; UNSAFE-NEXT: maxsd {{[^,]*}}, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: oge_y:
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: maxsd {{[^,]*}}, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2012-05-18 07:44:19 +08:00
|
|
|
define double @oge_y(double %x) nounwind {
|
2010-02-24 14:52:40 +08:00
|
|
|
%c = fcmp oge double %x, -0.000000e+00
|
|
|
|
%d = select i1 %c, double %x, double -0.000000e+00
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: ole_y:
|
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
|
|
|
; CHECK: cmplesd %xmm
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: ole_y:
|
2010-02-24 14:52:40 +08:00
|
|
|
; UNSAFE-NEXT: minsd {{[^,]*}}, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: ole_y:
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: minsd {{[^,]*}}, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2012-05-18 07:44:19 +08:00
|
|
|
define double @ole_y(double %x) nounwind {
|
2010-02-24 14:52:40 +08:00
|
|
|
%c = fcmp ole double %x, -0.000000e+00
|
|
|
|
%d = select i1 %c, double %x, double -0.000000e+00
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: oge_inverse_y:
|
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
|
|
|
; CHECK: cmplesd %xmm0
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: oge_inverse_y:
|
2012-08-19 21:06:16 +08:00
|
|
|
; UNSAFE-NEXT: minsd {{[^,]*}}, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: oge_inverse_y:
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: ret
|
2012-05-18 07:44:19 +08:00
|
|
|
define double @oge_inverse_y(double %x) nounwind {
|
2010-02-24 14:52:40 +08:00
|
|
|
%c = fcmp oge double %x, -0.000000e+00
|
|
|
|
%d = select i1 %c, double -0.000000e+00, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: ole_inverse_y:
|
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
|
|
|
; CHECK: cmplesd %xmm
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: ole_inverse_y:
|
2012-08-19 21:06:16 +08:00
|
|
|
; UNSAFE-NEXT: maxsd {{[^,]*}}, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: ole_inverse_y:
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: ret
|
2012-05-18 07:44:19 +08:00
|
|
|
define double @ole_inverse_y(double %x) nounwind {
|
2010-02-24 14:52:40 +08:00
|
|
|
%c = fcmp ole double %x, -0.000000e+00
|
|
|
|
%d = select i1 %c, double -0.000000e+00, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: ugt_y:
|
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
|
|
|
; CHECK: cmpnlesd %xmm
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: ugt_y:
|
2010-02-24 14:52:40 +08:00
|
|
|
; UNSAFE-NEXT: maxsd {{[^,]*}}, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: ugt_y:
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: maxsd {{[^,]*}}, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2012-05-18 07:44:19 +08:00
|
|
|
define double @ugt_y(double %x) nounwind {
|
2010-02-24 14:52:40 +08:00
|
|
|
%c = fcmp ugt double %x, -0.000000e+00
|
|
|
|
%d = select i1 %c, double %x, double -0.000000e+00
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: ult_y:
|
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
|
|
|
; CHECK: cmpnlesd %xmm0
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: ult_y:
|
2010-02-24 14:52:40 +08:00
|
|
|
; UNSAFE-NEXT: minsd {{[^,]*}}, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: ult_y:
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: minsd {{[^,]*}}, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2012-05-18 07:44:19 +08:00
|
|
|
define double @ult_y(double %x) nounwind {
|
2010-02-24 14:52:40 +08:00
|
|
|
%c = fcmp ult double %x, -0.000000e+00
|
|
|
|
%d = select i1 %c, double %x, double -0.000000e+00
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: ugt_inverse_y:
|
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
|
|
|
; CHECK: cmpnlesd %xmm
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: ugt_inverse_y:
|
2012-08-19 21:06:16 +08:00
|
|
|
; UNSAFE-NEXT: minsd {{[^,]*}}, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: ugt_inverse_y:
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: ret
|
2012-05-18 07:44:19 +08:00
|
|
|
define double @ugt_inverse_y(double %x) nounwind {
|
2010-02-24 14:52:40 +08:00
|
|
|
%c = fcmp ugt double %x, -0.000000e+00
|
|
|
|
%d = select i1 %c, double -0.000000e+00, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: ult_inverse_y:
|
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
|
|
|
; CHECK: cmpnlesd %xmm
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: ult_inverse_y:
|
2012-08-19 21:06:16 +08:00
|
|
|
; UNSAFE-NEXT: maxsd {{[^,]*}}, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: ult_inverse_y:
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: ret
|
2012-05-18 07:44:19 +08:00
|
|
|
define double @ult_inverse_y(double %x) nounwind {
|
2010-02-24 14:52:40 +08:00
|
|
|
%c = fcmp ult double %x, -0.000000e+00
|
|
|
|
%d = select i1 %c, double -0.000000e+00, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: uge_y:
|
2010-02-24 14:52:40 +08:00
|
|
|
; CHECK-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; CHECK-NEXT: maxsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; CHECK-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; CHECK-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: uge_y:
|
2010-02-24 14:52:40 +08:00
|
|
|
; UNSAFE-NEXT: maxsd {{[^,]*}}, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: uge_y:
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: maxsd {{[^,]*}}, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2012-05-18 07:44:19 +08:00
|
|
|
define double @uge_y(double %x) nounwind {
|
2010-02-24 14:52:40 +08:00
|
|
|
%c = fcmp uge double %x, -0.000000e+00
|
|
|
|
%d = select i1 %c, double %x, double -0.000000e+00
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: ule_y:
|
2010-02-24 14:52:40 +08:00
|
|
|
; CHECK-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; CHECK-NEXT: minsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; CHECK-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; CHECK-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: ule_y:
|
2010-02-24 14:52:40 +08:00
|
|
|
; UNSAFE-NEXT: minsd {{[^,]*}}, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: ule_y:
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: minsd {{[^,]*}}, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2012-05-18 07:44:19 +08:00
|
|
|
define double @ule_y(double %x) nounwind {
|
2010-02-24 14:52:40 +08:00
|
|
|
%c = fcmp ule double %x, -0.000000e+00
|
|
|
|
%d = select i1 %c, double %x, double -0.000000e+00
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: uge_inverse_y:
|
2010-02-24 14:52:40 +08:00
|
|
|
; CHECK-NEXT: minsd {{[^,]*}}, %xmm0
|
|
|
|
; CHECK-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: uge_inverse_y:
|
2012-08-19 21:06:16 +08:00
|
|
|
; UNSAFE-NEXT: minsd {{[^,]*}}, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: uge_inverse_y:
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: ret
|
2012-05-18 07:44:19 +08:00
|
|
|
define double @uge_inverse_y(double %x) nounwind {
|
2010-02-24 14:52:40 +08:00
|
|
|
%c = fcmp uge double %x, -0.000000e+00
|
|
|
|
%d = select i1 %c, double -0.000000e+00, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: ule_inverse_y:
|
2010-02-24 14:52:40 +08:00
|
|
|
; CHECK-NEXT: maxsd {{[^,]*}}, %xmm0
|
|
|
|
; CHECK-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: ule_inverse_y:
|
2012-08-19 21:06:16 +08:00
|
|
|
; UNSAFE-NEXT: maxsd {{[^,]*}}, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: ule_inverse_y:
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-10 04:43:09 +08:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 14:52:40 +08:00
|
|
|
; FINITE-NEXT: ret
|
2012-05-18 07:44:19 +08:00
|
|
|
define double @ule_inverse_y(double %x) nounwind {
|
2010-02-24 14:52:40 +08:00
|
|
|
%c = fcmp ule double %x, -0.000000e+00
|
|
|
|
%d = select i1 %c, double -0.000000e+00, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
2009-09-22 02:03:22 +08:00
|
|
|
; Test a few more misc. cases.
|
2009-09-04 04:34:31 +08:00
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: clampTo3k_a:
|
2015-01-13 04:15:47 +08:00
|
|
|
; CHECK-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; CHECK-NEXT: minsd %xmm0, %xmm1
|
|
|
|
; CHECK-NEXT: movaps %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: clampTo3k_a:
|
2015-01-13 04:15:47 +08:00
|
|
|
; UNSAFE-NEXT: minsd {{[^,]*}}, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: clampTo3k_a:
|
2015-01-13 04:15:47 +08:00
|
|
|
; FINITE-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movaps %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2009-09-04 04:34:31 +08:00
|
|
|
define double @clampTo3k_a(double %x) nounwind readnone {
|
|
|
|
entry:
|
|
|
|
%0 = fcmp ogt double %x, 3.000000e+03 ; <i1> [#uses=1]
|
|
|
|
%x_addr.0 = select i1 %0, double 3.000000e+03, double %x ; <double> [#uses=1]
|
|
|
|
ret double %x_addr.0
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: clampTo3k_b:
|
2015-01-13 04:15:47 +08:00
|
|
|
; CHECK-NEXT: minsd {{[^,]*}}, %xmm0
|
|
|
|
; CHECK-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: clampTo3k_b:
|
2015-01-13 04:15:47 +08:00
|
|
|
; UNSAFE-NEXT: minsd {{[^,]*}}, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: clampTo3k_b:
|
2015-01-13 04:15:47 +08:00
|
|
|
; FINITE-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movaps %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2009-09-04 04:34:31 +08:00
|
|
|
define double @clampTo3k_b(double %x) nounwind readnone {
|
|
|
|
entry:
|
|
|
|
%0 = fcmp uge double %x, 3.000000e+03 ; <i1> [#uses=1]
|
|
|
|
%x_addr.0 = select i1 %0, double 3.000000e+03, double %x ; <double> [#uses=1]
|
|
|
|
ret double %x_addr.0
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: clampTo3k_c:
|
2015-01-13 04:15:47 +08:00
|
|
|
; CHECK-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; CHECK-NEXT: maxsd %xmm0, %xmm1
|
|
|
|
; CHECK-NEXT: movaps %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: clampTo3k_c:
|
2015-01-13 04:15:47 +08:00
|
|
|
; UNSAFE-NEXT: maxsd {{[^,]*}}, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: clampTo3k_c:
|
2015-01-13 04:15:47 +08:00
|
|
|
; FINITE-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movaps %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2009-09-04 04:34:31 +08:00
|
|
|
define double @clampTo3k_c(double %x) nounwind readnone {
|
|
|
|
entry:
|
|
|
|
%0 = fcmp olt double %x, 3.000000e+03 ; <i1> [#uses=1]
|
|
|
|
%x_addr.0 = select i1 %0, double 3.000000e+03, double %x ; <double> [#uses=1]
|
|
|
|
ret double %x_addr.0
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: clampTo3k_d:
|
2015-01-13 04:15:47 +08:00
|
|
|
; CHECK-NEXT: maxsd {{[^,]*}}, %xmm0
|
|
|
|
; CHECK-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: clampTo3k_d:
|
2015-01-13 04:15:47 +08:00
|
|
|
; UNSAFE-NEXT: maxsd {{[^,]*}}, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: clampTo3k_d:
|
2015-01-13 04:15:47 +08:00
|
|
|
; FINITE-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movaps %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2009-09-04 04:34:31 +08:00
|
|
|
define double @clampTo3k_d(double %x) nounwind readnone {
|
|
|
|
entry:
|
|
|
|
%0 = fcmp ule double %x, 3.000000e+03 ; <i1> [#uses=1]
|
|
|
|
%x_addr.0 = select i1 %0, double 3.000000e+03, double %x ; <double> [#uses=1]
|
|
|
|
ret double %x_addr.0
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: clampTo3k_e:
|
2015-01-13 04:15:47 +08:00
|
|
|
; CHECK-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; CHECK-NEXT: maxsd %xmm0, %xmm1
|
|
|
|
; CHECK-NEXT: movaps %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: clampTo3k_e:
|
2015-01-13 04:15:47 +08:00
|
|
|
; UNSAFE-NEXT: maxsd {{[^,]*}}, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: clampTo3k_e:
|
2015-01-13 04:15:47 +08:00
|
|
|
; FINITE-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movaps %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2009-09-04 04:34:31 +08:00
|
|
|
define double @clampTo3k_e(double %x) nounwind readnone {
|
|
|
|
entry:
|
|
|
|
%0 = fcmp olt double %x, 3.000000e+03 ; <i1> [#uses=1]
|
|
|
|
%x_addr.0 = select i1 %0, double 3.000000e+03, double %x ; <double> [#uses=1]
|
|
|
|
ret double %x_addr.0
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: clampTo3k_f:
|
2015-01-13 04:15:47 +08:00
|
|
|
; CHECK-NEXT: maxsd {{[^,]*}}, %xmm0
|
|
|
|
; CHECK-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: clampTo3k_f:
|
2015-01-13 04:15:47 +08:00
|
|
|
; UNSAFE-NEXT: maxsd {{[^,]*}}, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: clampTo3k_f:
|
2015-01-13 04:15:47 +08:00
|
|
|
; FINITE-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movaps %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2009-09-04 04:34:31 +08:00
|
|
|
define double @clampTo3k_f(double %x) nounwind readnone {
|
|
|
|
entry:
|
|
|
|
%0 = fcmp ule double %x, 3.000000e+03 ; <i1> [#uses=1]
|
|
|
|
%x_addr.0 = select i1 %0, double 3.000000e+03, double %x ; <double> [#uses=1]
|
|
|
|
ret double %x_addr.0
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: clampTo3k_g:
|
2015-01-13 04:15:47 +08:00
|
|
|
; CHECK-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; CHECK-NEXT: minsd %xmm0, %xmm1
|
|
|
|
; CHECK-NEXT: movaps %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: clampTo3k_g:
|
2015-01-13 04:15:47 +08:00
|
|
|
; UNSAFE-NEXT: minsd {{[^,]*}}, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: clampTo3k_g:
|
2015-01-13 04:15:47 +08:00
|
|
|
; FINITE-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movaps %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2009-09-04 04:34:31 +08:00
|
|
|
define double @clampTo3k_g(double %x) nounwind readnone {
|
|
|
|
entry:
|
|
|
|
%0 = fcmp ogt double %x, 3.000000e+03 ; <i1> [#uses=1]
|
|
|
|
%x_addr.0 = select i1 %0, double 3.000000e+03, double %x ; <double> [#uses=1]
|
|
|
|
ret double %x_addr.0
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: clampTo3k_h:
|
2015-01-13 04:15:47 +08:00
|
|
|
; CHECK-NEXT: minsd {{[^,]*}}, %xmm0
|
|
|
|
; CHECK-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: clampTo3k_h:
|
2015-01-13 04:15:47 +08:00
|
|
|
; UNSAFE-NEXT: minsd {{[^,]*}}, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: clampTo3k_h:
|
2015-01-13 04:15:47 +08:00
|
|
|
; FINITE-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movaps %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2009-09-04 04:34:31 +08:00
|
|
|
define double @clampTo3k_h(double %x) nounwind readnone {
|
|
|
|
entry:
|
|
|
|
%0 = fcmp uge double %x, 3.000000e+03 ; <i1> [#uses=1]
|
|
|
|
%x_addr.0 = select i1 %0, double 3.000000e+03, double %x ; <double> [#uses=1]
|
|
|
|
ret double %x_addr.0
|
|
|
|
}
|
2011-09-18 00:49:39 +08:00
|
|
|
|
2013-07-19 06:29:15 +08:00
|
|
|
; UNSAFE-LABEL: test_maxpd:
|
2015-01-13 04:15:47 +08:00
|
|
|
; UNSAFE-NEXT: maxpd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
|
|
|
define <2 x double> @test_maxpd(<2 x double> %x, <2 x double> %y) nounwind {
|
2011-09-18 00:49:39 +08:00
|
|
|
%max_is_x = fcmp oge <2 x double> %x, %y
|
|
|
|
%max = select <2 x i1> %max_is_x, <2 x double> %x, <2 x double> %y
|
|
|
|
ret <2 x double> %max
|
|
|
|
}
|
|
|
|
|
2013-07-19 06:29:15 +08:00
|
|
|
; UNSAFE-LABEL: test_minpd:
|
2015-01-13 04:15:47 +08:00
|
|
|
; UNSAFE-NEXT: minpd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
|
|
|
define <2 x double> @test_minpd(<2 x double> %x, <2 x double> %y) nounwind {
|
2011-09-18 00:49:39 +08:00
|
|
|
%min_is_x = fcmp ole <2 x double> %x, %y
|
|
|
|
%min = select <2 x i1> %min_is_x, <2 x double> %x, <2 x double> %y
|
|
|
|
ret <2 x double> %min
|
|
|
|
}
|
|
|
|
|
2013-07-19 06:29:15 +08:00
|
|
|
; UNSAFE-LABEL: test_maxps:
|
2015-01-13 04:15:47 +08:00
|
|
|
; UNSAFE-NEXT: maxps %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
|
|
|
define <4 x float> @test_maxps(<4 x float> %x, <4 x float> %y) nounwind {
|
2011-09-18 00:49:39 +08:00
|
|
|
%max_is_x = fcmp oge <4 x float> %x, %y
|
|
|
|
%max = select <4 x i1> %max_is_x, <4 x float> %x, <4 x float> %y
|
|
|
|
ret <4 x float> %max
|
|
|
|
}
|
|
|
|
|
2013-07-19 06:29:15 +08:00
|
|
|
; UNSAFE-LABEL: test_minps:
|
2015-01-13 04:15:47 +08:00
|
|
|
; UNSAFE-NEXT: minps %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
|
|
|
define <4 x float> @test_minps(<4 x float> %x, <4 x float> %y) nounwind {
|
2011-09-18 00:49:39 +08:00
|
|
|
%min_is_x = fcmp ole <4 x float> %x, %y
|
|
|
|
%min = select <4 x i1> %min_is_x, <4 x float> %x, <4 x float> %y
|
|
|
|
ret <4 x float> %min
|
|
|
|
}
|
2015-01-13 04:31:30 +08:00
|
|
|
|
|
|
|
; UNSAFE-LABEL: test_maxps_illegal_v2f32:
|
|
|
|
; UNSAFE-NEXT: maxps %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
|
|
|
define <2 x float> @test_maxps_illegal_v2f32(<2 x float> %x, <2 x float> %y) nounwind {
|
|
|
|
%max_is_x = fcmp oge <2 x float> %x, %y
|
|
|
|
%max = select <2 x i1> %max_is_x, <2 x float> %x, <2 x float> %y
|
|
|
|
ret <2 x float> %max
|
|
|
|
}
|
|
|
|
|
|
|
|
; UNSAFE-LABEL: test_minps_illegal_v2f32:
|
|
|
|
; UNSAFE-NEXT: minps %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
|
|
|
define <2 x float> @test_minps_illegal_v2f32(<2 x float> %x, <2 x float> %y) nounwind {
|
|
|
|
%min_is_x = fcmp ole <2 x float> %x, %y
|
|
|
|
%min = select <2 x i1> %min_is_x, <2 x float> %x, <2 x float> %y
|
|
|
|
ret <2 x float> %min
|
|
|
|
}
|
|
|
|
|
|
|
|
; UNSAFE-LABEL: test_maxps_illegal_v3f32:
|
|
|
|
; UNSAFE-NEXT: maxps %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
|
|
|
define <3 x float> @test_maxps_illegal_v3f32(<3 x float> %x, <3 x float> %y) nounwind {
|
|
|
|
%max_is_x = fcmp oge <3 x float> %x, %y
|
|
|
|
%max = select <3 x i1> %max_is_x, <3 x float> %x, <3 x float> %y
|
|
|
|
ret <3 x float> %max
|
|
|
|
}
|
|
|
|
|
|
|
|
; UNSAFE-LABEL: test_minps_illegal_v3f32:
|
|
|
|
; UNSAFE-NEXT: minps %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
|
|
|
define <3 x float> @test_minps_illegal_v3f32(<3 x float> %x, <3 x float> %y) nounwind {
|
|
|
|
%min_is_x = fcmp ole <3 x float> %x, %y
|
|
|
|
%min = select <3 x i1> %min_is_x, <3 x float> %x, <3 x float> %y
|
|
|
|
ret <3 x float> %min
|
|
|
|
}
|