xref: /llvm-project/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.permlane64.ll (revision 6548b6354d1d990e1c98736f5e7c3de876bedc8e)
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX11,GFX11-SDAG %s
3; RUN: llc -global-isel -mtriple=amdgcn -mcpu=gfx1100 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX11,GFX11-GISEL %s
4
5declare i32 @llvm.amdgcn.permlane64(i32)
6declare i32 @llvm.amdgcn.workitem.id.x()
7
8define amdgpu_kernel void @test_s(ptr addrspace(1) %out, i32 %src0) {
9; GFX11-LABEL: test_s:
10; GFX11:       ; %bb.0:
11; GFX11-NEXT:    s_clause 0x1
12; GFX11-NEXT:    s_load_b32 s2, s[4:5], 0x2c
13; GFX11-NEXT:    s_load_b64 s[0:1], s[4:5], 0x24
14; GFX11-NEXT:    s_waitcnt lgkmcnt(0)
15; GFX11-NEXT:    v_dual_mov_b32 v1, 0 :: v_dual_mov_b32 v0, s2
16; GFX11-NEXT:    s_delay_alu instid0(VALU_DEP_1)
17; GFX11-NEXT:    v_permlane64_b32 v0, v0
18; GFX11-NEXT:    global_store_b32 v1, v0, s[0:1]
19; GFX11-NEXT:    s_endpgm
20  %v = call i32 @llvm.amdgcn.permlane64(i32 %src0)
21  store i32 %v, ptr addrspace(1) %out
22  ret void
23}
24
25define amdgpu_kernel void @test_i(ptr addrspace(1) %out) {
26; GFX11-LABEL: test_i:
27; GFX11:       ; %bb.0:
28; GFX11-NEXT:    s_load_b64 s[0:1], s[4:5], 0x24
29; GFX11-NEXT:    v_dual_mov_b32 v0, 0x63 :: v_dual_mov_b32 v1, 0
30; GFX11-NEXT:    s_delay_alu instid0(VALU_DEP_1)
31; GFX11-NEXT:    v_permlane64_b32 v0, v0
32; GFX11-NEXT:    s_waitcnt lgkmcnt(0)
33; GFX11-NEXT:    global_store_b32 v1, v0, s[0:1]
34; GFX11-NEXT:    s_endpgm
35  %v = call i32 @llvm.amdgcn.permlane64(i32 99)
36  store i32 %v, ptr addrspace(1) %out
37  ret void
38}
39
40define amdgpu_kernel void @test_v(ptr addrspace(1) %out, i32 %src0) #1 {
41; GFX11-LABEL: test_v:
42; GFX11:       ; %bb.0:
43; GFX11-NEXT:    s_load_b64 s[0:1], s[4:5], 0x24
44; GFX11-NEXT:    v_dual_mov_b32 v1, 0 :: v_dual_and_b32 v0, 0x3ff, v0
45; GFX11-NEXT:    s_delay_alu instid0(VALU_DEP_1)
46; GFX11-NEXT:    v_permlane64_b32 v0, v0
47; GFX11-NEXT:    s_waitcnt lgkmcnt(0)
48; GFX11-NEXT:    global_store_b32 v1, v0, s[0:1]
49; GFX11-NEXT:    s_endpgm
50  %tidx = call i32 @llvm.amdgcn.workitem.id.x()
51  %v = call i32 @llvm.amdgcn.permlane64(i32 %tidx)
52  store i32 %v, ptr addrspace(1) %out
53  ret void
54}
55;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
56; GFX11-GISEL: {{.*}}
57; GFX11-SDAG: {{.*}}
58