1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-- -mcpu=corei7 | FileCheck %s --check-prefix=ALL --check-prefix=X64
3 ; RUN: llc < %s -mtriple=x86_64-- -mcpu=corei7-avx | FileCheck %s --check-prefix=ALL --check-prefix=SHLD
4 ; RUN: llc < %s -mtriple=x86_64-- -mcpu=core-avx2 | FileCheck %s --check-prefix=ALL --check-prefix=BMI2
6 define i64 @foo(i64 %x, i64 %y, i64 %z) nounwind readnone {
8 ; ALL: # %bb.0: # %entry
9 ; ALL-NEXT: movq %rdx, %rcx
10 ; ALL-NEXT: movq %rdi, %rax
11 ; ALL-NEXT: # kill: def $cl killed $cl killed $rcx
12 ; ALL-NEXT: rolq %cl, %rax
22 define i64 @bar(i64 %x, i64 %y, i64 %z) nounwind readnone {
24 ; ALL: # %bb.0: # %entry
25 ; ALL-NEXT: movq %rdx, %rcx
26 ; ALL-NEXT: movq %rsi, %rax
27 ; ALL-NEXT: # kill: def $cl killed $cl killed $rcx
28 ; ALL-NEXT: shldq %cl, %rdi, %rax
38 define i64 @un(i64 %x, i64 %y, i64 %z) nounwind readnone {
40 ; ALL: # %bb.0: # %entry
41 ; ALL-NEXT: movq %rdx, %rcx
42 ; ALL-NEXT: movq %rdi, %rax
43 ; ALL-NEXT: # kill: def $cl killed $cl killed $rcx
44 ; ALL-NEXT: rorq %cl, %rax
54 define i64 @bu(i64 %x, i64 %y, i64 %z) nounwind readnone {
56 ; ALL: # %bb.0: # %entry
57 ; ALL-NEXT: movq %rdx, %rcx
58 ; ALL-NEXT: movq %rsi, %rax
59 ; ALL-NEXT: # kill: def $cl killed $cl killed $rcx
60 ; ALL-NEXT: shrdq %cl, %rdi, %rax
70 define i64 @xfoo(i64 %x, i64 %y, i64 %z) nounwind readnone {
72 ; X64: # %bb.0: # %entry
73 ; X64-NEXT: movq %rdi, %rax
74 ; X64-NEXT: rolq $7, %rax
78 ; SHLD: # %bb.0: # %entry
79 ; SHLD-NEXT: movq %rdi, %rax
80 ; SHLD-NEXT: shldq $7, %rdi, %rax
84 ; BMI2: # %bb.0: # %entry
85 ; BMI2-NEXT: rorxq $57, %rdi, %rax
94 define i64 @xfoop(i64* %p) nounwind readnone {
96 ; X64: # %bb.0: # %entry
97 ; X64-NEXT: movq (%rdi), %rax
98 ; X64-NEXT: rolq $7, %rax
102 ; SHLD: # %bb.0: # %entry
103 ; SHLD-NEXT: movq (%rdi), %rax
104 ; SHLD-NEXT: shldq $7, %rax, %rax
108 ; BMI2: # %bb.0: # %entry
109 ; BMI2-NEXT: rorxq $57, (%rdi), %rax
112 %x = load i64, i64* %p
119 define i64 @xbar(i64 %x, i64 %y, i64 %z) nounwind readnone {
121 ; ALL: # %bb.0: # %entry
122 ; ALL-NEXT: movq %rdi, %rax
123 ; ALL-NEXT: shrdq $57, %rsi, %rax
132 define i64 @xun(i64 %x, i64 %y, i64 %z) nounwind readnone {
134 ; X64: # %bb.0: # %entry
135 ; X64-NEXT: movq %rdi, %rax
136 ; X64-NEXT: rolq $57, %rax
140 ; SHLD: # %bb.0: # %entry
141 ; SHLD-NEXT: movq %rdi, %rax
142 ; SHLD-NEXT: shldq $57, %rdi, %rax
146 ; BMI2: # %bb.0: # %entry
147 ; BMI2-NEXT: rorxq $7, %rdi, %rax
156 define i64 @xunp(i64* %p) nounwind readnone {
158 ; X64: # %bb.0: # %entry
159 ; X64-NEXT: movq (%rdi), %rax
160 ; X64-NEXT: rolq $57, %rax
164 ; SHLD: # %bb.0: # %entry
165 ; SHLD-NEXT: movq (%rdi), %rax
166 ; SHLD-NEXT: shldq $57, %rax, %rax
170 ; BMI2: # %bb.0: # %entry
171 ; BMI2-NEXT: rorxq $7, (%rdi), %rax
174 %x = load i64, i64* %p
181 define i64 @xbu(i64 %x, i64 %y, i64 %z) nounwind readnone {
183 ; ALL: # %bb.0: # %entry
184 ; ALL-NEXT: movq %rdi, %rax
185 ; ALL-NEXT: shldq $57, %rsi, %rax