1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=bdver1 | FileCheck %s
4 ; Verify that for the architectures that are known to have poor latency
5 ; double precision shift instructions we generate alternative sequence
6 ; of instructions with lower latencies instead of shrd instruction.
8 ;uint64_t rshift1(uint64_t a, uint64_t b)
10 ; return (a >> 1) | (b << 63);
13 define i64 @rshift1(i64 %a, i64 %b) nounwind readnone uwtable {
14 ; CHECK-LABEL: rshift1:
16 ; CHECK-NEXT: shrq %rdi
17 ; CHECK-NEXT: shlq $63, %rsi
18 ; CHECK-NEXT: leaq (%rsi,%rdi), %rax
26 ;uint64_t rshift2(uint64_t a, uint64_t b)
28 ; return (a >> 2) | (b << 62);
31 define i64 @rshift2(i64 %a, i64 %b) nounwind readnone uwtable {
32 ; CHECK-LABEL: rshift2:
34 ; CHECK-NEXT: shrq $2, %rdi
35 ; CHECK-NEXT: shlq $62, %rsi
36 ; CHECK-NEXT: leaq (%rsi,%rdi), %rax
44 ;uint64_t rshift7(uint64_t a, uint64_t b)
46 ; return (a >> 7) | (b << 57);
49 define i64 @rshift7(i64 %a, i64 %b) nounwind readnone uwtable {
50 ; CHECK-LABEL: rshift7:
52 ; CHECK-NEXT: shrq $7, %rdi
53 ; CHECK-NEXT: shlq $57, %rsi
54 ; CHECK-NEXT: leaq (%rsi,%rdi), %rax
62 ;uint64_t rshift63(uint64_t a, uint64_t b)
64 ; return (a >> 63) | (b << 1);
67 define i64 @rshift63(i64 %a, i64 %b) nounwind readnone uwtable {
68 ; CHECK-LABEL: rshift63:
70 ; CHECK-NEXT: shrq $63, %rdi
71 ; CHECK-NEXT: leaq (%rdi,%rsi,2), %rax