81 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -mtriple=amdgcn -mcpu=gfx900 < %s | FileCheck -check-prefix=GCN %s3 4define amdgpu_kernel void @if_masked_1(i32 %arg, ptr addrspace(1) %p) {5; GCN-LABEL: if_masked_1:6; GCN: ; %bb.0:7; GCN-NEXT: s_load_dword s2, s[4:5], 0x248; GCN-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x2c9; GCN-NEXT: v_mov_b32_e32 v0, 010; GCN-NEXT: s_waitcnt lgkmcnt(0)11; GCN-NEXT: s_bitcmp0_b32 s2, 012; GCN-NEXT: s_cselect_b32 s2, 22, 3313; GCN-NEXT: v_mov_b32_e32 v1, s214; GCN-NEXT: global_store_dword v0, v1, s[0:1]15; GCN-NEXT: s_endpgm16 %and = and i32 %arg, 117 %cmp = icmp eq i32 %and, 018 %sel = select i1 %cmp, i32 22, i32 3319 store i32 %sel, ptr addrspace(1) %p20 ret void21}22 23define amdgpu_kernel void @if_masked_1024(i32 %arg, ptr addrspace(1) %p) {24; GCN-LABEL: if_masked_1024:25; GCN: ; %bb.0:26; GCN-NEXT: s_load_dword s2, s[4:5], 0x2427; GCN-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x2c28; GCN-NEXT: v_mov_b32_e32 v0, 029; GCN-NEXT: s_waitcnt lgkmcnt(0)30; GCN-NEXT: s_bitcmp0_b32 s2, 1031; GCN-NEXT: s_cselect_b32 s2, 22, 3332; GCN-NEXT: v_mov_b32_e32 v1, s233; GCN-NEXT: global_store_dword v0, v1, s[0:1]34; GCN-NEXT: s_endpgm35 %and = and i32 %arg, 102436 %cmp = icmp eq i32 %and, 037 %sel = select i1 %cmp, i32 22, i32 3338 store i32 %sel, ptr addrspace(1) %p39 ret void40}41 42define amdgpu_kernel void @if_masked_0x80000000(i32 %arg, ptr addrspace(1) %p) {43; GCN-LABEL: if_masked_0x80000000:44; GCN: ; %bb.0:45; GCN-NEXT: s_load_dword s2, s[4:5], 0x2446; GCN-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x2c47; GCN-NEXT: v_mov_b32_e32 v0, 048; GCN-NEXT: s_waitcnt lgkmcnt(0)49; GCN-NEXT: s_bitcmp0_b32 s2, 3150; GCN-NEXT: s_cselect_b32 s2, 22, 3351; GCN-NEXT: v_mov_b32_e32 v1, s252; GCN-NEXT: global_store_dword v0, v1, s[0:1]53; GCN-NEXT: s_endpgm54 %and = and i32 %arg, 214748364855 %cmp = icmp eq i32 %and, 056 %sel = select i1 %cmp, i32 22, i32 3357 store i32 %sel, ptr addrspace(1) %p58 ret void59}60 61; FIXME: this should result in "s_bitcmp0_b64 $arg, 63" or "s_bitcmp0_b32 $arg.sub1, 31"62define amdgpu_kernel void @if_masked_0x8000000000000000(i64 %arg, ptr addrspace(1) %p) {63; GCN-LABEL: if_masked_0x8000000000000000:64; GCN: ; %bb.0:65; GCN-NEXT: s_load_dwordx4 s[0:3], s[4:5], 0x2466; GCN-NEXT: s_waitcnt lgkmcnt(0)67; GCN-NEXT: s_mov_b32 s0, 068; GCN-NEXT: v_mov_b32_e32 v0, 069; GCN-NEXT: s_and_b32 s1, s1, 0x8000000070; GCN-NEXT: s_cmp_eq_u64 s[0:1], 071; GCN-NEXT: s_cselect_b32 s0, 22, 3372; GCN-NEXT: v_mov_b32_e32 v1, s073; GCN-NEXT: global_store_dword v0, v1, s[2:3]74; GCN-NEXT: s_endpgm75 %and = and i64 %arg, 922337203685477580876 %cmp = icmp eq i64 %and, 077 %sel = select i1 %cmp, i32 22, i32 3378 store i32 %sel, ptr addrspace(1) %p79 ret void80}81