1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-- -mcpu=corei7 | FileCheck %s --check-prefix=ALL --check-prefix=X86
3 ; RUN: llc < %s -mtriple=i686-- -mcpu=corei7-avx | FileCheck %s --check-prefix=ALL --check-prefix=SHLD
4 ; RUN: llc < %s -mtriple=i686-- -mcpu=core-avx2 | FileCheck %s --check-prefix=ALL --check-prefix=BMI2
6 define i32 @foo(i32 %x, i32 %y, i32 %z) nounwind readnone {
8 ; ALL: # %bb.0: # %entry
9 ; ALL-NEXT: movb {{[0-9]+}}(%esp), %cl
10 ; ALL-NEXT: movl {{[0-9]+}}(%esp), %eax
11 ; ALL-NEXT: roll %cl, %eax
21 define i32 @bar(i32 %x, i32 %y, i32 %z) nounwind readnone {
23 ; ALL: # %bb.0: # %entry
24 ; ALL-NEXT: movb {{[0-9]+}}(%esp), %cl
25 ; ALL-NEXT: movl {{[0-9]+}}(%esp), %edx
26 ; ALL-NEXT: movl {{[0-9]+}}(%esp), %eax
27 ; ALL-NEXT: shldl %cl, %edx, %eax
37 define i32 @un(i32 %x, i32 %y, i32 %z) nounwind readnone {
39 ; ALL: # %bb.0: # %entry
40 ; ALL-NEXT: movb {{[0-9]+}}(%esp), %cl
41 ; ALL-NEXT: movl {{[0-9]+}}(%esp), %eax
42 ; ALL-NEXT: rorl %cl, %eax
52 define i32 @bu(i32 %x, i32 %y, i32 %z) nounwind readnone {
54 ; ALL: # %bb.0: # %entry
55 ; ALL-NEXT: movb {{[0-9]+}}(%esp), %cl
56 ; ALL-NEXT: movl {{[0-9]+}}(%esp), %edx
57 ; ALL-NEXT: movl {{[0-9]+}}(%esp), %eax
58 ; ALL-NEXT: shrdl %cl, %edx, %eax
68 define i32 @xfoo(i32 %x, i32 %y, i32 %z) nounwind readnone {
70 ; X86: # %bb.0: # %entry
71 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
72 ; X86-NEXT: roll $7, %eax
76 ; SHLD: # %bb.0: # %entry
77 ; SHLD-NEXT: movl {{[0-9]+}}(%esp), %eax
78 ; SHLD-NEXT: shldl $7, %eax, %eax
82 ; BMI2: # %bb.0: # %entry
83 ; BMI2-NEXT: rorxl $25, {{[0-9]+}}(%esp), %eax
92 define i32 @xfoop(i32* %p) nounwind readnone {
94 ; X86: # %bb.0: # %entry
95 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
96 ; X86-NEXT: movl (%eax), %eax
97 ; X86-NEXT: roll $7, %eax
101 ; SHLD: # %bb.0: # %entry
102 ; SHLD-NEXT: movl {{[0-9]+}}(%esp), %eax
103 ; SHLD-NEXT: movl (%eax), %eax
104 ; SHLD-NEXT: shldl $7, %eax, %eax
108 ; BMI2: # %bb.0: # %entry
109 ; BMI2-NEXT: movl {{[0-9]+}}(%esp), %eax
110 ; BMI2-NEXT: rorxl $25, (%eax), %eax
113 %x = load i32, i32* %p
120 define i32 @xbar(i32 %x, i32 %y, i32 %z) nounwind readnone {
122 ; ALL: # %bb.0: # %entry
123 ; ALL-NEXT: movl {{[0-9]+}}(%esp), %ecx
124 ; ALL-NEXT: movl {{[0-9]+}}(%esp), %eax
125 ; ALL-NEXT: shldl $7, %ecx, %eax
134 define i32 @xun(i32 %x, i32 %y, i32 %z) nounwind readnone {
136 ; X86: # %bb.0: # %entry
137 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
138 ; X86-NEXT: roll $25, %eax
142 ; SHLD: # %bb.0: # %entry
143 ; SHLD-NEXT: movl {{[0-9]+}}(%esp), %eax
144 ; SHLD-NEXT: shldl $25, %eax, %eax
148 ; BMI2: # %bb.0: # %entry
149 ; BMI2-NEXT: rorxl $7, {{[0-9]+}}(%esp), %eax
158 define i32 @xunp(i32* %p) nounwind readnone {
160 ; X86: # %bb.0: # %entry
161 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
162 ; X86-NEXT: movl (%eax), %eax
163 ; X86-NEXT: roll $25, %eax
167 ; SHLD: # %bb.0: # %entry
168 ; SHLD-NEXT: movl {{[0-9]+}}(%esp), %eax
169 ; SHLD-NEXT: movl (%eax), %eax
170 ; SHLD-NEXT: shldl $25, %eax, %eax
174 ; BMI2: # %bb.0: # %entry
175 ; BMI2-NEXT: movl {{[0-9]+}}(%esp), %eax
176 ; BMI2-NEXT: rorxl $7, (%eax), %eax
181 %x = load i32, i32* %p
188 define i32 @xbu(i32 %x, i32 %y, i32 %z) nounwind readnone {
190 ; ALL: # %bb.0: # %entry
191 ; ALL-NEXT: movl {{[0-9]+}}(%esp), %ecx
192 ; ALL-NEXT: movl {{[0-9]+}}(%esp), %eax
193 ; ALL-NEXT: shldl $25, %ecx, %eax