2012-12-27 16:15:45 +08:00
|
|
|
; RUN: llc -march=x86-64 -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -o - < %s | FileCheck %s
|
|
|
|
|
2013-07-19 06:47:09 +08:00
|
|
|
;CHECK-LABEL: and_masks:
|
2013-01-19 07:10:30 +08:00
|
|
|
;CHECK: vmovaps
|
2013-01-03 01:40:39 +08:00
|
|
|
;CHECK: vcmpltp
|
|
|
|
;CHECK: vcmpltp
|
|
|
|
;CHECK: vandps
|
|
|
|
;CHECK: vandps
|
2013-01-19 16:38:41 +08:00
|
|
|
;CHECK: vmovaps
|
2012-12-27 16:15:45 +08:00
|
|
|
;CHECK: ret
|
|
|
|
|
|
|
|
define void @and_masks(<8 x float>* %a, <8 x float>* %b, <8 x float>* %c) nounwind uwtable noinline ssp {
|
2015-02-28 05:17:42 +08:00
|
|
|
%v0 = load <8 x float>, <8 x float>* %a, align 16
|
|
|
|
%v1 = load <8 x float>, <8 x float>* %b, align 16
|
2012-12-27 16:15:45 +08:00
|
|
|
%m0 = fcmp olt <8 x float> %v1, %v0
|
2015-02-28 05:17:42 +08:00
|
|
|
%v2 = load <8 x float>, <8 x float>* %c, align 16
|
2012-12-27 16:15:45 +08:00
|
|
|
%m1 = fcmp olt <8 x float> %v2, %v0
|
|
|
|
%mand = and <8 x i1> %m1, %m0
|
|
|
|
%r = zext <8 x i1> %mand to <8 x i32>
|
2013-01-19 16:38:41 +08:00
|
|
|
store <8 x i32> %r, <8 x i32>* undef, align 32
|
2012-12-27 16:15:45 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
;CHECK: neg_mask
|
2013-01-03 01:40:39 +08:00
|
|
|
;CHECK: vcmpltps
|
|
|
|
;CHECK: vxorps
|
|
|
|
;CHECK: vandps
|
2013-01-19 16:38:41 +08:00
|
|
|
;CHECK: vmovaps
|
2012-12-27 16:15:45 +08:00
|
|
|
;CHECK: ret
|
|
|
|
define void @neg_masks(<8 x float>* %a, <8 x float>* %b, <8 x float>* %c) nounwind uwtable noinline ssp {
|
2015-02-28 05:17:42 +08:00
|
|
|
%v0 = load <8 x float>, <8 x float>* %a, align 16
|
|
|
|
%v1 = load <8 x float>, <8 x float>* %b, align 16
|
2012-12-27 16:15:45 +08:00
|
|
|
%m0 = fcmp olt <8 x float> %v1, %v0
|
|
|
|
%mand = xor <8 x i1> %m0, <i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1>
|
|
|
|
%r = zext <8 x i1> %mand to <8 x i32>
|
2013-01-19 16:38:41 +08:00
|
|
|
store <8 x i32> %r, <8 x i32>* undef, align 32
|
2012-12-27 16:15:45 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|