2011-11-09 09:37:21 +00:00
|
|
|
; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=core-avx2 -mattr=+avx2 | FileCheck %s
|
|
|
|
|
2011-11-09 13:21:28 +00:00
|
|
|
; CHECK: vpandn
|
2011-11-09 09:37:21 +00:00
|
|
|
; CHECK: vpandn %ymm
|
2011-11-09 13:21:28 +00:00
|
|
|
; CHECK: ret
|
2011-11-09 09:37:21 +00:00
|
|
|
define <4 x i64> @vpandn(<4 x i64> %a, <4 x i64> %b) nounwind uwtable readnone ssp {
|
|
|
|
entry:
|
|
|
|
; Force the execution domain with an add.
|
|
|
|
%a2 = add <4 x i64> %a, <i64 1, i64 1, i64 1, i64 1>
|
|
|
|
%y = xor <4 x i64> %a2, <i64 -1, i64 -1, i64 -1, i64 -1>
|
|
|
|
%x = and <4 x i64> %a, %y
|
|
|
|
ret <4 x i64> %x
|
|
|
|
}
|
|
|
|
|
2011-11-09 13:21:28 +00:00
|
|
|
; CHECK: vpand
|
2011-11-09 09:37:21 +00:00
|
|
|
; CHECK: vpand %ymm
|
2011-11-09 13:21:28 +00:00
|
|
|
; CHECK: ret
|
2011-11-09 09:37:21 +00:00
|
|
|
define <4 x i64> @vpand(<4 x i64> %a, <4 x i64> %b) nounwind uwtable readnone ssp {
|
|
|
|
entry:
|
|
|
|
; Force the execution domain with an add.
|
|
|
|
%a2 = add <4 x i64> %a, <i64 1, i64 1, i64 1, i64 1>
|
|
|
|
%x = and <4 x i64> %a2, %b
|
|
|
|
ret <4 x i64> %x
|
|
|
|
}
|
|
|
|
|
2011-11-09 13:21:28 +00:00
|
|
|
; CHECK: vpor
|
2011-11-09 09:37:21 +00:00
|
|
|
; CHECK: vpor %ymm
|
2011-11-09 13:21:28 +00:00
|
|
|
; CHECK: ret
|
2011-11-09 09:37:21 +00:00
|
|
|
define <4 x i64> @vpor(<4 x i64> %a, <4 x i64> %b) nounwind uwtable readnone ssp {
|
|
|
|
entry:
|
|
|
|
; Force the execution domain with an add.
|
|
|
|
%a2 = add <4 x i64> %a, <i64 1, i64 1, i64 1, i64 1>
|
|
|
|
%x = or <4 x i64> %a2, %b
|
|
|
|
ret <4 x i64> %x
|
|
|
|
}
|
|
|
|
|
2011-11-09 13:21:28 +00:00
|
|
|
; CHECK: vpxor
|
2011-11-09 09:37:21 +00:00
|
|
|
; CHECK: vpxor %ymm
|
2011-11-09 13:21:28 +00:00
|
|
|
; CHECK: ret
|
2011-11-09 09:37:21 +00:00
|
|
|
define <4 x i64> @vpxor(<4 x i64> %a, <4 x i64> %b) nounwind uwtable readnone ssp {
|
|
|
|
entry:
|
|
|
|
; Force the execution domain with an add.
|
|
|
|
%a2 = add <4 x i64> %a, <i64 1, i64 1, i64 1, i64 1>
|
|
|
|
%x = xor <4 x i64> %a2, %b
|
|
|
|
ret <4 x i64> %x
|
|
|
|
}
|
2011-11-09 13:21:28 +00:00
|
|
|
|
|
|
|
; CHECK: vpblendvb
|
|
|
|
; CHECK: vpblendvb %ymm
|
|
|
|
; CHECK: ret
|
2012-12-21 17:46:58 +00:00
|
|
|
define <32 x i8> @vpblendvb(<32 x i1> %cond, <32 x i8> %x, <32 x i8> %y) {
|
|
|
|
%min = select <32 x i1> %cond, <32 x i8> %x, <32 x i8> %y
|
2011-11-09 13:21:28 +00:00
|
|
|
ret <32 x i8> %min
|
|
|
|
}
|
2011-11-19 07:07:26 +00:00
|
|
|
|
|
|
|
define <8 x i32> @signd(<8 x i32> %a, <8 x i32> %b) nounwind {
|
|
|
|
entry:
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: signd:
|
2011-11-19 07:07:26 +00:00
|
|
|
; CHECK: psignd
|
|
|
|
; CHECK-NOT: sub
|
|
|
|
; CHECK: ret
|
|
|
|
%b.lobit = ashr <8 x i32> %b, <i32 31, i32 31, i32 31, i32 31, i32 31, i32 31, i32 31, i32 31>
|
|
|
|
%sub = sub nsw <8 x i32> zeroinitializer, %a
|
|
|
|
%0 = xor <8 x i32> %b.lobit, <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1>
|
|
|
|
%1 = and <8 x i32> %a, %0
|
|
|
|
%2 = and <8 x i32> %b.lobit, %sub
|
|
|
|
%cond = or <8 x i32> %1, %2
|
|
|
|
ret <8 x i32> %cond
|
|
|
|
}
|
|
|
|
|
|
|
|
define <8 x i32> @blendvb(<8 x i32> %b, <8 x i32> %a, <8 x i32> %c) nounwind {
|
|
|
|
entry:
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: blendvb:
|
2011-11-19 07:07:26 +00:00
|
|
|
; CHECK: pblendvb
|
|
|
|
; CHECK: ret
|
|
|
|
%b.lobit = ashr <8 x i32> %b, <i32 31, i32 31, i32 31, i32 31, i32 31, i32 31, i32 31, i32 31>
|
|
|
|
%sub = sub nsw <8 x i32> zeroinitializer, %a
|
|
|
|
%0 = xor <8 x i32> %b.lobit, <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1>
|
|
|
|
%1 = and <8 x i32> %c, %0
|
|
|
|
%2 = and <8 x i32> %a, %b.lobit
|
|
|
|
%cond = or <8 x i32> %1, %2
|
|
|
|
ret <8 x i32> %cond
|
|
|
|
}
|
2011-11-19 22:34:59 +00:00
|
|
|
|
|
|
|
define <8 x i32> @allOnes() nounwind {
|
|
|
|
; CHECK: vpcmpeqd
|
|
|
|
; CHECK-NOT: vinsert
|
|
|
|
ret <8 x i32> <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1>
|
|
|
|
}
|
|
|
|
|
|
|
|
define <16 x i16> @allOnes2() nounwind {
|
|
|
|
; CHECK: vpcmpeqd
|
|
|
|
; CHECK-NOT: vinsert
|
|
|
|
ret <16 x i16> <i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1>
|
|
|
|
}
|