summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2013-01-02 17:40:39 +0000
committerNadav Rotem <nrotem@apple.com>2013-01-02 17:40:39 +0000
commitc8d7047fa9d8144ab33150b71bbcd3f628417578 (patch)
treec3c81f6fea9f76ae929aa652756677577a60ca6d /llvm/test/CodeGen
parent3c0431c88799ba67ffa60c68169d6310f198de44 (diff)
downloadbcm5719-llvm-c8d7047fa9d8144ab33150b71bbcd3f628417578.tar.gz
bcm5719-llvm-c8d7047fa9d8144ab33150b71bbcd3f628417578.zip
AVX: Fix a bug in WidenMaskArithmetic.
llvm-svn: 171397
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r--llvm/test/CodeGen/X86/WidenArith.ll23
-rw-r--r--llvm/test/CodeGen/X86/v8i1-masks.ll17
2 files changed, 32 insertions, 8 deletions
diff --git a/llvm/test/CodeGen/X86/WidenArith.ll b/llvm/test/CodeGen/X86/WidenArith.ll
new file mode 100644
index 00000000000..0383bd665b0
--- /dev/null
+++ b/llvm/test/CodeGen/X86/WidenArith.ll
@@ -0,0 +1,23 @@
+; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx | FileCheck %s
+
+;CHECK: test
+;CHECK: vaddps
+;CHECK: vmulps
+;CHECK: vsubps
+;CHECK: vcmpltps
+;CHECK: vcmpltps
+;CHECK: vandps
+;CHECK: vandps
+;CHECK: ret
+define <8 x i32> @test(<8 x float> %a, <8 x float> %b) {
+ %c1 = fadd <8 x float> %a, %b
+ %b1 = fmul <8 x float> %b, %a
+ %d = fsub <8 x float> %b1, %c1
+ %res1 = fcmp olt <8 x float> %a, %b1
+ %res2 = fcmp olt <8 x float> %c1, %d
+ %andr = and <8 x i1>%res1, %res2
+ %ex = zext <8 x i1> %andr to <8 x i32>
+ ret <8 x i32>%ex
+}
+
+
diff --git a/llvm/test/CodeGen/X86/v8i1-masks.ll b/llvm/test/CodeGen/X86/v8i1-masks.ll
index 01079997a33..abb4b39bd62 100644
--- a/llvm/test/CodeGen/X86/v8i1-masks.ll
+++ b/llvm/test/CodeGen/X86/v8i1-masks.ll
@@ -2,9 +2,11 @@
;CHECK: and_masks
;CHECK: vmovups
-;CHECK-NEXT: vcmpltp
-;CHECK-NEXT: vandps
-;CHECK-NEXT: vmovups
+;CHECK: vcmpltp
+;CHECK: vcmpltp
+;CHECK: vandps
+;CHECK: vandps
+;CHECK: vmovups
;CHECK: ret
define void @and_masks(<8 x float>* %a, <8 x float>* %b, <8 x float>* %c) nounwind uwtable noinline ssp {
@@ -20,12 +22,11 @@ define void @and_masks(<8 x float>* %a, <8 x float>* %b, <8 x float>* %c) nounwi
}
;CHECK: neg_mask
-;CHECK: vmovups
-;CHECK-NEXT: vcmpltps
-;CHECK-NEXT: vandps
-;CHECK-NEXT: vmovups
+;CHECK: vcmpltps
+;CHECK: vxorps
+;CHECK: vandps
+;CHECK: vmovups
;CHECK: ret
-
define void @neg_masks(<8 x float>* %a, <8 x float>* %b, <8 x float>* %c) nounwind uwtable noinline ssp {
%v0 = load <8 x float>* %a, align 16
%v1 = load <8 x float>* %b, align 16
OpenPOWER on IntegriCloud