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), %ecx
12 ; SSE3-NEXT: movzbl {{[0-9]+}}(%esp), %edx
13 ; SSE3-NEXT: movzbl {{[0-9]+}}(%esp), %eax
14 ; SSE3-NEXT: movd %eax, %xmm0
15 ; SSE3-NEXT: pinsrw $1, %edx, %xmm0
16 ; SSE3-NEXT: pinsrw $2, %ecx, %xmm0
17 ; SSE3-NEXT: movd %xmm0, %eax
18 ; SSE3-NEXT: # kill: def $ax killed $ax killed $eax
19 ; SSE3-NEXT: # kill: def $dx killed $dx killed $edx
20 ; SSE3-NEXT: # kill: def $cx killed $cx killed $ecx
23 ; SSE41-LABEL: zext_i8:
25 ; SSE41-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
26 ; SSE41-NEXT: pinsrb $1, {{[0-9]+}}(%esp), %xmm0
27 ; SSE41-NEXT: pinsrb $2, {{[0-9]+}}(%esp), %xmm0
28 ; SSE41-NEXT: pmovzxbw {{.*#+}} xmm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero,xmm0[4],zero,xmm0[5],zero,xmm0[6],zero,xmm0[7],zero
29 ; SSE41-NEXT: movd %xmm0, %eax
30 ; SSE41-NEXT: pextrw $1, %xmm0, %edx
31 ; SSE41-NEXT: pextrw $2, %xmm0, %ecx
32 ; SSE41-NEXT: # kill: def $ax killed $ax killed $eax
33 ; SSE41-NEXT: # kill: def $dx killed $dx killed $edx
34 ; SSE41-NEXT: # kill: def $cx killed $cx killed $ecx
37 ; AVX-32-LABEL: zext_i8:
39 ; AVX-32-NEXT: vmovd {{.*#+}} xmm0 = mem[0],zero,zero,zero
40 ; AVX-32-NEXT: vpinsrb $1, {{[0-9]+}}(%esp), %xmm0, %xmm0
41 ; AVX-32-NEXT: vpinsrb $2, {{[0-9]+}}(%esp), %xmm0, %xmm0
42 ; AVX-32-NEXT: vpmovzxbw {{.*#+}} xmm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero,xmm0[4],zero,xmm0[5],zero,xmm0[6],zero,xmm0[7],zero
43 ; AVX-32-NEXT: vmovd %xmm0, %eax
44 ; AVX-32-NEXT: vpextrw $1, %xmm0, %edx
45 ; AVX-32-NEXT: vpextrw $2, %xmm0, %ecx
46 ; AVX-32-NEXT: # kill: def $ax killed $ax killed $eax
47 ; AVX-32-NEXT: # kill: def $dx killed $dx killed $edx
48 ; AVX-32-NEXT: # kill: def $cx killed $cx killed $ecx
51 ; AVX-64-LABEL: zext_i8:
53 ; AVX-64-NEXT: vmovd %edi, %xmm0
54 ; AVX-64-NEXT: vpinsrb $1, %esi, %xmm0, %xmm0
55 ; AVX-64-NEXT: vpinsrb $2, %edx, %xmm0, %xmm0
56 ; AVX-64-NEXT: vpmovzxbw {{.*#+}} xmm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero,xmm0[4],zero,xmm0[5],zero,xmm0[6],zero,xmm0[7],zero
57 ; AVX-64-NEXT: vmovd %xmm0, %eax
58 ; AVX-64-NEXT: vpextrw $1, %xmm0, %edx
59 ; AVX-64-NEXT: vpextrw $2, %xmm0, %ecx
60 ; AVX-64-NEXT: # kill: def $ax killed $ax killed $eax
61 ; AVX-64-NEXT: # kill: def $dx killed $dx killed $edx
62 ; AVX-64-NEXT: # kill: def $cx killed $cx killed $ecx
64 %2 = zext <3 x i8> %0 to <3 x i16>
68 define <3 x i16> @sext_i8(<3 x i8>) {
69 ; SSE3-LABEL: sext_i8:
71 ; SSE3-NEXT: movl {{[0-9]+}}(%esp), %eax
72 ; SSE3-NEXT: shll $8, %eax
73 ; SSE3-NEXT: movl {{[0-9]+}}(%esp), %ecx
74 ; SSE3-NEXT: shll $8, %ecx
75 ; SSE3-NEXT: movd %ecx, %xmm0
76 ; SSE3-NEXT: pinsrw $1, %eax, %xmm0
77 ; SSE3-NEXT: movl {{[0-9]+}}(%esp), %eax
78 ; SSE3-NEXT: shll $8, %eax
79 ; SSE3-NEXT: pinsrw $2, %eax, %xmm0
80 ; SSE3-NEXT: psraw $8, %xmm0
81 ; SSE3-NEXT: movd %xmm0, %eax
82 ; SSE3-NEXT: pextrw $1, %xmm0, %edx
83 ; SSE3-NEXT: pextrw $2, %xmm0, %ecx
84 ; SSE3-NEXT: # kill: def $ax killed $ax killed $eax
85 ; SSE3-NEXT: # kill: def $dx killed $dx killed $edx
86 ; SSE3-NEXT: # kill: def $cx killed $cx killed $ecx
89 ; SSE41-LABEL: sext_i8:
91 ; SSE41-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
92 ; SSE41-NEXT: pinsrb $1, {{[0-9]+}}(%esp), %xmm0
93 ; SSE41-NEXT: pinsrb $2, {{[0-9]+}}(%esp), %xmm0
94 ; SSE41-NEXT: pmovsxbw %xmm0, %xmm0
95 ; SSE41-NEXT: movd %xmm0, %eax
96 ; SSE41-NEXT: pextrw $1, %xmm0, %edx
97 ; SSE41-NEXT: pextrw $2, %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 $1, {{[0-9]+}}(%esp), %xmm0, %xmm0
107 ; AVX-32-NEXT: vpinsrb $2, {{[0-9]+}}(%esp), %xmm0, %xmm0
108 ; AVX-32-NEXT: vpmovsxbw %xmm0, %xmm0
109 ; AVX-32-NEXT: vmovd %xmm0, %eax
110 ; AVX-32-NEXT: vpextrw $1, %xmm0, %edx
111 ; AVX-32-NEXT: vpextrw $2, %xmm0, %ecx
112 ; AVX-32-NEXT: # kill: def $ax killed $ax killed $eax
113 ; AVX-32-NEXT: # kill: def $dx killed $dx killed $edx
114 ; AVX-32-NEXT: # kill: def $cx killed $cx killed $ecx
117 ; AVX-64-LABEL: sext_i8:
119 ; AVX-64-NEXT: vmovd %edi, %xmm0
120 ; AVX-64-NEXT: vpinsrb $1, %esi, %xmm0, %xmm0
121 ; AVX-64-NEXT: vpinsrb $2, %edx, %xmm0, %xmm0
122 ; AVX-64-NEXT: vpmovsxbw %xmm0, %xmm0
123 ; AVX-64-NEXT: vmovd %xmm0, %eax
124 ; AVX-64-NEXT: vpextrw $1, %xmm0, %edx
125 ; AVX-64-NEXT: vpextrw $2, %xmm0, %ecx
126 ; AVX-64-NEXT: # kill: def $ax killed $ax killed $eax
127 ; AVX-64-NEXT: # kill: def $dx killed $dx killed $edx
128 ; AVX-64-NEXT: # kill: def $cx killed $cx killed $ecx
130 %2 = sext <3 x i8> %0 to <3 x i16>