1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; Test three-operand shifts.
4 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z196 | FileCheck %s
6 ; Check that we use SLLK over SLL where useful.
7 define i32 @f1(i32 %a, i32 %b, i32 %amt) {
10 ; CHECK-NEXT: sllk %r2, %r3, 15(%r4)
12 %add = add i32 %amt, 15
13 %shift = shl i32 %b, %add
17 ; Check that we use SLL over SLLK where possible.
18 define i32 @f2(i32 %a, i32 %amt) {
21 ; CHECK-NEXT: sll %r2, 15(%r3)
23 %add = add i32 %amt, 15
24 %shift = shl i32 %a, %add
28 ; Check that we use SRLK over SRL where useful.
29 define i32 @f3(i32 %a, i32 %b, i32 %amt) {
32 ; CHECK-NEXT: srlk %r2, %r3, 15(%r4)
34 %add = add i32 %amt, 15
35 %shift = lshr i32 %b, %add
39 ; Check that we use SRL over SRLK where possible.
40 define i32 @f4(i32 %a, i32 %amt) {
43 ; CHECK-NEXT: srl %r2, 15(%r3)
45 %add = add i32 %amt, 15
46 %shift = lshr i32 %a, %add
50 ; Check that we use SRAK over SRA where useful.
51 define i32 @f5(i32 %a, i32 %b, i32 %amt) {
54 ; CHECK-NEXT: srak %r2, %r3, 15(%r4)
56 %add = add i32 %amt, 15
57 %shift = ashr i32 %b, %add
61 ; Check that we use SRA over SRAK where possible.
62 define i32 @f6(i32 %a, i32 %amt) {
65 ; CHECK-NEXT: sra %r2, 15(%r3)
67 %add = add i32 %amt, 15
68 %shift = ashr i32 %a, %add