1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
; RUN: llc < %s -mtriple=i686-- -mcpu=x86-64 | FileCheck %s --check-prefixes=X86-SSE2
; RUN: llc < %s -mtriple=x86_64-- -mcpu=x86-64 | FileCheck %s --check-prefixes=X64-SSE2
; RUN: llc < %s -mtriple=i686-- -mcpu=x86-64-v2 | FileCheck %s --check-prefixes=X86-SSE42
; RUN: llc < %s -mtriple=x86_64-- -mcpu=x86-64-v2 | FileCheck %s --check-prefixes=X64-SSE42
; RUN: llc < %s -mtriple=i686-- -mcpu=x86-64-v3 | FileCheck %s --check-prefixes=X86-AVX2
; RUN: llc < %s -mtriple=x86_64-- -mcpu=x86-64-v3 | FileCheck %s --check-prefixes=X64-AVX2
; RUN: llc < %s -mtriple=i686-- -mcpu=x86-64-v4 | FileCheck %s --check-prefixes=X86-AVX512
; RUN: llc < %s -mtriple=x86_64-- -mcpu=x86-64-v4 | FileCheck %s --check-prefixes=X64-AVX512
; PR78897 - Don't vectorize a mul of extracted values if we'd still need the extract.
; TODO: We should vectorize on 32-bit targets.
define <16 x i8> @produceShuffleVectorForByte(i8 zeroext %0) nounwind {
; X86-SSE2-LABEL: produceShuffleVectorForByte:
; X86-SSE2: # %bb.0: # %entry
; X86-SSE2-NEXT: pushl %ebx
; X86-SSE2-NEXT: pushl %edi
; X86-SSE2-NEXT: pushl %esi
; X86-SSE2-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
; X86-SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
; X86-SSE2-NEXT: pshuflw {{.*#+}} xmm1 = xmm0[0,0,0,0,4,5,6,7]
; X86-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1
; X86-SSE2-NEXT: pxor %xmm0, %xmm0
; X86-SSE2-NEXT: pcmpeqb %xmm1, %xmm0
; X86-SSE2-NEXT: movdqa {{.*#+}} xmm1 = [17,17,17,17,17,17,17,17,u,u,u,u,u,u,u,u]
; X86-SSE2-NEXT: pand %xmm0, %xmm1
; X86-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm1[1,1,1,1]
; X86-SSE2-NEXT: movd %xmm2, %esi
; X86-SSE2-NEXT: movd %xmm1, %ecx
; X86-SSE2-NEXT: movl $286331152, %edi # imm = 0x11111110
; X86-SSE2-NEXT: movl %ecx, %eax
; X86-SSE2-NEXT: mull %edi
; X86-SSE2-NEXT: imull $286331153, %ecx, %ebx # imm = 0x11111111
; X86-SSE2-NEXT: addl %edx, %ebx
; X86-SSE2-NEXT: imull $286331152, %esi, %edx # imm = 0x11111110
; X86-SSE2-NEXT: addl %ebx, %edx
; X86-SSE2-NEXT: movd %edx, %xmm2
; X86-SSE2-NEXT: movd %eax, %xmm1
; X86-SSE2-NEXT: xorl $286331153, %ecx # imm = 0x11111111
; X86-SSE2-NEXT: movl %ecx, %eax
; X86-SSE2-NEXT: mull %edi
; X86-SSE2-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
; X86-SSE2-NEXT: xorl $17895697, %esi # imm = 0x1111111
; X86-SSE2-NEXT: imull $286331153, %ecx, %ecx # imm = 0x11111111
; X86-SSE2-NEXT: addl %edx, %ecx
; X86-SSE2-NEXT: imull $286331152, %esi, %edx # imm = 0x11111110
; X86-SSE2-NEXT: addl %ecx, %edx
; X86-SSE2-NEXT: movd %edx, %xmm2
; X86-SSE2-NEXT: movd %eax, %xmm3
; X86-SSE2-NEXT: punpckldq {{.*#+}} xmm3 = xmm3[0],xmm2[0],xmm3[1],xmm2[1]
; X86-SSE2-NEXT: pand %xmm0, %xmm1
; X86-SSE2-NEXT: pandn %xmm3, %xmm0
; X86-SSE2-NEXT: por %xmm1, %xmm0
; X86-SSE2-NEXT: movdqa %xmm0, %xmm1
; X86-SSE2-NEXT: psrlw $4, %xmm1
; X86-SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3],xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
; X86-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0
; X86-SSE2-NEXT: popl %esi
; X86-SSE2-NEXT: popl %edi
; X86-SSE2-NEXT: popl %ebx
; X86-SSE2-NEXT: retl
;
; X64-SSE2-LABEL: produceShuffleVectorForByte:
; X64-SSE2: # %bb.0: # %entry
; X64-SSE2-NEXT: movd %edi, %xmm0
; X64-SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
; X64-SSE2-NEXT: pshuflw {{.*#+}} xmm1 = xmm0[0,0,0,0,4,5,6,7]
; X64-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
; X64-SSE2-NEXT: pxor %xmm0, %xmm0
; X64-SSE2-NEXT: pcmpeqb %xmm1, %xmm0
; X64-SSE2-NEXT: movdqa {{.*#+}} xmm1 = [17,17,17,17,17,17,17,17,u,u,u,u,u,u,u,u]
; X64-SSE2-NEXT: pand %xmm0, %xmm1
; X64-SSE2-NEXT: movq %xmm1, %rax
; X64-SSE2-NEXT: movabsq $1229782938247303440, %rcx # imm = 0x1111111111111110
; X64-SSE2-NEXT: movabsq $76861433640456465, %rdx # imm = 0x111111111111111
; X64-SSE2-NEXT: xorq %rax, %rdx
; X64-SSE2-NEXT: imulq %rcx, %rax
; X64-SSE2-NEXT: movq %rax, %xmm1
; X64-SSE2-NEXT: imulq %rcx, %rdx
; X64-SSE2-NEXT: movq %rdx, %xmm2
; X64-SSE2-NEXT: pand %xmm0, %xmm1
; X64-SSE2-NEXT: pandn %xmm2, %xmm0
; X64-SSE2-NEXT: por %xmm1, %xmm0
; X64-SSE2-NEXT: movdqa %xmm0, %xmm1
; X64-SSE2-NEXT: psrlw $4, %xmm1
; X64-SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3],xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
; X64-SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
; X64-SSE2-NEXT: retq
;
; X86-SSE42-LABEL: produceShuffleVectorForByte:
; X86-SSE42: # %bb.0: # %entry
; X86-SSE42-NEXT: pushl %ebx
; X86-SSE42-NEXT: pushl %edi
; X86-SSE42-NEXT: pushl %esi
; X86-SSE42-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
; X86-SSE42-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
; X86-SSE42-NEXT: pshuflw {{.*#+}} xmm1 = xmm0[0,0,0,0,4,5,6,7]
; X86-SSE42-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1
; X86-SSE42-NEXT: pxor %xmm0, %xmm0
; X86-SSE42-NEXT: pcmpeqb %xmm1, %xmm0
; X86-SSE42-NEXT: movdqa {{.*#+}} xmm1 = [17,17,17,17,17,17,17,17,u,u,u,u,u,u,u,u]
; X86-SSE42-NEXT: pand %xmm0, %xmm1
; X86-SSE42-NEXT: movd %xmm1, %ecx
; X86-SSE42-NEXT: movl $286331152, %edi # imm = 0x11111110
; X86-SSE42-NEXT: movl %ecx, %eax
; X86-SSE42-NEXT: mull %edi
; X86-SSE42-NEXT: pextrd $1, %xmm1, %esi
; X86-SSE42-NEXT: imull $286331153, %ecx, %ebx # imm = 0x11111111
; X86-SSE42-NEXT: addl %edx, %ebx
; X86-SSE42-NEXT: imull $286331152, %esi, %edx # imm = 0x11111110
; X86-SSE42-NEXT: addl %ebx, %edx
; X86-SSE42-NEXT: movd %eax, %xmm2
; X86-SSE42-NEXT: pinsrd $1, %edx, %xmm2
; X86-SSE42-NEXT: xorl $286331153, %ecx # imm = 0x11111111
; X86-SSE42-NEXT: movl %ecx, %eax
; X86-SSE42-NEXT: mull %edi
; X86-SSE42-NEXT: xorl $17895697, %esi # imm = 0x1111111
; X86-SSE42-NEXT: imull $286331153, %ecx, %ecx # imm = 0x11111111
; X86-SSE42-NEXT: addl %edx, %ecx
; X86-SSE42-NEXT: imull $286331152, %esi, %edx # imm = 0x11111110
; X86-SSE42-NEXT: addl %ecx, %edx
; X86-SSE42-NEXT: movd %eax, %xmm1
; X86-SSE42-NEXT: pinsrd $1, %edx, %xmm1
; X86-SSE42-NEXT: pblendvb %xmm0, %xmm2, %xmm1
; X86-SSE42-NEXT: movdqa %xmm1, %xmm0
; X86-SSE42-NEXT: psrlw $4, %xmm0
; X86-SSE42-NEXT: punpcklbw {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
; X86-SSE42-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1
; X86-SSE42-NEXT: movdqa %xmm1, %xmm0
; X86-SSE42-NEXT: popl %esi
; X86-SSE42-NEXT: popl %edi
; X86-SSE42-NEXT: popl %ebx
; X86-SSE42-NEXT: retl
;
; X64-SSE42-LABEL: produceShuffleVectorForByte:
; X64-SSE42: # %bb.0: # %entry
; X64-SSE42-NEXT: movd %edi, %xmm0
; X64-SSE42-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
; X64-SSE42-NEXT: pshuflw {{.*#+}} xmm1 = xmm0[0,0,0,0,4,5,6,7]
; X64-SSE42-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
; X64-SSE42-NEXT: pxor %xmm0, %xmm0
; X64-SSE42-NEXT: pcmpeqb %xmm1, %xmm0
; X64-SSE42-NEXT: movdqa {{.*#+}} xmm1 = [17,17,17,17,17,17,17,17,u,u,u,u,u,u,u,u]
; X64-SSE42-NEXT: pand %xmm0, %xmm1
; X64-SSE42-NEXT: movq %xmm1, %rax
; X64-SSE42-NEXT: movabsq $1229782938247303440, %rcx # imm = 0x1111111111111110
; X64-SSE42-NEXT: movabsq $76861433640456465, %rdx # imm = 0x111111111111111
; X64-SSE42-NEXT: xorq %rax, %rdx
; X64-SSE42-NEXT: imulq %rcx, %rax
; X64-SSE42-NEXT: movq %rax, %xmm2
; X64-SSE42-NEXT: imulq %rcx, %rdx
; X64-SSE42-NEXT: movq %rdx, %xmm1
; X64-SSE42-NEXT: pblendvb %xmm0, %xmm2, %xmm1
; X64-SSE42-NEXT: movdqa %xmm1, %xmm0
; X64-SSE42-NEXT: psrlw $4, %xmm0
; X64-SSE42-NEXT: punpcklbw {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
; X64-SSE42-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
; X64-SSE42-NEXT: movdqa %xmm1, %xmm0
; X64-SSE42-NEXT: retq
;
; X86-AVX2-LABEL: produceShuffleVectorForByte:
; X86-AVX2: # %bb.0: # %entry
; X86-AVX2-NEXT: pushl %ebx
; X86-AVX2-NEXT: pushl %edi
; X86-AVX2-NEXT: pushl %esi
; X86-AVX2-NEXT: vpbroadcastb {{[0-9]+}}(%esp), %xmm0
; X86-AVX2-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0, %xmm0
; X86-AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
; X86-AVX2-NEXT: vpcmpeqb %xmm1, %xmm0, %xmm0
; X86-AVX2-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0, %xmm1
; X86-AVX2-NEXT: vmovd %xmm1, %edx
; X86-AVX2-NEXT: movl $286331152, %ecx # imm = 0x11111110
; X86-AVX2-NEXT: mulxl %ecx, %edi, %esi
; X86-AVX2-NEXT: vpextrd $1, %xmm1, %eax
; X86-AVX2-NEXT: imull $286331153, %edx, %ebx # imm = 0x11111111
; X86-AVX2-NEXT: addl %esi, %ebx
; X86-AVX2-NEXT: imull $286331152, %eax, %esi # imm = 0x11111110
; X86-AVX2-NEXT: addl %ebx, %esi
; X86-AVX2-NEXT: vmovd %edi, %xmm1
; X86-AVX2-NEXT: xorl $286331153, %edx # imm = 0x11111111
; X86-AVX2-NEXT: mulxl %ecx, %edi, %ecx
; X86-AVX2-NEXT: vpinsrd $1, %esi, %xmm1, %xmm1
; X86-AVX2-NEXT: xorl $17895697, %eax # imm = 0x1111111
; X86-AVX2-NEXT: imull $286331153, %edx, %edx # imm = 0x11111111
; X86-AVX2-NEXT: addl %ecx, %edx
; X86-AVX2-NEXT: imull $286331152, %eax, %eax # imm = 0x11111110
; X86-AVX2-NEXT: addl %edx, %eax
; X86-AVX2-NEXT: vmovd %edi, %xmm2
; X86-AVX2-NEXT: vpinsrd $1, %eax, %xmm2, %xmm2
; X86-AVX2-NEXT: vpblendvb %xmm0, %xmm1, %xmm2, %xmm0
; X86-AVX2-NEXT: vpsrlw $4, %xmm0, %xmm1
; X86-AVX2-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3],xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
; X86-AVX2-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0, %xmm0
; X86-AVX2-NEXT: popl %esi
; X86-AVX2-NEXT: popl %edi
; X86-AVX2-NEXT: popl %ebx
; X86-AVX2-NEXT: retl
;
; X64-AVX2-LABEL: produceShuffleVectorForByte:
; X64-AVX2: # %bb.0: # %entry
; X64-AVX2-NEXT: vmovd %edi, %xmm0
; X64-AVX2-NEXT: vpbroadcastb %xmm0, %xmm0
; X64-AVX2-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
; X64-AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
; X64-AVX2-NEXT: vpcmpeqb %xmm1, %xmm0, %xmm0
; X64-AVX2-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm1
; X64-AVX2-NEXT: vmovq %xmm1, %rax
; X64-AVX2-NEXT: movabsq $1229782938247303440, %rcx # imm = 0x1111111111111110
; X64-AVX2-NEXT: movabsq $76861433640456465, %rdx # imm = 0x111111111111111
; X64-AVX2-NEXT: xorq %rax, %rdx
; X64-AVX2-NEXT: imulq %rcx, %rax
; X64-AVX2-NEXT: vmovq %rax, %xmm1
; X64-AVX2-NEXT: imulq %rcx, %rdx
; X64-AVX2-NEXT: vmovq %rdx, %xmm2
; X64-AVX2-NEXT: vpblendvb %xmm0, %xmm1, %xmm2, %xmm0
; X64-AVX2-NEXT: vpsrlw $4, %xmm0, %xmm1
; X64-AVX2-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3],xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
; X64-AVX2-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
; X64-AVX2-NEXT: retq
;
; X86-AVX512-LABEL: produceShuffleVectorForByte:
; X86-AVX512: # %bb.0: # %entry
; X86-AVX512-NEXT: pushl %ebx
; X86-AVX512-NEXT: pushl %edi
; X86-AVX512-NEXT: pushl %esi
; X86-AVX512-NEXT: vpbroadcastb {{[0-9]+}}(%esp), %xmm0
; X86-AVX512-NEXT: vptestnmb {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0, %k1
; X86-AVX512-NEXT: vmovdqu8 {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0 {%k1} {z}
; X86-AVX512-NEXT: vpextrd $1, %xmm0, %eax
; X86-AVX512-NEXT: vmovd %xmm0, %edx
; X86-AVX512-NEXT: movl $286331152, %ecx # imm = 0x11111110
; X86-AVX512-NEXT: mulxl %ecx, %edi, %esi
; X86-AVX512-NEXT: imull $286331153, %edx, %ebx # imm = 0x11111111
; X86-AVX512-NEXT: addl %esi, %ebx
; X86-AVX512-NEXT: imull $286331152, %eax, %esi # imm = 0x11111110
; X86-AVX512-NEXT: addl %ebx, %esi
; X86-AVX512-NEXT: vmovd %edi, %xmm0
; X86-AVX512-NEXT: vpinsrd $1, %esi, %xmm0, %xmm0
; X86-AVX512-NEXT: xorl $17895697, %eax # imm = 0x1111111
; X86-AVX512-NEXT: xorl $286331153, %edx # imm = 0x11111111
; X86-AVX512-NEXT: mulxl %ecx, %esi, %ecx
; X86-AVX512-NEXT: imull $286331153, %edx, %edx # imm = 0x11111111
; X86-AVX512-NEXT: addl %ecx, %edx
; X86-AVX512-NEXT: imull $286331152, %eax, %eax # imm = 0x11111110
; X86-AVX512-NEXT: addl %edx, %eax
; X86-AVX512-NEXT: vmovd %esi, %xmm1
; X86-AVX512-NEXT: vpinsrd $1, %eax, %xmm1, %xmm1
; X86-AVX512-NEXT: vmovdqu8 %xmm0, %xmm1 {%k1}
; X86-AVX512-NEXT: vpsrlw $4, %xmm1, %xmm0
; X86-AVX512-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
; X86-AVX512-NEXT: vpandd {{\.?LCPI[0-9]+_[0-9]+}}{1to4}, %xmm0, %xmm0
; X86-AVX512-NEXT: popl %esi
; X86-AVX512-NEXT: popl %edi
; X86-AVX512-NEXT: popl %ebx
; X86-AVX512-NEXT: retl
;
; X64-AVX512-LABEL: produceShuffleVectorForByte:
; X64-AVX512: # %bb.0: # %entry
; X64-AVX512-NEXT: vpbroadcastb %edi, %xmm0
; X64-AVX512-NEXT: vptestnmb {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %k1
; X64-AVX512-NEXT: vmovdqu8 {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0 {%k1} {z}
; X64-AVX512-NEXT: vmovq %xmm0, %rax
; X64-AVX512-NEXT: movabsq $1229782938247303440, %rcx # imm = 0x1111111111111110
; X64-AVX512-NEXT: movabsq $76861433640456465, %rdx # imm = 0x111111111111111
; X64-AVX512-NEXT: xorq %rax, %rdx
; X64-AVX512-NEXT: imulq %rcx, %rax
; X64-AVX512-NEXT: vmovq %rax, %xmm0
; X64-AVX512-NEXT: imulq %rcx, %rdx
; X64-AVX512-NEXT: vmovq %rdx, %xmm1
; X64-AVX512-NEXT: vmovdqu8 %xmm0, %xmm1 {%k1}
; X64-AVX512-NEXT: vpsrlw $4, %xmm1, %xmm0
; X64-AVX512-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
; X64-AVX512-NEXT: vpandd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm0, %xmm0
; X64-AVX512-NEXT: retq
entry:
%const = bitcast i64 1229782938247303440 to i64
%1 = insertelement <1 x i8> poison, i8 %0, i64 0
%2 = shufflevector <1 x i8> %1, <1 x i8> poison, <8 x i32> zeroinitializer
%3 = and <8 x i8> %2, <i8 1, i8 2, i8 4, i8 8, i8 16, i8 32, i8 64, i8 -128>
%.not.not = icmp eq <8 x i8> %3, zeroinitializer
%4 = select <8 x i1> %.not.not, <8 x i8> <i8 17, i8 17, i8 17, i8 17, i8 17, i8 17, i8 17, i8 17>, <8 x i8> zeroinitializer
%5 = bitcast <8 x i8> %4 to i64
%6 = mul i64 %5, %const
%7 = bitcast i64 %6 to <8 x i8>
%8 = xor i64 %5, 76861433640456465
%9 = mul i64 %8, %const
%10 = bitcast i64 %9 to <8 x i8>
%11 = select <8 x i1> %.not.not, <8 x i8> %7, <8 x i8> %10
%12 = and <8 x i8> %11, <i8 15, i8 15, i8 15, i8 15, i8 15, i8 15, i8 15, i8 15>
%13 = lshr <8 x i8> %11, <i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4>
%14 = shufflevector <8 x i8> %12, <8 x i8> %13, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
ret <16 x i8> %14
}
|