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), %edx
12 ; SSE3-NEXT: movzbl {{[0-9]+}}(%esp), %eax
13 ; SSE3-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
14 ; SSE3-NEXT: # kill: def $ax killed $ax killed $eax
15 ; SSE3-NEXT: # kill: def $dx killed $dx killed $edx
16 ; SSE3-NEXT: # kill: def $cx killed $cx killed $ecx
19 ; SSE41-LABEL: zext_i8:
21 ; SSE41-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
22 ; SSE41-NEXT: movzbl {{[0-9]+}}(%esp), %edx
23 ; SSE41-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
24 ; 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
25 ; SSE41-NEXT: movd %xmm0, %eax
26 ; SSE41-NEXT: # kill: def $ax killed $ax killed $eax
27 ; SSE41-NEXT: # kill: def $dx killed $dx killed $edx
28 ; SSE41-NEXT: # kill: def $cx killed $cx killed $ecx
31 ; AVX-32-LABEL: zext_i8:
33 ; AVX-32-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
34 ; AVX-32-NEXT: movzbl {{[0-9]+}}(%esp), %edx
35 ; AVX-32-NEXT: vmovd {{.*#+}} xmm0 = mem[0],zero,zero,zero
36 ; 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
37 ; AVX-32-NEXT: vmovd %xmm0, %eax
38 ; AVX-32-NEXT: # kill: def $ax killed $ax killed $eax
39 ; AVX-32-NEXT: # kill: def $dx killed $dx killed $edx
40 ; AVX-32-NEXT: # kill: def $cx killed $cx killed $ecx
43 ; AVX-64-LABEL: zext_i8:
45 ; AVX-64-NEXT: movzbl %dl, %ecx
46 ; AVX-64-NEXT: movzbl %sil, %edx
47 ; AVX-64-NEXT: vmovd %edi, %xmm0
48 ; 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
49 ; AVX-64-NEXT: vmovd %xmm0, %eax
50 ; AVX-64-NEXT: # kill: def $ax killed $ax killed $eax
51 ; AVX-64-NEXT: # kill: def $dx killed $dx killed $edx
52 ; AVX-64-NEXT: # kill: def $cx killed $cx killed $ecx
54 %2 = zext <3 x i8> %0 to <3 x i16>
58 define <3 x i16> @sext_i8(<3 x i8>) {
59 ; SSE3-LABEL: sext_i8:
61 ; SSE3-NEXT: movzbl {{[0-9]+}}(%esp), %eax
62 ; SSE3-NEXT: movl {{[0-9]+}}(%esp), %ecx
63 ; SSE3-NEXT: shll $24, %ecx
64 ; SSE3-NEXT: shll $8, %eax
65 ; SSE3-NEXT: orl %ecx, %eax
66 ; SSE3-NEXT: movd %eax, %xmm0
67 ; SSE3-NEXT: movl {{[0-9]+}}(%esp), %eax
68 ; SSE3-NEXT: shll $8, %eax
69 ; SSE3-NEXT: pinsrw $2, %eax, %xmm0
70 ; SSE3-NEXT: psraw $8, %xmm0
71 ; SSE3-NEXT: movd %xmm0, %eax
72 ; SSE3-NEXT: pextrw $1, %xmm0, %edx
73 ; SSE3-NEXT: pextrw $2, %xmm0, %ecx
74 ; SSE3-NEXT: # kill: def $ax killed $ax killed $eax
75 ; SSE3-NEXT: # kill: def $dx killed $dx killed $edx
76 ; SSE3-NEXT: # kill: def $cx killed $cx killed $ecx
79 ; SSE41-LABEL: sext_i8:
81 ; SSE41-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
82 ; SSE41-NEXT: pinsrb $1, {{[0-9]+}}(%esp), %xmm0
83 ; SSE41-NEXT: pinsrb $2, {{[0-9]+}}(%esp), %xmm0
84 ; SSE41-NEXT: pmovsxbw %xmm0, %xmm0
85 ; SSE41-NEXT: movd %xmm0, %eax
86 ; SSE41-NEXT: pextrw $1, %xmm0, %edx
87 ; SSE41-NEXT: pextrw $2, %xmm0, %ecx
88 ; SSE41-NEXT: # kill: def $ax killed $ax killed $eax
89 ; SSE41-NEXT: # kill: def $dx killed $dx killed $edx
90 ; SSE41-NEXT: # kill: def $cx killed $cx killed $ecx
93 ; AVX-32-LABEL: sext_i8:
95 ; AVX-32-NEXT: vmovd {{.*#+}} xmm0 = mem[0],zero,zero,zero
96 ; AVX-32-NEXT: vpinsrb $1, {{[0-9]+}}(%esp), %xmm0, %xmm0
97 ; AVX-32-NEXT: vpinsrb $2, {{[0-9]+}}(%esp), %xmm0, %xmm0
98 ; AVX-32-NEXT: vpmovsxbw %xmm0, %xmm0
99 ; AVX-32-NEXT: vmovd %xmm0, %eax
100 ; AVX-32-NEXT: vpextrw $1, %xmm0, %edx
101 ; AVX-32-NEXT: vpextrw $2, %xmm0, %ecx
102 ; AVX-32-NEXT: # kill: def $ax killed $ax killed $eax
103 ; AVX-32-NEXT: # kill: def $dx killed $dx killed $edx
104 ; AVX-32-NEXT: # kill: def $cx killed $cx killed $ecx
107 ; AVX-64-LABEL: sext_i8:
109 ; AVX-64-NEXT: vmovd %edi, %xmm0
110 ; AVX-64-NEXT: vpinsrb $1, %esi, %xmm0, %xmm0
111 ; AVX-64-NEXT: vpinsrb $2, %edx, %xmm0, %xmm0
112 ; AVX-64-NEXT: vpmovsxbw %xmm0, %xmm0
113 ; AVX-64-NEXT: vmovd %xmm0, %eax
114 ; AVX-64-NEXT: vpextrw $1, %xmm0, %edx
115 ; AVX-64-NEXT: vpextrw $2, %xmm0, %ecx
116 ; AVX-64-NEXT: # kill: def $ax killed $ax killed $eax
117 ; AVX-64-NEXT: # kill: def $dx killed $dx killed $edx
118 ; AVX-64-NEXT: # kill: def $cx killed $cx killed $ecx
120 %2 = sext <3 x i8> %0 to <3 x i16>