1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown-unknown | FileCheck %s --check-prefix=X32
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s --check-prefix=X64
5 define i16 @foo(i16 %x, i16 %y, i16 %z) nounwind {
8 ; X32-NEXT: movb {{[0-9]+}}(%esp), %cl
9 ; X32-NEXT: movzwl {{[0-9]+}}(%esp), %eax
10 ; X32-NEXT: rolw %cl, %ax
15 ; X64-NEXT: movl %edx, %ecx
16 ; X64-NEXT: movl %edi, %eax
17 ; X64-NEXT: # kill: def $cl killed $cl killed $ecx
18 ; X64-NEXT: rolw %cl, %ax
19 ; X64-NEXT: # kill: def $ax killed $ax killed $eax
23 %t2 = lshr i16 %x, %t1
28 define i16 @bar(i16 %x, i16 %y, i16 %z) nounwind {
31 ; X32-NEXT: movzwl {{[0-9]+}}(%esp), %edx
32 ; X32-NEXT: movzwl {{[0-9]+}}(%esp), %eax
33 ; X32-NEXT: movb {{[0-9]+}}(%esp), %cl
34 ; X32-NEXT: andb $15, %cl
35 ; X32-NEXT: shldw %cl, %dx, %ax
40 ; X64-NEXT: movl %edx, %ecx
41 ; X64-NEXT: movl %esi, %eax
42 ; X64-NEXT: andb $15, %cl
43 ; X64-NEXT: # kill: def $cl killed $cl killed $ecx
44 ; X64-NEXT: shldw %cl, %di, %ax
45 ; X64-NEXT: # kill: def $ax killed $ax killed $eax
49 %t2 = lshr i16 %x, %t1
54 define i16 @un(i16 %x, i16 %y, i16 %z) nounwind {
57 ; X32-NEXT: movb {{[0-9]+}}(%esp), %cl
58 ; X32-NEXT: movzwl {{[0-9]+}}(%esp), %eax
59 ; X32-NEXT: rorw %cl, %ax
64 ; X64-NEXT: movl %edx, %ecx
65 ; X64-NEXT: movl %edi, %eax
66 ; X64-NEXT: # kill: def $cl killed $cl killed $ecx
67 ; X64-NEXT: rorw %cl, %ax
68 ; X64-NEXT: # kill: def $ax killed $ax killed $eax
77 define i16 @bu(i16 %x, i16 %y, i16 %z) nounwind {
80 ; X32-NEXT: movzwl {{[0-9]+}}(%esp), %edx
81 ; X32-NEXT: movzwl {{[0-9]+}}(%esp), %eax
82 ; X32-NEXT: movb {{[0-9]+}}(%esp), %cl
83 ; X32-NEXT: andb $15, %cl
84 ; X32-NEXT: shrdw %cl, %dx, %ax
89 ; X64-NEXT: movl %edx, %ecx
90 ; X64-NEXT: movl %esi, %eax
91 ; X64-NEXT: andb $15, %cl
92 ; X64-NEXT: # kill: def $cl killed $cl killed $ecx
93 ; X64-NEXT: shrdw %cl, %di, %ax
94 ; X64-NEXT: # kill: def $ax killed $ax killed $eax
103 define i16 @xfoo(i16 %x, i16 %y, i16 %z) nounwind {
106 ; X32-NEXT: movzwl {{[0-9]+}}(%esp), %eax
107 ; X32-NEXT: rolw $5, %ax
112 ; X64-NEXT: movl %edi, %eax
113 ; X64-NEXT: rolw $5, %ax
114 ; X64-NEXT: # kill: def $ax killed $ax killed $eax
116 %t0 = lshr i16 %x, 11
118 %t2 = or i16 %t0, %t1
122 define i16 @xbar(i16 %x, i16 %y, i16 %z) nounwind {
125 ; X32-NEXT: movzwl {{[0-9]+}}(%esp), %ecx
126 ; X32-NEXT: movzwl {{[0-9]+}}(%esp), %eax
127 ; X32-NEXT: shldw $5, %cx, %ax
132 ; X64-NEXT: movl %esi, %eax
133 ; X64-NEXT: shldw $5, %di, %ax
134 ; X64-NEXT: # kill: def $ax killed $ax killed $eax
137 %t1 = lshr i16 %x, 11
138 %t2 = or i16 %t0, %t1
142 define i16 @xun(i16 %x, i16 %y, i16 %z) nounwind {
145 ; X32-NEXT: movzwl {{[0-9]+}}(%esp), %eax
146 ; X32-NEXT: rolw $11, %ax
151 ; X64-NEXT: movl %edi, %eax
152 ; X64-NEXT: rolw $11, %ax
153 ; X64-NEXT: # kill: def $ax killed $ax killed $eax
157 %t2 = or i16 %t0, %t1
161 define i16 @xbu(i16 %x, i16 %y, i16 %z) nounwind {
164 ; X32-NEXT: movzwl {{[0-9]+}}(%esp), %ecx
165 ; X32-NEXT: movzwl {{[0-9]+}}(%esp), %eax
166 ; X32-NEXT: shldw $11, %cx, %ax
171 ; X64-NEXT: movl %edi, %eax
172 ; X64-NEXT: shldw $11, %si, %ax
173 ; X64-NEXT: # kill: def $ax killed $ax killed $eax
177 %t2 = or i16 %t0, %t1