2011-05-05 01:54:59 +02:00
|
|
|
; RUN: llc < %s -march=x86-64 -asm-verbose=false -join-physregs | FileCheck %s
|
|
|
|
; RUN: llc < %s -march=x86-64 -asm-verbose=false -join-physregs -enable-unsafe-fp-math -enable-no-nans-fp-math | FileCheck -check-prefix=UNSAFE %s
|
|
|
|
; RUN: llc < %s -march=x86-64 -asm-verbose=false -join-physregs -enable-no-nans-fp-math | FileCheck -check-prefix=FINITE %s
|
2009-09-21 20:03:22 +02: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 07:52:40 +01:00
|
|
|
; The naming convention is {,x_,y_}{o,u}{gt,lt,ge,le}{,_inverse}
|
2009-09-21 20:03:22 +02:00
|
|
|
; x_ : use 0.0 instead of %y
|
2010-02-24 07:52:40 +01:00
|
|
|
; y_ : use -0.0 instead of %y
|
2009-09-21 20:03:22 +02:00
|
|
|
; _inverse : swap the arms of the select.
|
|
|
|
|
2011-05-05 01:54:59 +02:00
|
|
|
; Some of these tests depend on -join-physregs commuting instructions to
|
|
|
|
; eliminate copies.
|
|
|
|
|
2009-09-21 20:03:22 +02:00
|
|
|
; CHECK: ogt:
|
|
|
|
; CHECK-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: ret
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: ogt:
|
|
|
|
; UNSAFE-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: ogt:
|
|
|
|
; FINITE-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2009-09-21 20:03:22 +02: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
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: olt:
|
|
|
|
; CHECK-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: ret
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: olt:
|
|
|
|
; UNSAFE-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: olt:
|
|
|
|
; FINITE-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2009-09-21 20:03:22 +02: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
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: ogt_inverse:
|
|
|
|
; CHECK-NEXT: minsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; CHECK-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2009-09-21 20:03:22 +02:00
|
|
|
; CHECK-NEXT: ret
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: ogt_inverse:
|
|
|
|
; UNSAFE-NEXT: minsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; UNSAFE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE-NEXT: ret
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: ogt_inverse:
|
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE-NEXT: ret
|
2009-09-21 20:03:22 +02: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
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: olt_inverse:
|
|
|
|
; CHECK-NEXT: maxsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; CHECK-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2009-09-21 20:03:22 +02:00
|
|
|
; CHECK-NEXT: ret
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: olt_inverse:
|
|
|
|
; UNSAFE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; UNSAFE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE-NEXT: ret
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: olt_inverse:
|
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE-NEXT: ret
|
2009-09-21 20:03:22 +02: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
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: oge:
|
|
|
|
; CHECK-NEXT: ucomisd %xmm1, %xmm0
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: oge:
|
|
|
|
; UNSAFE-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: oge:
|
|
|
|
; FINITE-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2009-09-21 20:03:22 +02: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
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: ole:
|
|
|
|
; CHECK-NEXT: ucomisd %xmm0, %xmm1
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: ole:
|
|
|
|
; UNSAFE-NEXT: minsd %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: ole:
|
|
|
|
; FINITE-NEXT: minsd %xmm1, %xmm0
|
2009-09-21 20:03:22 +02: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
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: oge_inverse:
|
|
|
|
; CHECK-NEXT: ucomisd %xmm1, %xmm0
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: oge_inverse:
|
|
|
|
; UNSAFE-NEXT: minsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; UNSAFE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE-NEXT: ret
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: oge_inverse:
|
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE-NEXT: ret
|
2009-09-21 20:03:22 +02: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
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: ole_inverse:
|
|
|
|
; CHECK-NEXT: ucomisd %xmm0, %xmm1
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: ole_inverse:
|
|
|
|
; UNSAFE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; UNSAFE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE-NEXT: ret
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: ole_inverse:
|
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE-NEXT: ret
|
2009-09-21 20:03:22 +02: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
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: x_ogt:
|
|
|
|
; CHECK-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; CHECK-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: ret
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: x_ogt:
|
|
|
|
; UNSAFE-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; UNSAFE-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: x_ogt:
|
|
|
|
; FINITE-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; FINITE-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2009-09-21 20:03:22 +02:00
|
|
|
define double @x_ogt(double %x) nounwind {
|
|
|
|
%c = fcmp ogt double %x, 0.000000e+00
|
|
|
|
%d = select i1 %c, double %x, double 0.000000e+00
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: x_olt:
|
|
|
|
; CHECK-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; CHECK-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: ret
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: x_olt:
|
|
|
|
; UNSAFE-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; UNSAFE-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: x_olt:
|
|
|
|
; FINITE-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; FINITE-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2009-09-21 20:03:22 +02:00
|
|
|
define double @x_olt(double %x) nounwind {
|
|
|
|
%c = fcmp olt double %x, 0.000000e+00
|
|
|
|
%d = select i1 %c, double %x, double 0.000000e+00
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: x_ogt_inverse:
|
|
|
|
; CHECK-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; CHECK-NEXT: minsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; CHECK-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2009-09-21 20:03:22 +02:00
|
|
|
; CHECK-NEXT: ret
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: x_ogt_inverse:
|
|
|
|
; UNSAFE-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; UNSAFE-NEXT: minsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; UNSAFE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE-NEXT: ret
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: x_ogt_inverse:
|
|
|
|
; FINITE-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE-NEXT: ret
|
2009-09-21 20:03:22 +02:00
|
|
|
define double @x_ogt_inverse(double %x) nounwind {
|
|
|
|
%c = fcmp ogt double %x, 0.000000e+00
|
|
|
|
%d = select i1 %c, double 0.000000e+00, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: x_olt_inverse:
|
|
|
|
; CHECK-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; CHECK-NEXT: maxsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; CHECK-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2009-09-21 20:03:22 +02:00
|
|
|
; CHECK-NEXT: ret
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: x_olt_inverse:
|
|
|
|
; UNSAFE-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; UNSAFE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; UNSAFE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE-NEXT: ret
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: x_olt_inverse:
|
|
|
|
; FINITE-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE-NEXT: ret
|
2009-09-21 20:03:22 +02:00
|
|
|
define double @x_olt_inverse(double %x) nounwind {
|
|
|
|
%c = fcmp olt double %x, 0.000000e+00
|
|
|
|
%d = select i1 %c, double 0.000000e+00, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: x_oge:
|
2010-02-22 05:03:39 +01:00
|
|
|
; CHECK: ucomisd %xmm1, %xmm0
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: x_oge:
|
|
|
|
; UNSAFE-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; UNSAFE-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: x_oge:
|
|
|
|
; FINITE-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; FINITE-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2009-09-21 20:03:22 +02:00
|
|
|
define double @x_oge(double %x) nounwind {
|
|
|
|
%c = fcmp oge double %x, 0.000000e+00
|
|
|
|
%d = select i1 %c, double %x, double 0.000000e+00
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: x_ole:
|
2010-02-22 05:03:39 +01:00
|
|
|
; CHECK: ucomisd %xmm0, %xmm1
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: x_ole:
|
|
|
|
; UNSAFE-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; UNSAFE-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: x_ole:
|
|
|
|
; FINITE-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; FINITE-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2009-09-21 20:03:22 +02:00
|
|
|
define double @x_ole(double %x) nounwind {
|
|
|
|
%c = fcmp ole double %x, 0.000000e+00
|
|
|
|
%d = select i1 %c, double %x, double 0.000000e+00
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: x_oge_inverse:
|
2010-02-22 05:03:39 +01:00
|
|
|
; CHECK: ucomisd %xmm1, %xmm0
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: x_oge_inverse:
|
|
|
|
; UNSAFE-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; UNSAFE-NEXT: minsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; UNSAFE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE-NEXT: ret
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: x_oge_inverse:
|
|
|
|
; FINITE-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE-NEXT: ret
|
2009-09-21 20:03:22 +02:00
|
|
|
define double @x_oge_inverse(double %x) nounwind {
|
|
|
|
%c = fcmp oge double %x, 0.000000e+00
|
|
|
|
%d = select i1 %c, double 0.000000e+00, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: x_ole_inverse:
|
2010-02-22 05:03:39 +01:00
|
|
|
; CHECK: ucomisd %xmm0, %xmm1
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: x_ole_inverse:
|
|
|
|
; UNSAFE-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; UNSAFE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; UNSAFE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE-NEXT: ret
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: x_ole_inverse:
|
|
|
|
; FINITE-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE-NEXT: ret
|
2009-09-21 20:03:22 +02:00
|
|
|
define double @x_ole_inverse(double %x) nounwind {
|
|
|
|
%c = fcmp ole double %x, 0.000000e+00
|
|
|
|
%d = select i1 %c, double 0.000000e+00, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: ugt:
|
2010-02-22 05:03:39 +01:00
|
|
|
; CHECK: ucomisd %xmm0, %xmm1
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: ugt:
|
|
|
|
; UNSAFE-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: ugt:
|
|
|
|
; FINITE-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2009-09-21 20:03:22 +02: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
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: ult:
|
2010-02-22 05:03:39 +01:00
|
|
|
; CHECK: ucomisd %xmm1, %xmm0
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: ult:
|
|
|
|
; UNSAFE-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: ult:
|
|
|
|
; FINITE-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2009-09-21 20:03:22 +02: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
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: ugt_inverse:
|
2010-02-22 05:03:39 +01:00
|
|
|
; CHECK: ucomisd %xmm0, %xmm1
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: ugt_inverse:
|
|
|
|
; UNSAFE-NEXT: minsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; UNSAFE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE-NEXT: ret
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: ugt_inverse:
|
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE-NEXT: ret
|
2009-09-21 20:03:22 +02: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
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: ult_inverse:
|
2010-02-22 05:03:39 +01:00
|
|
|
; CHECK: ucomisd %xmm1, %xmm0
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: ult_inverse:
|
|
|
|
; UNSAFE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; UNSAFE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE-NEXT: ret
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: ult_inverse:
|
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE-NEXT: ret
|
2009-09-21 20:03:22 +02: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
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: uge:
|
2010-02-24 07:52:40 +01:00
|
|
|
; CHECK-NEXT: maxsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; CHECK-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2009-09-21 20:03:22 +02:00
|
|
|
; CHECK-NEXT: ret
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: uge:
|
|
|
|
; UNSAFE-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: uge:
|
|
|
|
; FINITE-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2009-09-21 20:03:22 +02: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
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: ule:
|
2010-02-24 07:52:40 +01:00
|
|
|
; CHECK-NEXT: minsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; CHECK-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2009-09-21 20:03:22 +02:00
|
|
|
; CHECK-NEXT: ret
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: ule:
|
|
|
|
; UNSAFE-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: ule:
|
|
|
|
; FINITE-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2009-09-21 20:03:22 +02: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
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: uge_inverse:
|
2010-02-24 07:52:40 +01:00
|
|
|
; CHECK-NEXT: minsd %xmm1, %xmm0
|
2009-09-21 20:03:22 +02:00
|
|
|
; CHECK-NEXT: ret
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: uge_inverse:
|
|
|
|
; UNSAFE-NEXT: minsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; UNSAFE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE-NEXT: ret
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: uge_inverse:
|
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE-NEXT: ret
|
2009-09-21 20:03:22 +02: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
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: ule_inverse:
|
2010-02-24 07:52:40 +01:00
|
|
|
; CHECK-NEXT: maxsd %xmm1, %xmm0
|
2009-09-21 20:03:22 +02:00
|
|
|
; CHECK-NEXT: ret
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: ule_inverse:
|
|
|
|
; UNSAFE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; UNSAFE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE-NEXT: ret
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: ule_inverse:
|
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE-NEXT: ret
|
2009-09-21 20:03:22 +02: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
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: x_ugt:
|
2010-02-22 05:03:39 +01:00
|
|
|
; CHECK: ucomisd %xmm0, %xmm1
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: x_ugt:
|
|
|
|
; UNSAFE-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; UNSAFE-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: x_ugt:
|
|
|
|
; FINITE-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; FINITE-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2009-09-21 20:03:22 +02:00
|
|
|
define double @x_ugt(double %x) nounwind {
|
|
|
|
%c = fcmp ugt double %x, 0.000000e+00
|
|
|
|
%d = select i1 %c, double %x, double 0.000000e+00
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: x_ult:
|
2010-02-22 05:03:39 +01:00
|
|
|
; CHECK: ucomisd %xmm1, %xmm0
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: x_ult:
|
|
|
|
; UNSAFE-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; UNSAFE-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: x_ult:
|
|
|
|
; FINITE-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; FINITE-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2009-09-21 20:03:22 +02:00
|
|
|
define double @x_ult(double %x) nounwind {
|
|
|
|
%c = fcmp ult double %x, 0.000000e+00
|
|
|
|
%d = select i1 %c, double %x, double 0.000000e+00
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: x_ugt_inverse:
|
2010-02-22 05:03:39 +01:00
|
|
|
; CHECK: ucomisd %xmm0, %xmm1
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: x_ugt_inverse:
|
|
|
|
; UNSAFE-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; UNSAFE-NEXT: minsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; UNSAFE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE-NEXT: ret
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: x_ugt_inverse:
|
|
|
|
; FINITE-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE-NEXT: ret
|
2009-09-21 20:03:22 +02:00
|
|
|
define double @x_ugt_inverse(double %x) nounwind {
|
|
|
|
%c = fcmp ugt double %x, 0.000000e+00
|
|
|
|
%d = select i1 %c, double 0.000000e+00, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: x_ult_inverse:
|
2010-02-22 05:03:39 +01:00
|
|
|
; CHECK: ucomisd %xmm1, %xmm0
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: x_ult_inverse:
|
|
|
|
; UNSAFE-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; UNSAFE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; UNSAFE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE-NEXT: ret
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: x_ult_inverse:
|
|
|
|
; FINITE-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE-NEXT: ret
|
2009-09-21 20:03:22 +02:00
|
|
|
define double @x_ult_inverse(double %x) nounwind {
|
|
|
|
%c = fcmp ult double %x, 0.000000e+00
|
|
|
|
%d = select i1 %c, double 0.000000e+00, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: x_uge:
|
|
|
|
; CHECK-NEXT: pxor %xmm1, %xmm1
|
2010-02-24 07:52:40 +01:00
|
|
|
; CHECK-NEXT: maxsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; CHECK-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2009-09-21 20:03:22 +02:00
|
|
|
; CHECK-NEXT: ret
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: x_uge:
|
|
|
|
; UNSAFE-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; UNSAFE-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: x_uge:
|
|
|
|
; FINITE-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; FINITE-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2009-09-21 20:03:22 +02:00
|
|
|
define double @x_uge(double %x) nounwind {
|
|
|
|
%c = fcmp uge double %x, 0.000000e+00
|
|
|
|
%d = select i1 %c, double %x, double 0.000000e+00
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: x_ule:
|
|
|
|
; CHECK-NEXT: pxor %xmm1, %xmm1
|
2010-02-24 07:52:40 +01:00
|
|
|
; CHECK-NEXT: minsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; CHECK-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2009-09-21 20:03:22 +02:00
|
|
|
; CHECK-NEXT: ret
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: x_ule:
|
|
|
|
; UNSAFE-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; UNSAFE-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: x_ule:
|
|
|
|
; FINITE-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; FINITE-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
2009-09-21 20:03:22 +02:00
|
|
|
define double @x_ule(double %x) nounwind {
|
|
|
|
%c = fcmp ule double %x, 0.000000e+00
|
|
|
|
%d = select i1 %c, double %x, double 0.000000e+00
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: x_uge_inverse:
|
|
|
|
; CHECK-NEXT: pxor %xmm1, %xmm1
|
2010-02-24 07:52:40 +01:00
|
|
|
; CHECK-NEXT: minsd %xmm1, %xmm0
|
2009-09-21 20:03:22 +02:00
|
|
|
; CHECK-NEXT: ret
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: x_uge_inverse:
|
|
|
|
; UNSAFE-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; UNSAFE-NEXT: minsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; UNSAFE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE-NEXT: ret
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: x_uge_inverse:
|
|
|
|
; FINITE-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE-NEXT: ret
|
2009-09-21 20:03:22 +02:00
|
|
|
define double @x_uge_inverse(double %x) nounwind {
|
|
|
|
%c = fcmp uge double %x, 0.000000e+00
|
|
|
|
%d = select i1 %c, double 0.000000e+00, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: x_ule_inverse:
|
|
|
|
; CHECK-NEXT: pxor %xmm1, %xmm1
|
2010-02-24 07:52:40 +01:00
|
|
|
; CHECK-NEXT: maxsd %xmm1, %xmm0
|
2009-09-21 20:03:22 +02:00
|
|
|
; CHECK-NEXT: ret
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: x_ule_inverse:
|
|
|
|
; UNSAFE-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; UNSAFE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; UNSAFE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE-NEXT: ret
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: x_ule_inverse:
|
|
|
|
; FINITE-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE-NEXT: ret
|
2009-09-21 20:03:22 +02:00
|
|
|
define double @x_ule_inverse(double %x) nounwind {
|
|
|
|
%c = fcmp ule double %x, 0.000000e+00
|
|
|
|
%d = select i1 %c, double 0.000000e+00, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2010-02-24 07:52:40 +01:00
|
|
|
; CHECK: y_ogt:
|
|
|
|
; CHECK-NEXT: maxsd {{[^,]*}}, %xmm0
|
|
|
|
; CHECK-NEXT: ret
|
|
|
|
; UNSAFE: y_ogt:
|
|
|
|
; UNSAFE-NEXT: maxsd {{[^,]*}}, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
|
|
|
; FINITE: y_ogt:
|
|
|
|
; FINITE-NEXT: maxsd {{[^,]*}}, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
|
|
|
define double @y_ogt(double %x) nounwind {
|
|
|
|
%c = fcmp ogt double %x, -0.000000e+00
|
|
|
|
%d = select i1 %c, double %x, double -0.000000e+00
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: y_olt:
|
|
|
|
; CHECK-NEXT: minsd {{[^,]*}}, %xmm0
|
|
|
|
; CHECK-NEXT: ret
|
|
|
|
; UNSAFE: y_olt:
|
|
|
|
; UNSAFE-NEXT: minsd {{[^,]*}}, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
|
|
|
; FINITE: y_olt:
|
|
|
|
; FINITE-NEXT: minsd {{[^,]*}}, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
|
|
|
define double @y_olt(double %x) nounwind {
|
|
|
|
%c = fcmp olt double %x, -0.000000e+00
|
|
|
|
%d = select i1 %c, double %x, double -0.000000e+00
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: y_ogt_inverse:
|
|
|
|
; CHECK-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; CHECK-NEXT: minsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; CHECK-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; CHECK-NEXT: ret
|
|
|
|
; UNSAFE: y_ogt_inverse:
|
|
|
|
; UNSAFE-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; UNSAFE-NEXT: minsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; UNSAFE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; UNSAFE-NEXT: ret
|
|
|
|
; FINITE: y_ogt_inverse:
|
|
|
|
; FINITE-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE-NEXT: ret
|
|
|
|
define double @y_ogt_inverse(double %x) nounwind {
|
|
|
|
%c = fcmp ogt double %x, -0.000000e+00
|
|
|
|
%d = select i1 %c, double -0.000000e+00, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: y_olt_inverse:
|
|
|
|
; CHECK-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; CHECK-NEXT: maxsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; CHECK-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; CHECK-NEXT: ret
|
|
|
|
; UNSAFE: y_olt_inverse:
|
|
|
|
; UNSAFE-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; UNSAFE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; UNSAFE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; UNSAFE-NEXT: ret
|
|
|
|
; FINITE: y_olt_inverse:
|
|
|
|
; FINITE-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE-NEXT: ret
|
|
|
|
define double @y_olt_inverse(double %x) nounwind {
|
|
|
|
%c = fcmp olt double %x, -0.000000e+00
|
|
|
|
%d = select i1 %c, double -0.000000e+00, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: y_oge:
|
|
|
|
; CHECK: ucomisd %xmm1, %xmm0
|
|
|
|
; UNSAFE: y_oge:
|
|
|
|
; UNSAFE-NEXT: maxsd {{[^,]*}}, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
|
|
|
; FINITE: y_oge:
|
|
|
|
; FINITE-NEXT: maxsd {{[^,]*}}, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
|
|
|
define double @y_oge(double %x) nounwind {
|
|
|
|
%c = fcmp oge double %x, -0.000000e+00
|
|
|
|
%d = select i1 %c, double %x, double -0.000000e+00
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: y_ole:
|
|
|
|
; CHECK: ucomisd %xmm0, %xmm1
|
|
|
|
; UNSAFE: y_ole:
|
|
|
|
; UNSAFE-NEXT: minsd {{[^,]*}}, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
|
|
|
; FINITE: y_ole:
|
|
|
|
; FINITE-NEXT: minsd {{[^,]*}}, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
|
|
|
define double @y_ole(double %x) nounwind {
|
|
|
|
%c = fcmp ole double %x, -0.000000e+00
|
|
|
|
%d = select i1 %c, double %x, double -0.000000e+00
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: y_oge_inverse:
|
|
|
|
; CHECK: ucomisd %xmm1, %xmm0
|
|
|
|
; UNSAFE: y_oge_inverse:
|
|
|
|
; UNSAFE-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; UNSAFE-NEXT: minsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; UNSAFE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; UNSAFE-NEXT: ret
|
|
|
|
; FINITE: y_oge_inverse:
|
|
|
|
; FINITE-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE-NEXT: ret
|
|
|
|
define double @y_oge_inverse(double %x) nounwind {
|
|
|
|
%c = fcmp oge double %x, -0.000000e+00
|
|
|
|
%d = select i1 %c, double -0.000000e+00, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: y_ole_inverse:
|
|
|
|
; CHECK: ucomisd %xmm0, %xmm1
|
|
|
|
; UNSAFE: y_ole_inverse:
|
|
|
|
; UNSAFE-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; UNSAFE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; UNSAFE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; UNSAFE-NEXT: ret
|
|
|
|
; FINITE: y_ole_inverse:
|
|
|
|
; FINITE-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE-NEXT: ret
|
|
|
|
define double @y_ole_inverse(double %x) nounwind {
|
|
|
|
%c = fcmp ole double %x, -0.000000e+00
|
|
|
|
%d = select i1 %c, double -0.000000e+00, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: y_ugt:
|
|
|
|
; CHECK: ucomisd %xmm0, %xmm1
|
|
|
|
; UNSAFE: y_ugt:
|
|
|
|
; UNSAFE-NEXT: maxsd {{[^,]*}}, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
|
|
|
; FINITE: y_ugt:
|
|
|
|
; FINITE-NEXT: maxsd {{[^,]*}}, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
|
|
|
define double @y_ugt(double %x) nounwind {
|
|
|
|
%c = fcmp ugt double %x, -0.000000e+00
|
|
|
|
%d = select i1 %c, double %x, double -0.000000e+00
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: y_ult:
|
|
|
|
; CHECK: ucomisd %xmm1, %xmm0
|
|
|
|
; UNSAFE: y_ult:
|
|
|
|
; UNSAFE-NEXT: minsd {{[^,]*}}, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
|
|
|
; FINITE: y_ult:
|
|
|
|
; FINITE-NEXT: minsd {{[^,]*}}, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
|
|
|
define double @y_ult(double %x) nounwind {
|
|
|
|
%c = fcmp ult double %x, -0.000000e+00
|
|
|
|
%d = select i1 %c, double %x, double -0.000000e+00
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: y_ugt_inverse:
|
|
|
|
; CHECK: ucomisd %xmm0, %xmm1
|
|
|
|
; UNSAFE: y_ugt_inverse:
|
|
|
|
; UNSAFE-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; UNSAFE-NEXT: minsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; UNSAFE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; UNSAFE-NEXT: ret
|
|
|
|
; FINITE: y_ugt_inverse:
|
|
|
|
; FINITE-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE-NEXT: ret
|
|
|
|
define double @y_ugt_inverse(double %x) nounwind {
|
|
|
|
%c = fcmp ugt double %x, -0.000000e+00
|
|
|
|
%d = select i1 %c, double -0.000000e+00, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: y_ult_inverse:
|
|
|
|
; CHECK: ucomisd %xmm1, %xmm0
|
|
|
|
; UNSAFE: y_ult_inverse:
|
|
|
|
; UNSAFE-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; UNSAFE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; UNSAFE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; UNSAFE-NEXT: ret
|
|
|
|
; FINITE: y_ult_inverse:
|
|
|
|
; FINITE-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE-NEXT: ret
|
|
|
|
define double @y_ult_inverse(double %x) nounwind {
|
|
|
|
%c = fcmp ult double %x, -0.000000e+00
|
|
|
|
%d = select i1 %c, double -0.000000e+00, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: y_uge:
|
|
|
|
; CHECK-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; CHECK-NEXT: maxsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; CHECK-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; CHECK-NEXT: ret
|
|
|
|
; UNSAFE: y_uge:
|
|
|
|
; UNSAFE-NEXT: maxsd {{[^,]*}}, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
|
|
|
; FINITE: y_uge:
|
|
|
|
; FINITE-NEXT: maxsd {{[^,]*}}, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
|
|
|
define double @y_uge(double %x) nounwind {
|
|
|
|
%c = fcmp uge double %x, -0.000000e+00
|
|
|
|
%d = select i1 %c, double %x, double -0.000000e+00
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: y_ule:
|
|
|
|
; CHECK-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; CHECK-NEXT: minsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; CHECK-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; CHECK-NEXT: ret
|
|
|
|
; UNSAFE: y_ule:
|
|
|
|
; UNSAFE-NEXT: minsd {{[^,]*}}, %xmm0
|
|
|
|
; UNSAFE-NEXT: ret
|
|
|
|
; FINITE: y_ule:
|
|
|
|
; FINITE-NEXT: minsd {{[^,]*}}, %xmm0
|
|
|
|
; FINITE-NEXT: ret
|
|
|
|
define double @y_ule(double %x) nounwind {
|
|
|
|
%c = fcmp ule double %x, -0.000000e+00
|
|
|
|
%d = select i1 %c, double %x, double -0.000000e+00
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: y_uge_inverse:
|
|
|
|
; CHECK-NEXT: minsd {{[^,]*}}, %xmm0
|
|
|
|
; CHECK-NEXT: ret
|
|
|
|
; UNSAFE: y_uge_inverse:
|
|
|
|
; UNSAFE-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; UNSAFE-NEXT: minsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; UNSAFE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; UNSAFE-NEXT: ret
|
|
|
|
; FINITE: y_uge_inverse:
|
|
|
|
; FINITE-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE-NEXT: ret
|
|
|
|
define double @y_uge_inverse(double %x) nounwind {
|
|
|
|
%c = fcmp uge double %x, -0.000000e+00
|
|
|
|
%d = select i1 %c, double -0.000000e+00, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: y_ule_inverse:
|
|
|
|
; CHECK-NEXT: maxsd {{[^,]*}}, %xmm0
|
|
|
|
; CHECK-NEXT: ret
|
|
|
|
; UNSAFE: y_ule_inverse:
|
|
|
|
; UNSAFE-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; UNSAFE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; UNSAFE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; UNSAFE-NEXT: ret
|
|
|
|
; FINITE: y_ule_inverse:
|
|
|
|
; FINITE-NEXT: movsd {{[^,]*}}, %xmm1
|
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
2010-07-09 22:43:09 +02:00
|
|
|
; FINITE-NEXT: movap{{[sd]}} %xmm1, %xmm0
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE-NEXT: ret
|
|
|
|
define double @y_ule_inverse(double %x) nounwind {
|
|
|
|
%c = fcmp ule double %x, -0.000000e+00
|
|
|
|
%d = select i1 %c, double -0.000000e+00, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
2009-09-21 20:03:22 +02:00
|
|
|
; Test a few more misc. cases.
|
2009-09-03 22:34:31 +02:00
|
|
|
|
|
|
|
; CHECK: clampTo3k_a:
|
|
|
|
; CHECK: minsd
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: clampTo3k_a:
|
|
|
|
; UNSAFE: minsd
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: clampTo3k_a:
|
|
|
|
; FINITE: minsd
|
2009-09-03 22:34:31 +02: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
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: clampTo3k_b:
|
|
|
|
; CHECK: minsd
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: clampTo3k_b:
|
|
|
|
; UNSAFE: minsd
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: clampTo3k_b:
|
|
|
|
; FINITE: minsd
|
2009-09-03 22:34:31 +02: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
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: clampTo3k_c:
|
|
|
|
; CHECK: maxsd
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: clampTo3k_c:
|
|
|
|
; UNSAFE: maxsd
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: clampTo3k_c:
|
|
|
|
; FINITE: maxsd
|
2009-09-03 22:34:31 +02: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
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: clampTo3k_d:
|
|
|
|
; CHECK: maxsd
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: clampTo3k_d:
|
|
|
|
; UNSAFE: maxsd
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: clampTo3k_d:
|
|
|
|
; FINITE: maxsd
|
2009-09-03 22:34:31 +02: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
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: clampTo3k_e:
|
|
|
|
; CHECK: maxsd
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: clampTo3k_e:
|
|
|
|
; UNSAFE: maxsd
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: clampTo3k_e:
|
|
|
|
; FINITE: maxsd
|
2009-09-03 22:34:31 +02: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
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: clampTo3k_f:
|
|
|
|
; CHECK: maxsd
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: clampTo3k_f:
|
|
|
|
; UNSAFE: maxsd
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: clampTo3k_f:
|
|
|
|
; FINITE: maxsd
|
2009-09-03 22:34:31 +02: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
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: clampTo3k_g:
|
|
|
|
; CHECK: minsd
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: clampTo3k_g:
|
|
|
|
; UNSAFE: minsd
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: clampTo3k_g:
|
|
|
|
; FINITE: minsd
|
2009-09-03 22:34:31 +02: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
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: clampTo3k_h:
|
|
|
|
; CHECK: minsd
|
2010-02-22 19:53:26 +01:00
|
|
|
; UNSAFE: clampTo3k_h:
|
|
|
|
; UNSAFE: minsd
|
2010-02-24 07:52:40 +01:00
|
|
|
; FINITE: clampTo3k_h:
|
|
|
|
; FINITE: minsd
|
2009-09-03 22:34:31 +02: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
|
|
|
|
}
|