1 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=x86-64 -mattr=+sse2 | FileCheck %s
6 define <4 x i32> @shl4(<4 x i32> %A) nounwind {
12 %B = shl <4 x i32> %A, < i32 2, i32 2, i32 2, i32 2>
13 %C = shl <4 x i32> %A, < i32 1, i32 1, i32 1, i32 1>
14 %K = xor <4 x i32> %B, %C
18 define <4 x i32> @shr4(<4 x i32> %A) nounwind {
24 %B = lshr <4 x i32> %A, < i32 2, i32 2, i32 2, i32 2>
25 %C = lshr <4 x i32> %A, < i32 1, i32 1, i32 1, i32 1>
26 %K = xor <4 x i32> %B, %C
30 define <4 x i32> @sra4(<4 x i32> %A) nounwind {
36 %B = ashr <4 x i32> %A, < i32 2, i32 2, i32 2, i32 2>
37 %C = ashr <4 x i32> %A, < i32 1, i32 1, i32 1, i32 1>
38 %K = xor <4 x i32> %B, %C
42 define <2 x i64> @shl2(<2 x i64> %A) nounwind {
48 %B = shl <2 x i64> %A, < i64 2, i64 2>
49 %C = shl <2 x i64> %A, < i64 9, i64 9>
50 %K = xor <2 x i64> %B, %C
54 define <2 x i64> @shr2(<2 x i64> %A) nounwind {
60 %B = lshr <2 x i64> %A, < i64 8, i64 8>
61 %C = lshr <2 x i64> %A, < i64 1, i64 1>
62 %K = xor <2 x i64> %B, %C
67 define <8 x i16> @shl8(<8 x i16> %A) nounwind {
73 %B = shl <8 x i16> %A, < i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2>
74 %C = shl <8 x i16> %A, < i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>
75 %K = xor <8 x i16> %B, %C
79 define <8 x i16> @shr8(<8 x i16> %A) nounwind {
85 %B = lshr <8 x i16> %A, < i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2>
86 %C = lshr <8 x i16> %A, < i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>
87 %K = xor <8 x i16> %B, %C
91 define <8 x i16> @sra8(<8 x i16> %A) nounwind {
97 %B = ashr <8 x i16> %A, < i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2>
98 %C = ashr <8 x i16> %A, < i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>
99 %K = xor <8 x i16> %B, %C
106 define <8 x i16> @sll8_nosplat(<8 x i16> %A) nounwind {
108 ; CHECK: sll8_nosplat
112 %B = shl <8 x i16> %A, < i16 1, i16 2, i16 3, i16 6, i16 2, i16 2, i16 2, i16 2>
113 %C = shl <8 x i16> %A, < i16 9, i16 7, i16 5, i16 1, i16 4, i16 1, i16 1, i16 1>
114 %K = xor <8 x i16> %B, %C
119 define <2 x i64> @shr2_nosplat(<2 x i64> %A) nounwind {
121 ; CHECK-LABEL: shr2_nosplat
122 ; CHECK: movdqa %xmm0, %xmm1
123 ; CHECK-NEXT: psrlq $1, %xmm1
124 ; CHECK-NEXT: movdqa %xmm0, %xmm2
125 ; CHECK-NEXT: psrlq $8, %xmm2
126 ; CHECK-NEXT: movsd {{.*#+}} xmm0 = xmm1[0],xmm0[1]
127 ; CHECK-NEXT: movsd {{.*#+}} xmm1 = xmm2[0],xmm1[1]
128 ; CHECK-NEXT: xorpd %xmm0, %xmm1
129 ; CHECK-NEXT: movapd %xmm1, %xmm0
131 %B = lshr <2 x i64> %A, < i64 8, i64 1>
132 %C = lshr <2 x i64> %A, < i64 1, i64 0>
133 %K = xor <2 x i64> %B, %C
140 define <2 x i32> @shl2_other(<2 x i32> %A) nounwind {
145 %B = shl <2 x i32> %A, < i32 2, i32 2>
146 %C = shl <2 x i32> %A, < i32 9, i32 9>
147 %K = xor <2 x i32> %B, %C
151 define <2 x i32> @shr2_other(<2 x i32> %A) nounwind {
156 %B = lshr <2 x i32> %A, < i32 8, i32 8>
157 %C = lshr <2 x i32> %A, < i32 1, i32 1>
158 %K = xor <2 x i32> %B, %C
162 define <16 x i8> @shl9(<16 x i8> %A) nounwind {
163 %B = shl <16 x i8> %A, <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3>
171 define <16 x i8> @shr9(<16 x i8> %A) nounwind {
172 %B = lshr <16 x i8> %A, <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3>
180 define <16 x i8> @sra_v16i8_7(<16 x i8> %A) nounwind {
181 %B = ashr <16 x i8> %A, <i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7>
183 ; CHECK-LABEL: sra_v16i8_7:
189 define <16 x i8> @sra_v16i8(<16 x i8> %A) nounwind {
190 %B = ashr <16 x i8> %A, <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3>
192 ; CHECK-LABEL: sra_v16i8: