1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx2 | FileCheck %s --check-prefix=X32
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx2 | FileCheck %s --check-prefix=X64
5 define <4 x i64> @vpandn(<4 x i64> %a, <4 x i64> %b) nounwind uwtable readnone ssp {
7 ; X32: # %bb.0: # %entry
8 ; X32-NEXT: vpcmpeqd %ymm1, %ymm1, %ymm1
9 ; X32-NEXT: vpsubq %ymm1, %ymm0, %ymm1
10 ; X32-NEXT: vpandn %ymm0, %ymm1, %ymm0
14 ; X64: # %bb.0: # %entry
15 ; X64-NEXT: vpcmpeqd %ymm1, %ymm1, %ymm1
16 ; X64-NEXT: vpsubq %ymm1, %ymm0, %ymm1
17 ; X64-NEXT: vpandn %ymm0, %ymm1, %ymm0
20 ; Force the execution domain with an add.
21 %a2 = add <4 x i64> %a, <i64 1, i64 1, i64 1, i64 1>
22 %y = xor <4 x i64> %a2, <i64 -1, i64 -1, i64 -1, i64 -1>
23 %x = and <4 x i64> %a, %y
27 define <4 x i64> @vpand(<4 x i64> %a, <4 x i64> %b) nounwind uwtable readnone ssp {
29 ; X32: # %bb.0: # %entry
30 ; X32-NEXT: vpcmpeqd %ymm2, %ymm2, %ymm2
31 ; X32-NEXT: vpsubq %ymm2, %ymm0, %ymm0
32 ; X32-NEXT: vpand %ymm1, %ymm0, %ymm0
36 ; X64: # %bb.0: # %entry
37 ; X64-NEXT: vpcmpeqd %ymm2, %ymm2, %ymm2
38 ; X64-NEXT: vpsubq %ymm2, %ymm0, %ymm0
39 ; X64-NEXT: vpand %ymm1, %ymm0, %ymm0
42 ; Force the execution domain with an add.
43 %a2 = add <4 x i64> %a, <i64 1, i64 1, i64 1, i64 1>
44 %x = and <4 x i64> %a2, %b
48 define <4 x i64> @vpor(<4 x i64> %a, <4 x i64> %b) nounwind uwtable readnone ssp {
50 ; X32: # %bb.0: # %entry
51 ; X32-NEXT: vpcmpeqd %ymm2, %ymm2, %ymm2
52 ; X32-NEXT: vpsubq %ymm2, %ymm0, %ymm0
53 ; X32-NEXT: vpor %ymm1, %ymm0, %ymm0
57 ; X64: # %bb.0: # %entry
58 ; X64-NEXT: vpcmpeqd %ymm2, %ymm2, %ymm2
59 ; X64-NEXT: vpsubq %ymm2, %ymm0, %ymm0
60 ; X64-NEXT: vpor %ymm1, %ymm0, %ymm0
63 ; Force the execution domain with an add.
64 %a2 = add <4 x i64> %a, <i64 1, i64 1, i64 1, i64 1>
65 %x = or <4 x i64> %a2, %b
69 define <4 x i64> @vpxor(<4 x i64> %a, <4 x i64> %b) nounwind uwtable readnone ssp {
71 ; X32: # %bb.0: # %entry
72 ; X32-NEXT: vpcmpeqd %ymm2, %ymm2, %ymm2
73 ; X32-NEXT: vpsubq %ymm2, %ymm0, %ymm0
74 ; X32-NEXT: vpxor %ymm1, %ymm0, %ymm0
78 ; X64: # %bb.0: # %entry
79 ; X64-NEXT: vpcmpeqd %ymm2, %ymm2, %ymm2
80 ; X64-NEXT: vpsubq %ymm2, %ymm0, %ymm0
81 ; X64-NEXT: vpxor %ymm1, %ymm0, %ymm0
84 ; Force the execution domain with an add.
85 %a2 = add <4 x i64> %a, <i64 1, i64 1, i64 1, i64 1>
86 %x = xor <4 x i64> %a2, %b
90 define <32 x i8> @vpblendvb(<32 x i1> %cond, <32 x i8> %x, <32 x i8> %y) {
91 ; X32-LABEL: vpblendvb:
93 ; X32-NEXT: vpsllw $7, %ymm0, %ymm0
94 ; X32-NEXT: vpblendvb %ymm0, %ymm1, %ymm2, %ymm0
97 ; X64-LABEL: vpblendvb:
99 ; X64-NEXT: vpsllw $7, %ymm0, %ymm0
100 ; X64-NEXT: vpblendvb %ymm0, %ymm1, %ymm2, %ymm0
102 %min = select <32 x i1> %cond, <32 x i8> %x, <32 x i8> %y
106 define <8 x i32> @allOnes() nounwind {
107 ; X32-LABEL: allOnes:
109 ; X32-NEXT: vpcmpeqd %ymm0, %ymm0, %ymm0
112 ; X64-LABEL: allOnes:
114 ; X64-NEXT: vpcmpeqd %ymm0, %ymm0, %ymm0
116 ret <8 x i32> <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1>
119 define <16 x i16> @allOnes2() nounwind {
120 ; X32-LABEL: allOnes2:
122 ; X32-NEXT: vpcmpeqd %ymm0, %ymm0, %ymm0
125 ; X64-LABEL: allOnes2:
127 ; X64-NEXT: vpcmpeqd %ymm0, %ymm0, %ymm0
129 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>