2017-01-14 00:37:38 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
2016-11-16 06:33:16 +08:00
|
|
|
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=sse4.2 | FileCheck %s --check-prefix=ALL --check-prefix=STRICT
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=sse4.2 -enable-unsafe-fp-math -enable-no-nans-fp-math | FileCheck %s --check-prefix=ALL --check-prefix=RELAX --check-prefix=UNSAFE
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=sse4.2 -enable-no-nans-fp-math | FileCheck %s --check-prefix=ALL --check-prefix=RELAX --check-prefix=FINITE
|
2009-09-22 02:03:22 +08:00
|
|
|
|
|
|
|
; Some of these patterns can be matched as SSE min or max. Some of
|
2015-12-06 03:54:59 +08:00
|
|
|
; them can be matched provided that the operands are swapped.
|
2009-09-22 02:03:22 +08:00
|
|
|
; 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.
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @ogt(double %x, double %y) {
|
|
|
|
; ALL-LABEL: ogt:
|
2017-12-05 01:18:51 +08:00
|
|
|
; ALL: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; ALL-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; ALL-NEXT: retq
|
2009-09-22 02:03:22 +08:00
|
|
|
%c = fcmp ogt double %x, %y
|
|
|
|
%d = select i1 %c, double %x, double %y
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @olt(double %x, double %y) {
|
|
|
|
; ALL-LABEL: olt:
|
2017-12-05 01:18:51 +08:00
|
|
|
; ALL: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; ALL-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; ALL-NEXT: retq
|
2009-09-22 02:03:22 +08:00
|
|
|
%c = fcmp olt double %x, %y
|
|
|
|
%d = select i1 %c, double %x, double %y
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @ogt_inverse(double %x, double %y) {
|
|
|
|
; STRICT-LABEL: ogt_inverse:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: minsd %xmm0, %xmm1
|
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; UNSAFE-LABEL: ogt_inverse:
|
2017-12-05 01:18:51 +08:00
|
|
|
; UNSAFE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; UNSAFE-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: retq
|
|
|
|
;
|
|
|
|
; FINITE-LABEL: ogt_inverse:
|
2017-12-05 01:18:51 +08:00
|
|
|
; FINITE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: retq
|
2009-09-22 02:03:22 +08:00
|
|
|
%c = fcmp ogt double %x, %y
|
|
|
|
%d = select i1 %c, double %y, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @olt_inverse(double %x, double %y) {
|
|
|
|
; STRICT-LABEL: olt_inverse:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: maxsd %xmm0, %xmm1
|
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; UNSAFE-LABEL: olt_inverse:
|
2017-12-05 01:18:51 +08:00
|
|
|
; UNSAFE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; UNSAFE-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: retq
|
|
|
|
;
|
|
|
|
; FINITE-LABEL: olt_inverse:
|
2017-12-05 01:18:51 +08:00
|
|
|
; FINITE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: retq
|
2009-09-22 02:03:22 +08:00
|
|
|
%c = fcmp olt double %x, %y
|
|
|
|
%d = select i1 %c, double %y, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @oge(double %x, double %y) {
|
|
|
|
; STRICT-LABEL: oge:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm2
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: cmplesd %xmm0, %xmm2
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: andpd %xmm2, %xmm0
|
|
|
|
; STRICT-NEXT: andnpd %xmm1, %xmm2
|
|
|
|
; STRICT-NEXT: orpd %xmm2, %xmm0
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; RELAX-LABEL: oge:
|
2017-12-05 01:18:51 +08:00
|
|
|
; RELAX: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; RELAX-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; RELAX-NEXT: retq
|
2009-09-22 02:03:22 +08:00
|
|
|
%c = fcmp oge double %x, %y
|
|
|
|
%d = select i1 %c, double %x, double %y
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @ole(double %x, double %y) {
|
|
|
|
; STRICT-LABEL: ole:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: movapd %xmm0, %xmm2
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: cmplesd %xmm1, %xmm2
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: andpd %xmm2, %xmm0
|
|
|
|
; STRICT-NEXT: andnpd %xmm1, %xmm2
|
|
|
|
; STRICT-NEXT: orpd %xmm0, %xmm2
|
|
|
|
; STRICT-NEXT: movapd %xmm2, %xmm0
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; RELAX-LABEL: ole:
|
2017-12-05 01:18:51 +08:00
|
|
|
; RELAX: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; RELAX-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; RELAX-NEXT: retq
|
2009-09-22 02:03:22 +08:00
|
|
|
%c = fcmp ole double %x, %y
|
|
|
|
%d = select i1 %c, double %x, double %y
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @oge_inverse(double %x, double %y) {
|
|
|
|
; STRICT-LABEL: oge_inverse:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm2
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: cmplesd %xmm0, %xmm2
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: andpd %xmm2, %xmm1
|
|
|
|
; STRICT-NEXT: andnpd %xmm0, %xmm2
|
|
|
|
; STRICT-NEXT: orpd %xmm1, %xmm2
|
|
|
|
; STRICT-NEXT: movapd %xmm2, %xmm0
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; UNSAFE-LABEL: oge_inverse:
|
2017-12-05 01:18:51 +08:00
|
|
|
; UNSAFE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; UNSAFE-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: retq
|
|
|
|
;
|
|
|
|
; FINITE-LABEL: oge_inverse:
|
2017-12-05 01:18:51 +08:00
|
|
|
; FINITE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: retq
|
2009-09-22 02:03:22 +08:00
|
|
|
%c = fcmp oge double %x, %y
|
|
|
|
%d = select i1 %c, double %y, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @ole_inverse(double %x, double %y) {
|
|
|
|
; STRICT-LABEL: ole_inverse:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: movapd %xmm0, %xmm2
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: cmplesd %xmm1, %xmm2
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: andpd %xmm2, %xmm1
|
|
|
|
; STRICT-NEXT: andnpd %xmm0, %xmm2
|
|
|
|
; STRICT-NEXT: orpd %xmm1, %xmm2
|
|
|
|
; STRICT-NEXT: movapd %xmm2, %xmm0
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; UNSAFE-LABEL: ole_inverse:
|
2017-12-05 01:18:51 +08:00
|
|
|
; UNSAFE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; UNSAFE-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: retq
|
|
|
|
;
|
|
|
|
; FINITE-LABEL: ole_inverse:
|
2017-12-05 01:18:51 +08:00
|
|
|
; FINITE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: retq
|
2009-09-22 02:03:22 +08:00
|
|
|
%c = fcmp ole double %x, %y
|
|
|
|
%d = select i1 %c, double %y, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @ogt_x(double %x) {
|
|
|
|
; ALL-LABEL: ogt_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; ALL: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; ALL-NEXT: xorpd %xmm1, %xmm1
|
|
|
|
; ALL-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; ALL-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @olt_x(double %x) {
|
|
|
|
; ALL-LABEL: olt_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; ALL: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; ALL-NEXT: xorpd %xmm1, %xmm1
|
|
|
|
; ALL-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; ALL-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @ogt_inverse_x(double %x) {
|
|
|
|
; STRICT-LABEL: ogt_inverse_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: xorpd %xmm1, %xmm1
|
|
|
|
; STRICT-NEXT: minsd %xmm0, %xmm1
|
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; UNSAFE-LABEL: ogt_inverse_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; UNSAFE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; UNSAFE-NEXT: xorpd %xmm1, %xmm1
|
|
|
|
; UNSAFE-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: retq
|
|
|
|
;
|
|
|
|
; FINITE-LABEL: ogt_inverse_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; FINITE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; FINITE-NEXT: xorpd %xmm1, %xmm1
|
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @olt_inverse_x(double %x) {
|
|
|
|
; STRICT-LABEL: olt_inverse_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: xorpd %xmm1, %xmm1
|
|
|
|
; STRICT-NEXT: maxsd %xmm0, %xmm1
|
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; UNSAFE-LABEL: olt_inverse_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; UNSAFE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; UNSAFE-NEXT: xorpd %xmm1, %xmm1
|
|
|
|
; UNSAFE-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: retq
|
|
|
|
;
|
|
|
|
; FINITE-LABEL: olt_inverse_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; FINITE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; FINITE-NEXT: xorpd %xmm1, %xmm1
|
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @oge_x(double %x) {
|
|
|
|
; STRICT-LABEL: oge_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: xorpd %xmm1, %xmm1
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: cmplesd %xmm0, %xmm1
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: andpd %xmm1, %xmm0
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; RELAX-LABEL: oge_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; RELAX: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; RELAX-NEXT: xorpd %xmm1, %xmm1
|
|
|
|
; RELAX-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; RELAX-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @ole_x(double %x) {
|
|
|
|
; STRICT-LABEL: ole_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: xorpd %xmm2, %xmm2
|
|
|
|
; STRICT-NEXT: movapd %xmm0, %xmm1
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: cmplesd %xmm2, %xmm1
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: andpd %xmm0, %xmm1
|
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm0
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; RELAX-LABEL: ole_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; RELAX: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; RELAX-NEXT: xorpd %xmm1, %xmm1
|
|
|
|
; RELAX-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; RELAX-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @oge_inverse_x(double %x) {
|
|
|
|
; STRICT-LABEL: oge_inverse_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: xorpd %xmm1, %xmm1
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: cmplesd %xmm0, %xmm1
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: andnpd %xmm0, %xmm1
|
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm0
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; UNSAFE-LABEL: oge_inverse_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; UNSAFE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; UNSAFE-NEXT: xorpd %xmm1, %xmm1
|
|
|
|
; UNSAFE-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: retq
|
|
|
|
;
|
|
|
|
; FINITE-LABEL: oge_inverse_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; FINITE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; FINITE-NEXT: xorpd %xmm1, %xmm1
|
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @ole_inverse_x(double %x) {
|
|
|
|
; STRICT-LABEL: ole_inverse_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: xorpd %xmm2, %xmm2
|
|
|
|
; STRICT-NEXT: movapd %xmm0, %xmm1
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: cmplesd %xmm2, %xmm1
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: andnpd %xmm0, %xmm1
|
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm0
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; UNSAFE-LABEL: ole_inverse_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; UNSAFE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; UNSAFE-NEXT: xorpd %xmm1, %xmm1
|
|
|
|
; UNSAFE-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: retq
|
|
|
|
;
|
|
|
|
; FINITE-LABEL: ole_inverse_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; FINITE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; FINITE-NEXT: xorpd %xmm1, %xmm1
|
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @ugt(double %x, double %y) {
|
|
|
|
; STRICT-LABEL: ugt:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: movapd %xmm0, %xmm2
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: cmpnlesd %xmm1, %xmm2
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: andpd %xmm2, %xmm0
|
|
|
|
; STRICT-NEXT: andnpd %xmm1, %xmm2
|
|
|
|
; STRICT-NEXT: orpd %xmm0, %xmm2
|
|
|
|
; STRICT-NEXT: movapd %xmm2, %xmm0
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; RELAX-LABEL: ugt:
|
2017-12-05 01:18:51 +08:00
|
|
|
; RELAX: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; RELAX-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; RELAX-NEXT: retq
|
2009-09-22 02:03:22 +08:00
|
|
|
%c = fcmp ugt double %x, %y
|
|
|
|
%d = select i1 %c, double %x, double %y
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @ult(double %x, double %y) {
|
|
|
|
; STRICT-LABEL: ult:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm2
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: cmpnlesd %xmm0, %xmm2
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: andpd %xmm2, %xmm0
|
|
|
|
; STRICT-NEXT: andnpd %xmm1, %xmm2
|
|
|
|
; STRICT-NEXT: orpd %xmm2, %xmm0
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; RELAX-LABEL: ult:
|
2017-12-05 01:18:51 +08:00
|
|
|
; RELAX: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; RELAX-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; RELAX-NEXT: retq
|
2009-09-22 02:03:22 +08:00
|
|
|
%c = fcmp ult double %x, %y
|
|
|
|
%d = select i1 %c, double %x, double %y
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @ugt_inverse(double %x, double %y) {
|
|
|
|
; STRICT-LABEL: ugt_inverse:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: movapd %xmm0, %xmm2
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: cmpnlesd %xmm1, %xmm2
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: andpd %xmm2, %xmm1
|
|
|
|
; STRICT-NEXT: andnpd %xmm0, %xmm2
|
|
|
|
; STRICT-NEXT: orpd %xmm1, %xmm2
|
|
|
|
; STRICT-NEXT: movapd %xmm2, %xmm0
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; UNSAFE-LABEL: ugt_inverse:
|
2017-12-05 01:18:51 +08:00
|
|
|
; UNSAFE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; UNSAFE-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: retq
|
|
|
|
;
|
|
|
|
; FINITE-LABEL: ugt_inverse:
|
2017-12-05 01:18:51 +08:00
|
|
|
; FINITE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: retq
|
2009-09-22 02:03:22 +08:00
|
|
|
%c = fcmp ugt double %x, %y
|
|
|
|
%d = select i1 %c, double %y, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @ult_inverse(double %x, double %y) {
|
|
|
|
; STRICT-LABEL: ult_inverse:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm2
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: cmpnlesd %xmm0, %xmm2
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: andpd %xmm2, %xmm1
|
|
|
|
; STRICT-NEXT: andnpd %xmm0, %xmm2
|
|
|
|
; STRICT-NEXT: orpd %xmm1, %xmm2
|
|
|
|
; STRICT-NEXT: movapd %xmm2, %xmm0
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; UNSAFE-LABEL: ult_inverse:
|
2017-12-05 01:18:51 +08:00
|
|
|
; UNSAFE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; UNSAFE-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: retq
|
|
|
|
;
|
|
|
|
; FINITE-LABEL: ult_inverse:
|
2017-12-05 01:18:51 +08:00
|
|
|
; FINITE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: retq
|
2009-09-22 02:03:22 +08:00
|
|
|
%c = fcmp ult double %x, %y
|
|
|
|
%d = select i1 %c, double %y, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @uge(double %x, double %y) {
|
|
|
|
; STRICT-LABEL: uge:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: maxsd %xmm0, %xmm1
|
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; RELAX-LABEL: uge:
|
2017-12-05 01:18:51 +08:00
|
|
|
; RELAX: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; RELAX-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; RELAX-NEXT: retq
|
2009-09-22 02:03:22 +08:00
|
|
|
%c = fcmp uge double %x, %y
|
|
|
|
%d = select i1 %c, double %x, double %y
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @ule(double %x, double %y) {
|
|
|
|
; STRICT-LABEL: ule:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: minsd %xmm0, %xmm1
|
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; RELAX-LABEL: ule:
|
2017-12-05 01:18:51 +08:00
|
|
|
; RELAX: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; RELAX-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; RELAX-NEXT: retq
|
2009-09-22 02:03:22 +08:00
|
|
|
%c = fcmp ule double %x, %y
|
|
|
|
%d = select i1 %c, double %x, double %y
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @uge_inverse(double %x, double %y) {
|
|
|
|
; STRICT-LABEL: uge_inverse:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; UNSAFE-LABEL: uge_inverse:
|
2017-12-05 01:18:51 +08:00
|
|
|
; UNSAFE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; UNSAFE-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: retq
|
|
|
|
;
|
|
|
|
; FINITE-LABEL: uge_inverse:
|
2017-12-05 01:18:51 +08:00
|
|
|
; FINITE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: retq
|
2009-09-22 02:03:22 +08:00
|
|
|
%c = fcmp uge double %x, %y
|
|
|
|
%d = select i1 %c, double %y, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @ule_inverse(double %x, double %y) {
|
|
|
|
; STRICT-LABEL: ule_inverse:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; UNSAFE-LABEL: ule_inverse:
|
2017-12-05 01:18:51 +08:00
|
|
|
; UNSAFE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; UNSAFE-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: retq
|
|
|
|
;
|
|
|
|
; FINITE-LABEL: ule_inverse:
|
2017-12-05 01:18:51 +08:00
|
|
|
; FINITE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: retq
|
2009-09-22 02:03:22 +08:00
|
|
|
%c = fcmp ule double %x, %y
|
|
|
|
%d = select i1 %c, double %y, double %x
|
|
|
|
ret double %d
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @ugt_x(double %x) {
|
|
|
|
; STRICT-LABEL: ugt_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: xorpd %xmm2, %xmm2
|
|
|
|
; STRICT-NEXT: movapd %xmm0, %xmm1
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: cmpnlesd %xmm2, %xmm1
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: andpd %xmm0, %xmm1
|
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm0
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; RELAX-LABEL: ugt_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; RELAX: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; RELAX-NEXT: xorpd %xmm1, %xmm1
|
|
|
|
; RELAX-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; RELAX-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @ult_x(double %x) {
|
|
|
|
; STRICT-LABEL: ult_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: xorpd %xmm1, %xmm1
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: cmpnlesd %xmm0, %xmm1
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: andpd %xmm1, %xmm0
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; RELAX-LABEL: ult_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; RELAX: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; RELAX-NEXT: xorpd %xmm1, %xmm1
|
|
|
|
; RELAX-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; RELAX-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @ugt_inverse_x(double %x) {
|
|
|
|
; STRICT-LABEL: ugt_inverse_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: xorpd %xmm2, %xmm2
|
|
|
|
; STRICT-NEXT: movapd %xmm0, %xmm1
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: cmpnlesd %xmm2, %xmm1
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: andnpd %xmm0, %xmm1
|
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm0
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; UNSAFE-LABEL: ugt_inverse_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; UNSAFE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; UNSAFE-NEXT: xorpd %xmm1, %xmm1
|
|
|
|
; UNSAFE-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: retq
|
|
|
|
;
|
|
|
|
; FINITE-LABEL: ugt_inverse_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; FINITE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; FINITE-NEXT: xorpd %xmm1, %xmm1
|
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @ult_inverse_x(double %x) {
|
|
|
|
; STRICT-LABEL: ult_inverse_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: xorpd %xmm1, %xmm1
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: cmpnlesd %xmm0, %xmm1
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: andnpd %xmm0, %xmm1
|
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm0
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; UNSAFE-LABEL: ult_inverse_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; UNSAFE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; UNSAFE-NEXT: xorpd %xmm1, %xmm1
|
|
|
|
; UNSAFE-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: retq
|
|
|
|
;
|
|
|
|
; FINITE-LABEL: ult_inverse_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; FINITE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; FINITE-NEXT: xorpd %xmm1, %xmm1
|
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @uge_x(double %x) {
|
|
|
|
; STRICT-LABEL: uge_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: xorpd %xmm1, %xmm1
|
|
|
|
; STRICT-NEXT: maxsd %xmm0, %xmm1
|
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; RELAX-LABEL: uge_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; RELAX: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; RELAX-NEXT: xorpd %xmm1, %xmm1
|
|
|
|
; RELAX-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; RELAX-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @ule_x(double %x) {
|
|
|
|
; STRICT-LABEL: ule_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: xorpd %xmm1, %xmm1
|
|
|
|
; STRICT-NEXT: minsd %xmm0, %xmm1
|
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; RELAX-LABEL: ule_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; RELAX: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; RELAX-NEXT: xorpd %xmm1, %xmm1
|
|
|
|
; RELAX-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; RELAX-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @uge_inverse_x(double %x) {
|
|
|
|
; STRICT-LABEL: uge_inverse_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: xorpd %xmm1, %xmm1
|
|
|
|
; STRICT-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; UNSAFE-LABEL: uge_inverse_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; UNSAFE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; UNSAFE-NEXT: xorpd %xmm1, %xmm1
|
|
|
|
; UNSAFE-NEXT: minsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: retq
|
|
|
|
;
|
|
|
|
; FINITE-LABEL: uge_inverse_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; FINITE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; FINITE-NEXT: xorpd %xmm1, %xmm1
|
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @ule_inverse_x(double %x) {
|
|
|
|
; STRICT-LABEL: ule_inverse_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: xorpd %xmm1, %xmm1
|
|
|
|
; STRICT-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; UNSAFE-LABEL: ule_inverse_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; UNSAFE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; UNSAFE-NEXT: xorpd %xmm1, %xmm1
|
|
|
|
; UNSAFE-NEXT: maxsd %xmm1, %xmm0
|
|
|
|
; UNSAFE-NEXT: retq
|
|
|
|
;
|
|
|
|
; FINITE-LABEL: ule_inverse_x:
|
2017-12-05 01:18:51 +08:00
|
|
|
; FINITE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; FINITE-NEXT: xorpd %xmm1, %xmm1
|
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @ogt_y(double %x) {
|
|
|
|
; ALL-LABEL: ogt_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; ALL: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; ALL-NEXT: maxsd {{.*}}(%rip), %xmm0
|
|
|
|
; ALL-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @olt_y(double %x) {
|
|
|
|
; ALL-LABEL: olt_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; ALL: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; ALL-NEXT: minsd {{.*}}(%rip), %xmm0
|
|
|
|
; ALL-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @ogt_inverse_y(double %x) {
|
|
|
|
; STRICT-LABEL: ogt_inverse_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
|
|
|
|
; STRICT-NEXT: minsd %xmm0, %xmm1
|
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; UNSAFE-LABEL: ogt_inverse_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; UNSAFE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; UNSAFE-NEXT: minsd {{.*}}(%rip), %xmm0
|
|
|
|
; UNSAFE-NEXT: retq
|
|
|
|
;
|
|
|
|
; FINITE-LABEL: ogt_inverse_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; FINITE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; FINITE-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
|
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @olt_inverse_y(double %x) {
|
|
|
|
; STRICT-LABEL: olt_inverse_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
|
|
|
|
; STRICT-NEXT: maxsd %xmm0, %xmm1
|
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; UNSAFE-LABEL: olt_inverse_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; UNSAFE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; UNSAFE-NEXT: maxsd {{.*}}(%rip), %xmm0
|
|
|
|
; UNSAFE-NEXT: retq
|
|
|
|
;
|
|
|
|
; FINITE-LABEL: olt_inverse_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; FINITE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; FINITE-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
|
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @oge_y(double %x) {
|
|
|
|
; STRICT-LABEL: oge_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm2
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: cmplesd %xmm0, %xmm2
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: andpd %xmm2, %xmm0
|
|
|
|
; STRICT-NEXT: andnpd %xmm1, %xmm2
|
|
|
|
; STRICT-NEXT: orpd %xmm2, %xmm0
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; RELAX-LABEL: oge_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; RELAX: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; RELAX-NEXT: maxsd {{.*}}(%rip), %xmm0
|
|
|
|
; RELAX-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @ole_y(double %x) {
|
|
|
|
; STRICT-LABEL: ole_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: movsd {{.*#+}} xmm2 = mem[0],zero
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: movapd %xmm0, %xmm1
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: cmplesd %xmm2, %xmm1
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: andpd %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: andnpd %xmm2, %xmm1
|
|
|
|
; STRICT-NEXT: orpd %xmm0, %xmm1
|
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm0
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; RELAX-LABEL: ole_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; RELAX: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; RELAX-NEXT: minsd {{.*}}(%rip), %xmm0
|
|
|
|
; RELAX-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @oge_inverse_y(double %x) {
|
|
|
|
; STRICT-LABEL: oge_inverse_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: movsd {{.*#+}} xmm2 = mem[0],zero
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: movapd %xmm2, %xmm1
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: cmplesd %xmm0, %xmm1
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: andpd %xmm1, %xmm2
|
|
|
|
; STRICT-NEXT: andnpd %xmm0, %xmm1
|
|
|
|
; STRICT-NEXT: orpd %xmm2, %xmm1
|
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm0
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; UNSAFE-LABEL: oge_inverse_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; UNSAFE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; UNSAFE-NEXT: minsd {{.*}}(%rip), %xmm0
|
|
|
|
; UNSAFE-NEXT: retq
|
|
|
|
;
|
|
|
|
; FINITE-LABEL: oge_inverse_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; FINITE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; FINITE-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
|
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @ole_inverse_y(double %x) {
|
|
|
|
; STRICT-LABEL: ole_inverse_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: movsd {{.*#+}} xmm2 = mem[0],zero
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: movapd %xmm0, %xmm1
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: cmplesd %xmm2, %xmm1
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: andpd %xmm1, %xmm2
|
|
|
|
; STRICT-NEXT: andnpd %xmm0, %xmm1
|
|
|
|
; STRICT-NEXT: orpd %xmm2, %xmm1
|
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm0
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; UNSAFE-LABEL: ole_inverse_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; UNSAFE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; UNSAFE-NEXT: maxsd {{.*}}(%rip), %xmm0
|
|
|
|
; UNSAFE-NEXT: retq
|
|
|
|
;
|
|
|
|
; FINITE-LABEL: ole_inverse_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; FINITE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; FINITE-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
|
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @ugt_y(double %x) {
|
|
|
|
; STRICT-LABEL: ugt_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: movsd {{.*#+}} xmm2 = mem[0],zero
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: movapd %xmm0, %xmm1
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: cmpnlesd %xmm2, %xmm1
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: andpd %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: andnpd %xmm2, %xmm1
|
|
|
|
; STRICT-NEXT: orpd %xmm0, %xmm1
|
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm0
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; RELAX-LABEL: ugt_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; RELAX: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; RELAX-NEXT: maxsd {{.*}}(%rip), %xmm0
|
|
|
|
; RELAX-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @ult_y(double %x) {
|
|
|
|
; STRICT-LABEL: ult_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm2
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: cmpnlesd %xmm0, %xmm2
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: andpd %xmm2, %xmm0
|
|
|
|
; STRICT-NEXT: andnpd %xmm1, %xmm2
|
|
|
|
; STRICT-NEXT: orpd %xmm2, %xmm0
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; RELAX-LABEL: ult_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; RELAX: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; RELAX-NEXT: minsd {{.*}}(%rip), %xmm0
|
|
|
|
; RELAX-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @ugt_inverse_y(double %x) {
|
|
|
|
; STRICT-LABEL: ugt_inverse_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: movsd {{.*#+}} xmm2 = mem[0],zero
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: movapd %xmm0, %xmm1
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: cmpnlesd %xmm2, %xmm1
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: andpd %xmm1, %xmm2
|
|
|
|
; STRICT-NEXT: andnpd %xmm0, %xmm1
|
|
|
|
; STRICT-NEXT: orpd %xmm2, %xmm1
|
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm0
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; UNSAFE-LABEL: ugt_inverse_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; UNSAFE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; UNSAFE-NEXT: minsd {{.*}}(%rip), %xmm0
|
|
|
|
; UNSAFE-NEXT: retq
|
|
|
|
;
|
|
|
|
; FINITE-LABEL: ugt_inverse_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; FINITE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; FINITE-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
|
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @ult_inverse_y(double %x) {
|
|
|
|
; STRICT-LABEL: ult_inverse_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: movsd {{.*#+}} xmm2 = mem[0],zero
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: movapd %xmm2, %xmm1
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: cmpnlesd %xmm0, %xmm1
|
2017-02-26 14:45:59 +08:00
|
|
|
; STRICT-NEXT: andpd %xmm1, %xmm2
|
|
|
|
; STRICT-NEXT: andnpd %xmm0, %xmm1
|
|
|
|
; STRICT-NEXT: orpd %xmm2, %xmm1
|
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm0
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; UNSAFE-LABEL: ult_inverse_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; UNSAFE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; UNSAFE-NEXT: maxsd {{.*}}(%rip), %xmm0
|
|
|
|
; UNSAFE-NEXT: retq
|
|
|
|
;
|
|
|
|
; FINITE-LABEL: ult_inverse_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; FINITE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; FINITE-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
|
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @uge_y(double %x) {
|
|
|
|
; STRICT-LABEL: uge_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
|
|
|
|
; STRICT-NEXT: maxsd %xmm0, %xmm1
|
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; RELAX-LABEL: uge_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; RELAX: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; RELAX-NEXT: maxsd {{.*}}(%rip), %xmm0
|
|
|
|
; RELAX-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @ule_y(double %x) {
|
|
|
|
; STRICT-LABEL: ule_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
|
|
|
|
; STRICT-NEXT: minsd %xmm0, %xmm1
|
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; RELAX-LABEL: ule_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; RELAX: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; RELAX-NEXT: minsd {{.*}}(%rip), %xmm0
|
|
|
|
; RELAX-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @uge_inverse_y(double %x) {
|
|
|
|
; STRICT-LABEL: uge_inverse_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: minsd {{.*}}(%rip), %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; UNSAFE-LABEL: uge_inverse_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; UNSAFE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; UNSAFE-NEXT: minsd {{.*}}(%rip), %xmm0
|
|
|
|
; UNSAFE-NEXT: retq
|
|
|
|
;
|
|
|
|
; FINITE-LABEL: uge_inverse_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; FINITE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; FINITE-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
|
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @ule_inverse_y(double %x) {
|
|
|
|
; STRICT-LABEL: ule_inverse_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: maxsd {{.*}}(%rip), %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; UNSAFE-LABEL: ule_inverse_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; UNSAFE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; UNSAFE-NEXT: maxsd {{.*}}(%rip), %xmm0
|
|
|
|
; UNSAFE-NEXT: retq
|
|
|
|
;
|
|
|
|
; FINITE-LABEL: ule_inverse_y:
|
2017-12-05 01:18:51 +08:00
|
|
|
; FINITE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; FINITE-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
|
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: retq
|
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
|
|
|
|
}
|
2016-11-16 06:33:16 +08:00
|
|
|
|
2009-09-22 02:03:22 +08:00
|
|
|
; Test a few more misc. cases.
|
2009-09-04 04:34:31 +08:00
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define double @clampTo3k_a(double %x) {
|
|
|
|
; STRICT-LABEL: clampTo3k_a:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
|
|
|
|
; STRICT-NEXT: minsd %xmm0, %xmm1
|
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: clampTo3k_a:
|
2017-12-05 01:18:51 +08:00
|
|
|
; UNSAFE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; UNSAFE-NEXT: minsd {{.*}}(%rip), %xmm0
|
|
|
|
; UNSAFE-NEXT: retq
|
|
|
|
;
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: clampTo3k_a:
|
2017-12-05 01:18:51 +08:00
|
|
|
; FINITE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; FINITE-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
|
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: retq
|
|
|
|
%t0 = fcmp ogt double %x, 3.000000e+03
|
|
|
|
%y = select i1 %t0, double 3.000000e+03, double %x
|
|
|
|
ret double %y
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @clampTo3k_b(double %x) {
|
|
|
|
; STRICT-LABEL: clampTo3k_b:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: minsd {{.*}}(%rip), %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: clampTo3k_b:
|
2017-12-05 01:18:51 +08:00
|
|
|
; UNSAFE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; UNSAFE-NEXT: minsd {{.*}}(%rip), %xmm0
|
|
|
|
; UNSAFE-NEXT: retq
|
|
|
|
;
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: clampTo3k_b:
|
2017-12-05 01:18:51 +08:00
|
|
|
; FINITE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; FINITE-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
|
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: retq
|
|
|
|
%t0 = fcmp uge double %x, 3.000000e+03
|
|
|
|
%y = select i1 %t0, double 3.000000e+03, double %x
|
|
|
|
ret double %y
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @clampTo3k_c(double %x) {
|
|
|
|
; STRICT-LABEL: clampTo3k_c:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
|
|
|
|
; STRICT-NEXT: maxsd %xmm0, %xmm1
|
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: clampTo3k_c:
|
2017-12-05 01:18:51 +08:00
|
|
|
; UNSAFE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; UNSAFE-NEXT: maxsd {{.*}}(%rip), %xmm0
|
|
|
|
; UNSAFE-NEXT: retq
|
|
|
|
;
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: clampTo3k_c:
|
2017-12-05 01:18:51 +08:00
|
|
|
; FINITE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; FINITE-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
|
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: retq
|
|
|
|
%t0 = fcmp olt double %x, 3.000000e+03
|
|
|
|
%y = select i1 %t0, double 3.000000e+03, double %x
|
|
|
|
ret double %y
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @clampTo3k_d(double %x) {
|
|
|
|
; STRICT-LABEL: clampTo3k_d:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: maxsd {{.*}}(%rip), %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: clampTo3k_d:
|
2017-12-05 01:18:51 +08:00
|
|
|
; UNSAFE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; UNSAFE-NEXT: maxsd {{.*}}(%rip), %xmm0
|
|
|
|
; UNSAFE-NEXT: retq
|
|
|
|
;
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: clampTo3k_d:
|
2017-12-05 01:18:51 +08:00
|
|
|
; FINITE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; FINITE-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
|
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: retq
|
|
|
|
%t0 = fcmp ule double %x, 3.000000e+03
|
|
|
|
%y = select i1 %t0, double 3.000000e+03, double %x
|
|
|
|
ret double %y
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @clampTo3k_e(double %x) {
|
|
|
|
; STRICT-LABEL: clampTo3k_e:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
|
|
|
|
; STRICT-NEXT: maxsd %xmm0, %xmm1
|
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: clampTo3k_e:
|
2017-12-05 01:18:51 +08:00
|
|
|
; UNSAFE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; UNSAFE-NEXT: maxsd {{.*}}(%rip), %xmm0
|
|
|
|
; UNSAFE-NEXT: retq
|
|
|
|
;
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: clampTo3k_e:
|
2017-12-05 01:18:51 +08:00
|
|
|
; FINITE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; FINITE-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
|
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: retq
|
|
|
|
%t0 = fcmp olt double %x, 3.000000e+03
|
|
|
|
%y = select i1 %t0, double 3.000000e+03, double %x
|
|
|
|
ret double %y
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @clampTo3k_f(double %x) {
|
|
|
|
; STRICT-LABEL: clampTo3k_f:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: maxsd {{.*}}(%rip), %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: clampTo3k_f:
|
2017-12-05 01:18:51 +08:00
|
|
|
; UNSAFE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; UNSAFE-NEXT: maxsd {{.*}}(%rip), %xmm0
|
|
|
|
; UNSAFE-NEXT: retq
|
|
|
|
;
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: clampTo3k_f:
|
2017-12-05 01:18:51 +08:00
|
|
|
; FINITE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; FINITE-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
|
|
|
|
; FINITE-NEXT: maxsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: retq
|
|
|
|
%t0 = fcmp ule double %x, 3.000000e+03
|
|
|
|
%y = select i1 %t0, double 3.000000e+03, double %x
|
|
|
|
ret double %y
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @clampTo3k_g(double %x) {
|
|
|
|
; STRICT-LABEL: clampTo3k_g:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
|
|
|
|
; STRICT-NEXT: minsd %xmm0, %xmm1
|
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: clampTo3k_g:
|
2017-12-05 01:18:51 +08:00
|
|
|
; UNSAFE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; UNSAFE-NEXT: minsd {{.*}}(%rip), %xmm0
|
|
|
|
; UNSAFE-NEXT: retq
|
|
|
|
;
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: clampTo3k_g:
|
2017-12-05 01:18:51 +08:00
|
|
|
; FINITE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; FINITE-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
|
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: retq
|
|
|
|
%t0 = fcmp ogt double %x, 3.000000e+03
|
|
|
|
%y = select i1 %t0, double 3.000000e+03, double %x
|
|
|
|
ret double %y
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @clampTo3k_h(double %x) {
|
|
|
|
; STRICT-LABEL: clampTo3k_h:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: minsd {{.*}}(%rip), %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNSAFE-LABEL: clampTo3k_h:
|
2017-12-05 01:18:51 +08:00
|
|
|
; UNSAFE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; UNSAFE-NEXT: minsd {{.*}}(%rip), %xmm0
|
|
|
|
; UNSAFE-NEXT: retq
|
|
|
|
;
|
2013-07-14 14:24:09 +08:00
|
|
|
; FINITE-LABEL: clampTo3k_h:
|
2017-12-05 01:18:51 +08:00
|
|
|
; FINITE: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; FINITE-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
|
|
|
|
; FINITE-NEXT: minsd %xmm0, %xmm1
|
|
|
|
; FINITE-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; FINITE-NEXT: retq
|
|
|
|
%t0 = fcmp uge double %x, 3.000000e+03
|
|
|
|
%y = select i1 %t0, double 3.000000e+03, double %x
|
|
|
|
ret double %y
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x double> @test_maxpd(<2 x double> %x, <2 x double> %y) {
|
|
|
|
; STRICT-LABEL: test_maxpd:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: movapd %xmm0, %xmm2
|
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: cmplepd %xmm2, %xmm0
|
2017-02-06 02:33:24 +08:00
|
|
|
; STRICT-NEXT: blendvpd %xmm0, %xmm2, %xmm1
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; RELAX-LABEL: test_maxpd:
|
2017-12-05 01:18:51 +08:00
|
|
|
; RELAX: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; RELAX-NEXT: maxpd %xmm1, %xmm0
|
|
|
|
; RELAX-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define <2 x double> @test_minpd(<2 x double> %x, <2 x double> %y) {
|
|
|
|
; STRICT-LABEL: test_minpd:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: movapd %xmm0, %xmm2
|
|
|
|
; STRICT-NEXT: cmplepd %xmm1, %xmm0
|
2017-02-06 02:33:24 +08:00
|
|
|
; STRICT-NEXT: blendvpd %xmm0, %xmm2, %xmm1
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; RELAX-LABEL: test_minpd:
|
2017-12-05 01:18:51 +08:00
|
|
|
; RELAX: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; RELAX-NEXT: minpd %xmm1, %xmm0
|
|
|
|
; RELAX-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define <4 x float> @test_maxps(<4 x float> %x, <4 x float> %y) {
|
|
|
|
; STRICT-LABEL: test_maxps:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: movaps %xmm0, %xmm2
|
|
|
|
; STRICT-NEXT: movaps %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: cmpleps %xmm2, %xmm0
|
2017-02-06 02:33:24 +08:00
|
|
|
; STRICT-NEXT: blendvps %xmm0, %xmm2, %xmm1
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: movaps %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; RELAX-LABEL: test_maxps:
|
2017-12-05 01:18:51 +08:00
|
|
|
; RELAX: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; RELAX-NEXT: maxps %xmm1, %xmm0
|
|
|
|
; RELAX-NEXT: retq
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define <4 x float> @test_minps(<4 x float> %x, <4 x float> %y) {
|
|
|
|
; STRICT-LABEL: test_minps:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: movaps %xmm0, %xmm2
|
|
|
|
; STRICT-NEXT: cmpleps %xmm1, %xmm0
|
2017-02-06 02:33:24 +08:00
|
|
|
; STRICT-NEXT: blendvps %xmm0, %xmm2, %xmm1
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: movaps %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; RELAX-LABEL: test_minps:
|
2017-12-05 01:18:51 +08:00
|
|
|
; RELAX: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; RELAX-NEXT: minps %xmm1, %xmm0
|
|
|
|
; RELAX-NEXT: retq
|
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
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define <2 x float> @test_maxps_illegal_v2f32(<2 x float> %x, <2 x float> %y) {
|
|
|
|
; STRICT-LABEL: test_maxps_illegal_v2f32:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: movaps %xmm0, %xmm2
|
|
|
|
; STRICT-NEXT: movaps %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: cmpleps %xmm2, %xmm0
|
2017-02-06 02:33:24 +08:00
|
|
|
; STRICT-NEXT: blendvps %xmm0, %xmm2, %xmm1
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: movaps %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; RELAX-LABEL: test_maxps_illegal_v2f32:
|
2017-12-05 01:18:51 +08:00
|
|
|
; RELAX: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; RELAX-NEXT: maxps %xmm1, %xmm0
|
|
|
|
; RELAX-NEXT: retq
|
2015-01-13 04:31:30 +08:00
|
|
|
%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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define <2 x float> @test_minps_illegal_v2f32(<2 x float> %x, <2 x float> %y) {
|
|
|
|
; STRICT-LABEL: test_minps_illegal_v2f32:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: movaps %xmm0, %xmm2
|
|
|
|
; STRICT-NEXT: cmpleps %xmm1, %xmm0
|
2017-02-06 02:33:24 +08:00
|
|
|
; STRICT-NEXT: blendvps %xmm0, %xmm2, %xmm1
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: movaps %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; RELAX-LABEL: test_minps_illegal_v2f32:
|
2017-12-05 01:18:51 +08:00
|
|
|
; RELAX: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; RELAX-NEXT: minps %xmm1, %xmm0
|
|
|
|
; RELAX-NEXT: retq
|
2015-01-13 04:31:30 +08:00
|
|
|
%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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define <3 x float> @test_maxps_illegal_v3f32(<3 x float> %x, <3 x float> %y) {
|
|
|
|
; STRICT-LABEL: test_maxps_illegal_v3f32:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: movaps %xmm0, %xmm2
|
|
|
|
; STRICT-NEXT: movaps %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: cmpleps %xmm2, %xmm0
|
2017-02-06 02:33:24 +08:00
|
|
|
; STRICT-NEXT: blendvps %xmm0, %xmm2, %xmm1
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: movaps %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; RELAX-LABEL: test_maxps_illegal_v3f32:
|
2017-12-05 01:18:51 +08:00
|
|
|
; RELAX: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; RELAX-NEXT: maxps %xmm1, %xmm0
|
|
|
|
; RELAX-NEXT: retq
|
2015-01-13 04:31:30 +08:00
|
|
|
%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
|
|
|
|
}
|
|
|
|
|
2016-11-16 06:33:16 +08:00
|
|
|
define <3 x float> @test_minps_illegal_v3f32(<3 x float> %x, <3 x float> %y) {
|
|
|
|
; STRICT-LABEL: test_minps_illegal_v3f32:
|
2017-12-05 01:18:51 +08:00
|
|
|
; STRICT: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: movaps %xmm0, %xmm2
|
|
|
|
; STRICT-NEXT: cmpleps %xmm1, %xmm0
|
2017-02-06 02:33:24 +08:00
|
|
|
; STRICT-NEXT: blendvps %xmm0, %xmm2, %xmm1
|
2016-11-16 06:33:16 +08:00
|
|
|
; STRICT-NEXT: movaps %xmm1, %xmm0
|
|
|
|
; STRICT-NEXT: retq
|
|
|
|
;
|
|
|
|
; RELAX-LABEL: test_minps_illegal_v3f32:
|
2017-12-05 01:18:51 +08:00
|
|
|
; RELAX: # %bb.0:
|
2016-11-16 06:33:16 +08:00
|
|
|
; RELAX-NEXT: minps %xmm1, %xmm0
|
|
|
|
; RELAX-NEXT: retq
|
2015-01-13 04:31:30 +08:00
|
|
|
%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
|
|
|
|
}
|
2016-11-16 06:33:16 +08:00
|
|
|
|