1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -global-isel -march=amdgcn -verify-machineinstrs < %s | FileCheck %s
4 define amdgpu_cs i32 @test_shl_1(i32 inreg %arg1) {
5 ; CHECK-LABEL: test_shl_1:
6 ; CHECK: ; %bb.0: ; %.entry
7 ; CHECK-NEXT: s_lshl_b32 s0, s0, 5
8 ; CHECK-NEXT: ; return to shader part epilog
10 %z1 = shl i32 %arg1, 2
15 define amdgpu_cs i32 @test_shl_2(i32 inreg %arg1) {
16 ; CHECK-LABEL: test_shl_2:
17 ; CHECK: ; %bb.0: ; %.entry
18 ; CHECK-NEXT: s_lshl_b32 s0, s0, 10
19 ; CHECK-NEXT: ; return to shader part epilog
21 %z1 = shl i32 %arg1, 1
28 define amdgpu_cs i32 @test_shl_i32(i32 inreg %arg1) {
29 ; CHECK-LABEL: test_shl_i32:
30 ; CHECK: ; %bb.0: ; %.entry
31 ; CHECK-NEXT: s_mov_b32 s0, 0
32 ; CHECK-NEXT: ; return to shader part epilog
34 %z1 = shl i32 %arg1, 10
41 define amdgpu_cs i64 @test_shl_i64(i64 inreg %arg1) {
42 ; CHECK-LABEL: test_shl_i64:
43 ; CHECK: ; %bb.0: ; %.entry
44 ; CHECK-NEXT: s_mov_b32 s0, 0
45 ; CHECK-NEXT: s_mov_b32 s1, 0
46 ; CHECK-NEXT: ; return to shader part epilog
48 %z1 = shl i64 %arg1, 10
58 define amdgpu_cs i32 @test_ashr_1(i32 inreg %arg1) {
59 ; CHECK-LABEL: test_ashr_1:
60 ; CHECK: ; %bb.0: ; %.entry
61 ; CHECK-NEXT: s_ashr_i32 s0, s0, 5
62 ; CHECK-NEXT: ; return to shader part epilog
64 %z1 = ashr i32 %arg1, 2
69 define amdgpu_cs i32 @test_ashr_2(i32 inreg %arg1) {
70 ; CHECK-LABEL: test_ashr_2:
71 ; CHECK: ; %bb.0: ; %.entry
72 ; CHECK-NEXT: s_ashr_i32 s0, s0, 10
73 ; CHECK-NEXT: ; return to shader part epilog
75 %z1 = ashr i32 %arg1, 1
82 define amdgpu_cs i32 @test_ashr_i32(i32 inreg %arg1) {
83 ; CHECK-LABEL: test_ashr_i32:
84 ; CHECK: ; %bb.0: ; %.entry
85 ; CHECK-NEXT: s_ashr_i32 s0, s0, 31
86 ; CHECK-NEXT: ; return to shader part epilog
88 %z1 = ashr i32 %arg1, 10
89 %z2 = ashr i32 %z1, 10
90 %z3 = ashr i32 %z2, 10
91 %z4 = ashr i32 %z3, 10
95 define amdgpu_cs i64 @test_ashr_i64(i64 inreg %arg1) {
96 ; CHECK-LABEL: test_ashr_i64:
97 ; CHECK: ; %bb.0: ; %.entry
98 ; CHECK-NEXT: s_ashr_i32 s0, s1, 31
99 ; CHECK-NEXT: s_mov_b32 s1, s0
100 ; CHECK-NEXT: ; return to shader part epilog
102 %z1 = ashr i64 %arg1, 10
103 %z2 = ashr i64 %z1, 10
104 %z3 = ashr i64 %z2, 10
105 %z4 = ashr i64 %z3, 10
106 %z5 = ashr i64 %z4, 10
107 %z6 = ashr i64 %z5, 10
108 %z7 = ashr i64 %z6, 10
112 define amdgpu_cs i32 @test_lshr_1(i32 inreg %arg1) {
113 ; CHECK-LABEL: test_lshr_1:
114 ; CHECK: ; %bb.0: ; %.entry
115 ; CHECK-NEXT: s_lshr_b32 s0, s0, 5
116 ; CHECK-NEXT: ; return to shader part epilog
118 %z1 = lshr i32 %arg1, 2
119 %z2 = lshr i32 %z1, 3
123 define amdgpu_cs i32 @test_lshr_2(i32 inreg %arg1) {
124 ; CHECK-LABEL: test_lshr_2:
125 ; CHECK: ; %bb.0: ; %.entry
126 ; CHECK-NEXT: s_lshr_b32 s0, s0, 10
127 ; CHECK-NEXT: ; return to shader part epilog
129 %z1 = lshr i32 %arg1, 1
130 %z2 = lshr i32 %z1, 2
131 %z3 = lshr i32 %z2, 3
132 %z4 = lshr i32 %z3, 4
136 define amdgpu_cs i32 @test_lshr_i32(i32 inreg %arg1) {
137 ; CHECK-LABEL: test_lshr_i32:
138 ; CHECK: ; %bb.0: ; %.entry
139 ; CHECK-NEXT: s_mov_b32 s0, 0
140 ; CHECK-NEXT: ; return to shader part epilog
142 %z1 = lshr i32 %arg1, 10
143 %z2 = lshr i32 %z1, 10
144 %z3 = lshr i32 %z2, 10
145 %z4 = lshr i32 %z3, 10
149 define amdgpu_cs i64 @test_lshr_i64(i64 inreg %arg1) {
150 ; CHECK-LABEL: test_lshr_i64:
151 ; CHECK: ; %bb.0: ; %.entry
152 ; CHECK-NEXT: s_mov_b32 s0, 0
153 ; CHECK-NEXT: s_mov_b32 s1, 0
154 ; CHECK-NEXT: ; return to shader part epilog
156 %z1 = lshr i64 %arg1, 10
157 %z2 = lshr i64 %z1, 10
158 %z3 = lshr i64 %z2, 10
159 %z4 = lshr i64 %z3, 10
160 %z5 = lshr i64 %z4, 10
161 %z6 = lshr i64 %z5, 10
162 %z7 = lshr i64 %z6, 10