• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
4
5define <4 x i64> @vpandn(<4 x i64> %a, <4 x i64> %b) nounwind uwtable readnone ssp {
6; X32-LABEL: vpandn:
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
11; X32-NEXT:    retl
12;
13; X64-LABEL: vpandn:
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
18; X64-NEXT:    retq
19entry:
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
24  ret <4 x i64> %x
25}
26
27define <4 x i64> @vpand(<4 x i64> %a, <4 x i64> %b) nounwind uwtable readnone ssp {
28; X32-LABEL: vpand:
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
33; X32-NEXT:    retl
34;
35; X64-LABEL: vpand:
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
40; X64-NEXT:    retq
41entry:
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
45  ret <4 x i64> %x
46}
47
48define <4 x i64> @vpor(<4 x i64> %a, <4 x i64> %b) nounwind uwtable readnone ssp {
49; X32-LABEL: vpor:
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
54; X32-NEXT:    retl
55;
56; X64-LABEL: vpor:
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
61; X64-NEXT:    retq
62entry:
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
66  ret <4 x i64> %x
67}
68
69define <4 x i64> @vpxor(<4 x i64> %a, <4 x i64> %b) nounwind uwtable readnone ssp {
70; X32-LABEL: vpxor:
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
75; X32-NEXT:    retl
76;
77; X64-LABEL: vpxor:
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
82; X64-NEXT:    retq
83entry:
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
87  ret <4 x i64> %x
88}
89
90define <32 x i8> @vpblendvb(<32 x i1> %cond, <32 x i8> %x, <32 x i8> %y) {
91; X32-LABEL: vpblendvb:
92; X32:       # %bb.0:
93; X32-NEXT:    vpsllw $7, %ymm0, %ymm0
94; X32-NEXT:    vpblendvb %ymm0, %ymm1, %ymm2, %ymm0
95; X32-NEXT:    retl
96;
97; X64-LABEL: vpblendvb:
98; X64:       # %bb.0:
99; X64-NEXT:    vpsllw $7, %ymm0, %ymm0
100; X64-NEXT:    vpblendvb %ymm0, %ymm1, %ymm2, %ymm0
101; X64-NEXT:    retq
102  %min = select <32 x i1> %cond, <32 x i8> %x, <32 x i8> %y
103  ret <32 x i8> %min
104}
105
106define <8 x i32> @allOnes() nounwind {
107; X32-LABEL: allOnes:
108; X32:       # %bb.0:
109; X32-NEXT:    vpcmpeqd %ymm0, %ymm0, %ymm0
110; X32-NEXT:    retl
111;
112; X64-LABEL: allOnes:
113; X64:       # %bb.0:
114; X64-NEXT:    vpcmpeqd %ymm0, %ymm0, %ymm0
115; X64-NEXT:    retq
116        ret <8 x i32> <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1>
117}
118
119define <16 x i16> @allOnes2() nounwind {
120; X32-LABEL: allOnes2:
121; X32:       # %bb.0:
122; X32-NEXT:    vpcmpeqd %ymm0, %ymm0, %ymm0
123; X32-NEXT:    retl
124;
125; X64-LABEL: allOnes2:
126; X64:       # %bb.0:
127; X64-NEXT:    vpcmpeqd %ymm0, %ymm0, %ymm0
128; X64-NEXT:    retq
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>
130}
131