1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+sse3 | FileCheck %s --check-prefix=SSE3
3 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+sse4.1 | FileCheck %s --check-prefix=SSE41
4 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx | FileCheck %s --check-prefix=AVX-32
5 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx2 | FileCheck %s --check-prefix=AVX-32
6 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx2 | FileCheck %s --check-prefix=AVX-64
8 define <3 x i16> @zext_i8(<3 x i8>) {
11 ; SSE3-NEXT: movzbl {{[0-9]+}}(%esp), %eax
12 ; SSE3-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
13 ; SSE3-NEXT: movzbl {{[0-9]+}}(%esp), %edx
14 ; SSE3-NEXT: movd %edx, %xmm0
15 ; SSE3-NEXT: pinsrw $1, %ecx, %xmm0
16 ; SSE3-NEXT: pinsrw $2, %eax, %xmm0
17 ; SSE3-NEXT: pextrw $0, %xmm0, %eax
18 ; SSE3-NEXT: pextrw $1, %xmm0, %edx
19 ; SSE3-NEXT: pextrw $2, %xmm0, %ecx
20 ; SSE3-NEXT: # kill: def $ax killed $ax killed $eax
21 ; SSE3-NEXT: # kill: def $dx killed $dx killed $edx
22 ; SSE3-NEXT: # kill: def $cx killed $cx killed $ecx
25 ; SSE41-LABEL: zext_i8:
27 ; SSE41-NEXT: pxor %xmm0, %xmm0
28 ; SSE41-NEXT: pinsrb $0, {{[0-9]+}}(%esp), %xmm0
29 ; SSE41-NEXT: pinsrb $4, {{[0-9]+}}(%esp), %xmm0
30 ; SSE41-NEXT: pinsrb $8, {{[0-9]+}}(%esp), %xmm0
31 ; SSE41-NEXT: movd %xmm0, %eax
32 ; SSE41-NEXT: pextrw $2, %xmm0, %edx
33 ; SSE41-NEXT: pextrw $4, %xmm0, %ecx
34 ; SSE41-NEXT: # kill: def $ax killed $ax killed $eax
35 ; SSE41-NEXT: # kill: def $dx killed $dx killed $edx
36 ; SSE41-NEXT: # kill: def $cx killed $cx killed $ecx
39 ; AVX-32-LABEL: zext_i8:
41 ; AVX-32-NEXT: vpxor %xmm0, %xmm0, %xmm0
42 ; AVX-32-NEXT: vpinsrb $0, {{[0-9]+}}(%esp), %xmm0, %xmm0
43 ; AVX-32-NEXT: vpinsrb $4, {{[0-9]+}}(%esp), %xmm0, %xmm0
44 ; AVX-32-NEXT: vpinsrb $8, {{[0-9]+}}(%esp), %xmm0, %xmm0
45 ; AVX-32-NEXT: vmovd %xmm0, %eax
46 ; AVX-32-NEXT: vpextrw $2, %xmm0, %edx
47 ; AVX-32-NEXT: vpextrw $4, %xmm0, %ecx
48 ; AVX-32-NEXT: # kill: def $ax killed $ax killed $eax
49 ; AVX-32-NEXT: # kill: def $dx killed $dx killed $edx
50 ; AVX-32-NEXT: # kill: def $cx killed $cx killed $ecx
53 ; AVX-64-LABEL: zext_i8:
55 ; AVX-64-NEXT: vmovd %edi, %xmm0
56 ; AVX-64-NEXT: vpinsrd $1, %esi, %xmm0, %xmm0
57 ; AVX-64-NEXT: vpinsrd $2, %edx, %xmm0, %xmm0
58 ; AVX-64-NEXT: vpand {{.*}}(%rip), %xmm0, %xmm0
59 ; AVX-64-NEXT: vmovd %xmm0, %eax
60 ; AVX-64-NEXT: vpextrw $2, %xmm0, %edx
61 ; AVX-64-NEXT: vpextrw $4, %xmm0, %ecx
62 ; AVX-64-NEXT: # kill: def $ax killed $ax killed $eax
63 ; AVX-64-NEXT: # kill: def $dx killed $dx killed $edx
64 ; AVX-64-NEXT: # kill: def $cx killed $cx killed $ecx
66 %2 = zext <3 x i8> %0 to <3 x i16>
70 define <3 x i16> @sext_i8(<3 x i8>) {
71 ; SSE3-LABEL: sext_i8:
73 ; SSE3-NEXT: movl {{[0-9]+}}(%esp), %eax
74 ; SSE3-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
75 ; SSE3-NEXT: pinsrw $1, %eax, %xmm0
76 ; SSE3-NEXT: movl {{[0-9]+}}(%esp), %eax
77 ; SSE3-NEXT: pinsrw $2, %eax, %xmm0
78 ; SSE3-NEXT: psllw $8, %xmm0
79 ; SSE3-NEXT: psraw $8, %xmm0
80 ; SSE3-NEXT: pextrw $0, %xmm0, %eax
81 ; SSE3-NEXT: pextrw $1, %xmm0, %edx
82 ; SSE3-NEXT: pextrw $2, %xmm0, %ecx
83 ; SSE3-NEXT: # kill: def $ax killed $ax killed $eax
84 ; SSE3-NEXT: # kill: def $dx killed $dx killed $edx
85 ; SSE3-NEXT: # kill: def $cx killed $cx killed $ecx
88 ; SSE41-LABEL: sext_i8:
90 ; SSE41-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
91 ; SSE41-NEXT: pinsrb $4, {{[0-9]+}}(%esp), %xmm0
92 ; SSE41-NEXT: pinsrb $8, {{[0-9]+}}(%esp), %xmm0
93 ; SSE41-NEXT: pslld $24, %xmm0
94 ; SSE41-NEXT: psrad $24, %xmm0
95 ; SSE41-NEXT: movd %xmm0, %eax
96 ; SSE41-NEXT: pextrw $2, %xmm0, %edx
97 ; SSE41-NEXT: pextrw $4, %xmm0, %ecx
98 ; SSE41-NEXT: # kill: def $ax killed $ax killed $eax
99 ; SSE41-NEXT: # kill: def $dx killed $dx killed $edx
100 ; SSE41-NEXT: # kill: def $cx killed $cx killed $ecx
103 ; AVX-32-LABEL: sext_i8:
105 ; AVX-32-NEXT: vmovd {{.*#+}} xmm0 = mem[0],zero,zero,zero
106 ; AVX-32-NEXT: vpinsrb $4, {{[0-9]+}}(%esp), %xmm0, %xmm0
107 ; AVX-32-NEXT: vpinsrb $8, {{[0-9]+}}(%esp), %xmm0, %xmm0
108 ; AVX-32-NEXT: vpslld $24, %xmm0, %xmm0
109 ; AVX-32-NEXT: vpsrad $24, %xmm0, %xmm0
110 ; AVX-32-NEXT: vmovd %xmm0, %eax
111 ; AVX-32-NEXT: vpextrw $2, %xmm0, %edx
112 ; AVX-32-NEXT: vpextrw $4, %xmm0, %ecx
113 ; AVX-32-NEXT: # kill: def $ax killed $ax killed $eax
114 ; AVX-32-NEXT: # kill: def $dx killed $dx killed $edx
115 ; AVX-32-NEXT: # kill: def $cx killed $cx killed $ecx
118 ; AVX-64-LABEL: sext_i8:
120 ; AVX-64-NEXT: vmovd %edi, %xmm0
121 ; AVX-64-NEXT: vpinsrd $1, %esi, %xmm0, %xmm0
122 ; AVX-64-NEXT: vpinsrd $2, %edx, %xmm0, %xmm0
123 ; AVX-64-NEXT: vpslld $24, %xmm0, %xmm0
124 ; AVX-64-NEXT: vpsrad $24, %xmm0, %xmm0
125 ; AVX-64-NEXT: vmovd %xmm0, %eax
126 ; AVX-64-NEXT: vpextrw $2, %xmm0, %edx
127 ; AVX-64-NEXT: vpextrw $4, %xmm0, %ecx
128 ; AVX-64-NEXT: # kill: def $ax killed $ax killed $eax
129 ; AVX-64-NEXT: # kill: def $dx killed $dx killed $edx
130 ; AVX-64-NEXT: # kill: def $cx killed $cx killed $ecx
132 %2 = sext <3 x i8> %0 to <3 x i16>