1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown-unknown | FileCheck %s --check-prefixes=CHECK,X86
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s --check-prefixes=CHECK,X64
5 define i32 @i32_zext_shift_i16_zext_i1(i1 %a0) nounwind {
6 ; CHECK-LABEL: i32_zext_shift_i16_zext_i1:
8 ; CHECK-NEXT: xorl %eax, %eax
9 ; CHECK-NEXT: ret{{[l|q]}}
10 %t0 = zext i1 %a0 to i16
12 %t2 = zext i16 %t1 to i32
16 define i32 @i32_zext_shift_i16_zext_i8(i8 %a0) nounwind {
17 ; X86-LABEL: i32_zext_shift_i16_zext_i8:
19 ; X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
20 ; X86-NEXT: shrl $5, %eax
23 ; X64-LABEL: i32_zext_shift_i16_zext_i8:
25 ; X64-NEXT: movzbl %dil, %eax
26 ; X64-NEXT: shrl $5, %eax
28 %t0 = zext i8 %a0 to i16
30 %t2 = zext i16 %t1 to i32
34 define i64 @i64_zext_shift_i16_zext_i8(i8 %a0) nounwind {
35 ; X86-LABEL: i64_zext_shift_i16_zext_i8:
37 ; X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
38 ; X86-NEXT: shrl $5, %eax
39 ; X86-NEXT: xorl %edx, %edx
42 ; X64-LABEL: i64_zext_shift_i16_zext_i8:
44 ; X64-NEXT: movzbl %dil, %eax
45 ; X64-NEXT: shrl $5, %eax
47 %t0 = zext i8 %a0 to i16
49 %t2 = zext i16 %t1 to i64
53 define i64 @i64_zext_shift_i32_zext_i8(i8 %a0) nounwind {
54 ; X86-LABEL: i64_zext_shift_i32_zext_i8:
56 ; X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
57 ; X86-NEXT: shrl $3, %eax
58 ; X86-NEXT: xorl %edx, %edx
61 ; X64-LABEL: i64_zext_shift_i32_zext_i8:
63 ; X64-NEXT: movzbl %dil, %eax
64 ; X64-NEXT: shrl $3, %eax
66 %t0 = zext i8 %a0 to i32
68 %t2 = zext i32 %t1 to i64
72 define i64 @i64_zext_shift_i32_zext_i16(i16 %a0) nounwind {
73 ; X86-LABEL: i64_zext_shift_i32_zext_i16:
75 ; X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax
76 ; X86-NEXT: shrl $5, %eax
77 ; X86-NEXT: xorl %edx, %edx
80 ; X64-LABEL: i64_zext_shift_i32_zext_i16:
82 ; X64-NEXT: movzwl %di, %eax
83 ; X64-NEXT: shrl $5, %eax
85 %t0 = zext i16 %a0 to i32
87 %t2 = zext i32 %t1 to i64
91 define i128 @i128_zext_shift_i64_zext_i8(i8 %a0) nounwind {
92 ; X86-LABEL: i128_zext_shift_i64_zext_i8:
94 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
95 ; X86-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
96 ; X86-NEXT: shrl $4, %ecx
97 ; X86-NEXT: movl %ecx, (%eax)
98 ; X86-NEXT: movl $0, 12(%eax)
99 ; X86-NEXT: movl $0, 8(%eax)
100 ; X86-NEXT: movl $0, 4(%eax)
103 ; X64-LABEL: i128_zext_shift_i64_zext_i8:
105 ; X64-NEXT: movzbl %dil, %eax
106 ; X64-NEXT: shrl $4, %eax
107 ; X64-NEXT: xorl %edx, %edx
109 %t0 = zext i8 %a0 to i64
110 %t1 = lshr i64 %t0, 4
111 %t2 = zext i64 %t1 to i128
115 define i128 @i128_zext_shift_i64_zext_i16(i16 %a0) nounwind {
116 ; X86-LABEL: i128_zext_shift_i64_zext_i16:
118 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
119 ; X86-NEXT: movzwl {{[0-9]+}}(%esp), %ecx
120 ; X86-NEXT: shrl $7, %ecx
121 ; X86-NEXT: movl %ecx, (%eax)
122 ; X86-NEXT: movl $0, 12(%eax)
123 ; X86-NEXT: movl $0, 8(%eax)
124 ; X86-NEXT: movl $0, 4(%eax)
127 ; X64-LABEL: i128_zext_shift_i64_zext_i16:
129 ; X64-NEXT: movzwl %di, %eax
130 ; X64-NEXT: shrl $7, %eax
131 ; X64-NEXT: xorl %edx, %edx
133 %t0 = zext i16 %a0 to i64
135 %t2 = zext i64 %t1 to i128