1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx900 -o - %s | FileCheck -check-prefix=GCN %s
3 ; RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx1010 -o - %s | FileCheck -check-prefixes=GFX10PLUS,GFX10 %s
4 ; RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx1100 -amdgpu-enable-delay-alu=0 -o - %s | FileCheck -check-prefixes=GFX10PLUS,GFX11 %s
6 define ptr addrspace(1) @v_ptrmask_global_variable_i64(ptr addrspace(1) %ptr, i64 %mask) {
7 ; GCN-LABEL: v_ptrmask_global_variable_i64:
9 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
10 ; GCN-NEXT: v_and_b32_e32 v1, v1, v3
11 ; GCN-NEXT: v_and_b32_e32 v0, v0, v2
12 ; GCN-NEXT: s_setpc_b64 s[30:31]
14 ; GFX10PLUS-LABEL: v_ptrmask_global_variable_i64:
16 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
17 ; GFX10PLUS-NEXT: v_and_b32_e32 v0, v0, v2
18 ; GFX10PLUS-NEXT: v_and_b32_e32 v1, v1, v3
19 ; GFX10PLUS-NEXT: s_setpc_b64 s[30:31]
20 %masked = call ptr addrspace(1) @llvm.ptrmask.p1.i64(ptr addrspace(1) %ptr, i64 %mask)
21 ret ptr addrspace(1) %masked
24 define ptr addrspace(3) @v_ptrmask_local_variable_i32(ptr addrspace(3) %ptr, i32 %mask) {
25 ; GCN-LABEL: v_ptrmask_local_variable_i32:
27 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
28 ; GCN-NEXT: v_and_b32_e32 v0, v0, v1
29 ; GCN-NEXT: s_setpc_b64 s[30:31]
31 ; GFX10PLUS-LABEL: v_ptrmask_local_variable_i32:
33 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
34 ; GFX10PLUS-NEXT: v_and_b32_e32 v0, v0, v1
35 ; GFX10PLUS-NEXT: s_setpc_b64 s[30:31]
36 %masked = call ptr addrspace(3) @llvm.ptrmask.p3.i32(ptr addrspace(3) %ptr, i32 %mask)
37 ret ptr addrspace(3) %masked
40 define amdgpu_ps ptr addrspace(1) @s_ptrmask_global_variable_i64(ptr addrspace(1) inreg %ptr, i64 inreg %mask) {
41 ; GCN-LABEL: s_ptrmask_global_variable_i64:
43 ; GCN-NEXT: s_and_b64 s[0:1], s[2:3], s[4:5]
44 ; GCN-NEXT: ; return to shader part epilog
46 ; GFX10PLUS-LABEL: s_ptrmask_global_variable_i64:
48 ; GFX10PLUS-NEXT: s_and_b64 s[0:1], s[2:3], s[4:5]
49 ; GFX10PLUS-NEXT: ; return to shader part epilog
50 %masked = call ptr addrspace(1) @llvm.ptrmask.p1.i64(ptr addrspace(1) %ptr, i64 %mask)
51 ret ptr addrspace(1) %masked
54 define amdgpu_ps ptr addrspace(3) @s_ptrmask_local_variable_i32(ptr addrspace(3) inreg %ptr, i32 inreg %mask) {
55 ; GCN-LABEL: s_ptrmask_local_variable_i32:
57 ; GCN-NEXT: s_and_b32 s0, s2, s3
58 ; GCN-NEXT: ; return to shader part epilog
60 ; GFX10PLUS-LABEL: s_ptrmask_local_variable_i32:
62 ; GFX10PLUS-NEXT: s_and_b32 s0, s2, s3
63 ; GFX10PLUS-NEXT: ; return to shader part epilog
64 %masked = call ptr addrspace(3) @llvm.ptrmask.p3.i32(ptr addrspace(3) %ptr, i32 %mask)
65 ret ptr addrspace(3) %masked
68 declare ptr addrspace(3) @llvm.ptrmask.p3.i32(ptr addrspace(3), i32) #0
69 declare ptr addrspace(1) @llvm.ptrmask.p1.i64(ptr addrspace(1), i64) #0
71 attributes #0 = { nounwind readnone speculatable willreturn }
72 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: