Skip to content

Commit 578e1c1

Browse files
committed
Added test for arithmetic shift.
1 parent f8cefee commit 578e1c1

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
; RUN: llc -global-isel -mtriple=amdgcn -mcpu=gfx90a -O0 -print-after=legalizer %s -o /dev/null 2>&1 | FileCheck %s
2+
3+
; CHECK-LABEL: widen_ashr_i4:
4+
define amdgpu_kernel void @widen_ashr_i4(
5+
ptr addrspace(1) %res, i4 %a, i4 %b) {
6+
; CHECK: G_ASHR %{{[0-9]+}}:_, %{{[0-9]+}}:_(s16)
7+
entry:
8+
%res.val = ashr i4 %a, %b
9+
store i4 %res.val, ptr addrspace(1) %res
10+
ret void
11+
}
12+
13+
; CHECK-LABEL: widen_ashr_v4i1:
14+
define amdgpu_kernel void @widen_ashr_v4i1(
15+
ptr addrspace(1) %res, <4 x i1> %a, <4 x i1> %b) {
16+
; CHECK: G_ASHR %{{[0-9]+}}:_, %{{[0-9]+}}:_(s16)
17+
; CHECK: G_ASHR %{{[0-9]+}}:_, %{{[0-9]+}}:_(s16)
18+
; CHECK: G_ASHR %{{[0-9]+}}:_, %{{[0-9]+}}:_(s16)
19+
; CHECK: G_ASHR %{{[0-9]+}}:_, %{{[0-9]+}}:_(s16)
20+
entry:
21+
%res.val = ashr <4 x i1> %a, %b
22+
store <4 x i1> %res.val, ptr addrspace(1) %res
23+
ret void
24+
}

0 commit comments

Comments
 (0)