1 ; Test three-operand shifts.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z196 | FileCheck %s
5 ; Check that we use SLLK over SLL where useful.
6 define i32 @f1(i32 %a, i32 %b, i32 %amt) {
8 ; CHECK: sllk %r2, %r3, 15(%r4)
10 %add = add i32 %amt, 15
11 %shift = shl i32 %b, %add
15 ; Check that we use SLL over SLLK where possible.
16 define i32 @f2(i32 %a, i32 %amt) {
18 ; CHECK: sll %r2, 15(%r3)
20 %add = add i32 %amt, 15
21 %shift = shl i32 %a, %add
25 ; Check that we use SRLK over SRL where useful.
26 define i32 @f3(i32 %a, i32 %b, i32 %amt) {
28 ; CHECK: srlk %r2, %r3, 15(%r4)
30 %add = add i32 %amt, 15
31 %shift = lshr i32 %b, %add
35 ; Check that we use SRL over SRLK where possible.
36 define i32 @f4(i32 %a, i32 %amt) {
38 ; CHECK: srl %r2, 15(%r3)
40 %add = add i32 %amt, 15
41 %shift = lshr i32 %a, %add
45 ; Check that we use SRAK over SRA where useful.
46 define i32 @f5(i32 %a, i32 %b, i32 %amt) {
48 ; CHECK: srak %r2, %r3, 15(%r4)
50 %add = add i32 %amt, 15
51 %shift = ashr i32 %b, %add
55 ; Check that we use SRA over SRAK where possible.
56 define i32 @f6(i32 %a, i32 %amt) {
58 ; CHECK: sra %r2, 15(%r3)
60 %add = add i32 %amt, 15
61 %shift = ashr i32 %a, %add