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: movl %edx, %ecx
10 ; ALL-NEXT: rolq %cl, %rdi
11 ; ALL-NEXT: movq %rdi, %rax
21 define i64 @bar(i64 %x, i64 %y, i64 %z) nounwind readnone {
23 ; ALL: # BB#0: # %entry
24 ; ALL-NEXT: movl %edx, %ecx
25 ; ALL-NEXT: shldq %cl, %rdi, %rsi
26 ; ALL-NEXT: movq %rsi, %rax
36 define i64 @un(i64 %x, i64 %y, i64 %z) nounwind readnone {
38 ; ALL: # BB#0: # %entry
39 ; ALL-NEXT: movl %edx, %ecx
40 ; ALL-NEXT: rorq %cl, %rdi
41 ; ALL-NEXT: movq %rdi, %rax
51 define i64 @bu(i64 %x, i64 %y, i64 %z) nounwind readnone {
53 ; ALL: # BB#0: # %entry
54 ; ALL-NEXT: movl %edx, %ecx
55 ; ALL-NEXT: shrdq %cl, %rdi, %rsi
56 ; ALL-NEXT: movq %rsi, %rax
66 define i64 @xfoo(i64 %x, i64 %y, i64 %z) nounwind readnone {
68 ; X64: # BB#0: # %entry
69 ; X64-NEXT: rolq $7, %rdi
70 ; X64-NEXT: movq %rdi, %rax
74 ; SHLD: # BB#0: # %entry
75 ; SHLD-NEXT: shldq $7, %rdi, %rdi
76 ; SHLD-NEXT: movq %rdi, %rax
80 ; BMI2: # BB#0: # %entry
81 ; BMI2-NEXT: rorxq $57, %rdi, %rax
90 define i64 @xfoop(i64* %p) nounwind readnone {
92 ; X64: # BB#0: # %entry
93 ; X64-NEXT: movq (%rdi), %rax
94 ; X64-NEXT: rolq $7, %rax
98 ; SHLD: # BB#0: # %entry
99 ; SHLD-NEXT: movq (%rdi), %rax
100 ; SHLD-NEXT: shldq $7, %rax, %rax
104 ; BMI2: # BB#0: # %entry
105 ; BMI2-NEXT: rorxq $57, (%rdi), %rax
108 %x = load i64, i64* %p
115 define i64 @xbar(i64 %x, i64 %y, i64 %z) nounwind readnone {
117 ; ALL: # BB#0: # %entry
118 ; ALL-NEXT: shrdq $57, %rsi, %rdi
119 ; ALL-NEXT: movq %rdi, %rax
128 define i64 @xun(i64 %x, i64 %y, i64 %z) nounwind readnone {
130 ; X64: # BB#0: # %entry
131 ; X64-NEXT: rolq $57, %rdi
132 ; X64-NEXT: movq %rdi, %rax
136 ; SHLD: # BB#0: # %entry
137 ; SHLD-NEXT: shldq $57, %rdi, %rdi
138 ; SHLD-NEXT: movq %rdi, %rax
142 ; BMI2: # BB#0: # %entry
143 ; BMI2-NEXT: rorxq $7, %rdi, %rax
152 define i64 @xunp(i64* %p) nounwind readnone {
154 ; X64: # BB#0: # %entry
155 ; X64-NEXT: movq (%rdi), %rax
156 ; X64-NEXT: rolq $57, %rax
160 ; SHLD: # BB#0: # %entry
161 ; SHLD-NEXT: movq (%rdi), %rax
162 ; SHLD-NEXT: shldq $57, %rax, %rax
166 ; BMI2: # BB#0: # %entry
167 ; BMI2-NEXT: rorxq $7, (%rdi), %rax
170 %x = load i64, i64* %p
177 define i64 @xbu(i64 %x, i64 %y, i64 %z) nounwind readnone {
179 ; ALL: # BB#0: # %entry
180 ; ALL-NEXT: shldq $57, %rsi, %rdi
181 ; ALL-NEXT: movq %rdi, %rax