| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6 | |
| ; RUN: llc -global-isel=0 -mtriple=amdgpu12.00-- < %s | FileCheck %s --check-prefixes=GFX12,GFX12-SDAG | |
| ; RUN: llc -global-isel=1 -mtriple=amdgpu12.00-- < %s | FileCheck %s --check-prefixes=GFX12,GFX12-GISEL | |
| ; A movrel access adds the whole of M0 to its base register, so a mask on the | |
| ; index has to stay: dropping it would read out of range whenever the bits it | |
| ; clears are set. | |
| define amdgpu_ps i32 @load_masked_index(i32 inreg %arg) { | |
| ; GFX12-LABEL: load_masked_index: | |
| ; GFX12: ; %bb.0: | |
| ; GFX12-NEXT: s_bfe_u32 m0, s0, 0xe0002 | |
| ; GFX12-NEXT: v_movrels_b32_e32 v0, v0 | |
| ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | |
| ; GFX12-NEXT: v_readfirstlane_b32 s0, v0 | |
| ; GFX12-NEXT: ; return to shader part epilog | |
| %idx = and i32 %arg, 65535 | |
| %ptr = inttoptr i32 %idx to ptr addrspace(13) | |
| %v = load i32, ptr addrspace(13) %ptr | |
| ret i32 %v | |
| } | |
| define amdgpu_ps void @store_masked_index(i32 inreg %arg, i32 %val) { | |
| ; GFX12-LABEL: store_masked_index: | |
| ; GFX12: ; %bb.0: | |
| ; GFX12-NEXT: s_bfe_u32 m0, s0, 0xe0002 | |
| ; GFX12-NEXT: v_movreld_b32_e32 v0, v0 | |
| ; GFX12-NEXT: s_endpgm | |
| %idx = and i32 %arg, 65535 | |
| %ptr = inttoptr i32 %idx to ptr addrspace(13) | |
| store i32 %val, ptr addrspace(13) %ptr | |
| ret void | |
| } | |
| ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: | |
| ; GFX12-GISEL: {{.*}} | |
| ; GFX12-SDAG: {{.*}} |