AVX: Fix a bug in WidenMaskArithmetic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171397 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nadav Rotem 2013-01-02 17:40:39 +00:00
parent 351ba145a7
commit d570f59048
2 changed files with 32 additions and 8 deletions

View File

@ -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
}

View File

@ -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