[llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/scalar_sse_minmax.ll
Chris Lattner
sabre at nondot.org
Tue Oct 3 23:56:16 PDT 2006
Changes in directory llvm/test/Regression/CodeGen/X86:
scalar_sse_minmax.ll added (r1.1)
---
Log message:
pattern match min/max nodes
---
Diffs of the changes: (+37 -0)
scalar_sse_minmax.ll | 37 +++++++++++++++++++++++++++++++++++++
1 files changed, 37 insertions(+)
Index: llvm/test/Regression/CodeGen/X86/scalar_sse_minmax.ll
diff -c /dev/null llvm/test/Regression/CodeGen/X86/scalar_sse_minmax.ll:1.1
*** /dev/null Wed Oct 4 01:56:12 2006
--- llvm/test/Regression/CodeGen/X86/scalar_sse_minmax.ll Wed Oct 4 01:56:02 2006
***************
*** 0 ****
--- 1,37 ----
+ ; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse1,+sse2 | grep mins | wc -l | grep 2 &&
+ ; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse1,+sse2 | grep maxs | wc -l | grep 2
+
+ declare bool %llvm.isunordered.f64( double %x, double %y )
+ declare bool %llvm.isunordered.f32( float %x, float %y )
+
+ implementation
+
+ float %min1(float %x, float %y) {
+ %tmp = setlt float %x, %y ; <bool> [#uses=1]
+ %retval = select bool %tmp, float %x, float %y ; <float> [#uses=1]
+ ret float %retval
+ }
+ double %min2(double %x, double %y) {
+ %tmp = setlt double %x, %y
+ %retval = select bool %tmp, double %x, double %y
+ ret double %retval
+ }
+
+ float %max1(float %x, float %y) {
+ %tmp = setge float %x, %y ; <bool> [#uses=1]
+ %tmp2 = tail call bool %llvm.isunordered.f32( float %x, float %y )
+ %tmp3 = or bool %tmp2, %tmp ; <bool> [#uses=1]
+ %retval = select bool %tmp3, float %x, float %y
+ ret float %retval
+ }
+
+ double %max2(double %x, double %y) {
+ %tmp = setge double %x, %y ; <bool> [#uses=1]
+ %tmp2 = tail call bool %llvm.isunordered.f64( double %x, double %y )
+ %tmp3 = or bool %tmp2, %tmp ; <bool> [#uses=1]
+ %retval = select bool %tmp3, double %x, double %y
+ ret double %retval
+ }
+
+
+
More information about the llvm-commits
mailing list