summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/sse41-blend.ll
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2011-09-12 19:30:40 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2011-09-12 19:30:40 +0000
commit8e03a821f96d270556b2ffce15174f2f89d856da (patch)
treecb417d37fcde5510d70c3e2920390a4b3879b56b /test/CodeGen/X86/sse41-blend.ll
parent93474f5f7fe681600d7d12bfa3983f9960ae94ac (diff)
downloadllvm-8e03a821f96d270556b2ffce15174f2f89d856da.tar.gz
llvm-8e03a821f96d270556b2ffce15174f2f89d856da.tar.bz2
llvm-8e03a821f96d270556b2ffce15174f2f89d856da.tar.xz
Not sure how CMPPS and CMPPD had already ever worked, I guess it didn't.
However with this fix it does now. Basically the operand order for the x86 target specific node is not the same as the instruction, but since the intrinsic need that specific order at the instruction definition, just change the order during legalization. Also, there were some wrong invertions of condition codes, such as GE => LE, GT => LT, fix that too. Fix PR10907. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139528 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/sse41-blend.ll')
-rw-r--r--test/CodeGen/X86/sse41-blend.ll18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/CodeGen/X86/sse41-blend.ll b/test/CodeGen/X86/sse41-blend.ll
index 3c854ac606..aba2c129e3 100644
--- a/test/CodeGen/X86/sse41-blend.ll
+++ b/test/CodeGen/X86/sse41-blend.ll
@@ -44,4 +44,22 @@ define <16 x i8> @vsel_i8(<16 x i8> %v1, <16 x i8> %v2) {
ret <16 x i8> %vsel
}
+;; TEST blend + compares
+; CHECK: A
+define <2 x double> @A(<2 x double> %x, <2 x double> %y) {
+ ; CHECK: cmpltpd
+ ; CHECK: blendvpd
+ %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
+}
+
+; CHECK: B
+define <2 x double> @B(<2 x double> %x, <2 x double> %y) {
+ ; CHECK: cmplepd
+ ; CHECK: blendvpd
+ %max_is_x = fcmp ogt <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
+}