| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6 | |
| ; RUN: llc -mtriple=amdgpu9.00 -global-isel=0 < %s | FileCheck -check-prefixes=GCN,GFX9,GFX9-SDAG %s | |
| ; RUN: llc -mtriple=amdgpu9.00 -global-isel=1 < %s | FileCheck -check-prefixes=GCN,GFX9,GFX9-GISEL %s | |
| ; RUN: llc -mtriple=amdgpu10.10 -global-isel=0 < %s | FileCheck -check-prefixes=GCN,GFX10,GFX10-SDAG %s | |
| ; RUN: llc -mtriple=amdgpu10.10 -global-isel=1 < %s | FileCheck -check-prefixes=GCN,GFX10,GFX10-GISEL %s | |
| ; RUN: llc -mtriple=amdgpu11.00 -global-isel=0 < %s | FileCheck -check-prefixes=GCN,GFX11,GFX11-SDAG %s | |
| ; RUN: llc -mtriple=amdgpu11.00 -global-isel=1 < %s | FileCheck -check-prefixes=GCN,GFX11,GFX11-GISEL %s | |
| ; RUN: llc -mtriple=amdgpu12.00 -global-isel=0 < %s | FileCheck -check-prefixes=GCN,GFX12,GFX12-SDAG %s | |
| ; RUN: llc -mtriple=amdgpu12.00 -global-isel=1 < %s | FileCheck -check-prefixes=GCN,GFX12,GFX12-GISEL %s | |
| define amdgpu_cs void @atomic_store_f32x2_monotonic_agent(<2 x float> %in, ptr addrspace(0) %out) { | |
| ; GFX9-LABEL: atomic_store_f32x2_monotonic_agent: | |
| ; GFX9: ; %bb.0: | |
| ; GFX9-NEXT: flat_store_dwordx2 v[2:3], v[0:1] | |
| ; GFX9-NEXT: s_endpgm | |
| ; | |
| ; GFX10-LABEL: atomic_store_f32x2_monotonic_agent: | |
| ; GFX10: ; %bb.0: | |
| ; GFX10-NEXT: flat_store_dwordx2 v[2:3], v[0:1] | |
| ; GFX10-NEXT: s_endpgm | |
| ; | |
| ; GFX11-LABEL: atomic_store_f32x2_monotonic_agent: | |
| ; GFX11: ; %bb.0: | |
| ; GFX11-NEXT: flat_store_b64 v[2:3], v[0:1] | |
| ; GFX11-NEXT: s_endpgm | |
| ; | |
| ; GFX12-LABEL: atomic_store_f32x2_monotonic_agent: | |
| ; GFX12: ; %bb.0: | |
| ; GFX12-NEXT: flat_store_b64 v[2:3], v[0:1] scope:SCOPE_DEV | |
| ; GFX12-NEXT: s_endpgm | |
| store atomic <2 x float> %in, ptr addrspace(0) %out syncscope("agent") monotonic, align 8 | |
| ret void | |
| } | |
| define amdgpu_cs void @atomic_store_f16x2_monotonic_agent(<2 x half> %in, ptr addrspace(0) %out) { | |
| ; GFX9-LABEL: atomic_store_f16x2_monotonic_agent: | |
| ; GFX9: ; %bb.0: | |
| ; GFX9-NEXT: flat_store_dword v[1:2], v0 | |
| ; GFX9-NEXT: s_endpgm | |
| ; | |
| ; GFX10-LABEL: atomic_store_f16x2_monotonic_agent: | |
| ; GFX10: ; %bb.0: | |
| ; GFX10-NEXT: flat_store_dword v[1:2], v0 | |
| ; GFX10-NEXT: s_endpgm | |
| ; | |
| ; GFX11-LABEL: atomic_store_f16x2_monotonic_agent: | |
| ; GFX11: ; %bb.0: | |
| ; GFX11-NEXT: flat_store_b32 v[1:2], v0 | |
| ; GFX11-NEXT: s_endpgm | |
| ; | |
| ; GFX12-LABEL: atomic_store_f16x2_monotonic_agent: | |
| ; GFX12: ; %bb.0: | |
| ; GFX12-NEXT: flat_store_b32 v[1:2], v0 scope:SCOPE_DEV | |
| ; GFX12-NEXT: s_endpgm | |
| store atomic <2 x half> %in, ptr addrspace(0) %out syncscope("agent") monotonic, align 4 | |
| ret void | |
| } | |
| define amdgpu_cs void @atomic_store_i16x2_monotonic_agent(<2 x i16> %in, ptr addrspace(0) %out) { | |
| ; GFX9-LABEL: atomic_store_i16x2_monotonic_agent: | |
| ; GFX9: ; %bb.0: | |
| ; GFX9-NEXT: flat_store_dword v[1:2], v0 | |
| ; GFX9-NEXT: s_endpgm | |
| ; | |
| ; GFX10-LABEL: atomic_store_i16x2_monotonic_agent: | |
| ; GFX10: ; %bb.0: | |
| ; GFX10-NEXT: flat_store_dword v[1:2], v0 | |
| ; GFX10-NEXT: s_endpgm | |
| ; | |
| ; GFX11-LABEL: atomic_store_i16x2_monotonic_agent: | |
| ; GFX11: ; %bb.0: | |
| ; GFX11-NEXT: flat_store_b32 v[1:2], v0 | |
| ; GFX11-NEXT: s_endpgm | |
| ; | |
| ; GFX12-LABEL: atomic_store_i16x2_monotonic_agent: | |
| ; GFX12: ; %bb.0: | |
| ; GFX12-NEXT: flat_store_b32 v[1:2], v0 scope:SCOPE_DEV | |
| ; GFX12-NEXT: s_endpgm | |
| store atomic <2 x i16> %in, ptr addrspace(0) %out syncscope("agent") monotonic, align 4 | |
| ret void | |
| } | |
| define amdgpu_cs void @atomic_store_f16x4_monotonic_agent(<4 x half> %in, ptr addrspace(0) %out) { | |
| ; GFX9-LABEL: atomic_store_f16x4_monotonic_agent: | |
| ; GFX9: ; %bb.0: | |
| ; GFX9-NEXT: flat_store_dwordx2 v[2:3], v[0:1] | |
| ; GFX9-NEXT: s_endpgm | |
| ; | |
| ; GFX10-LABEL: atomic_store_f16x4_monotonic_agent: | |
| ; GFX10: ; %bb.0: | |
| ; GFX10-NEXT: flat_store_dwordx2 v[2:3], v[0:1] | |
| ; GFX10-NEXT: s_endpgm | |
| ; | |
| ; GFX11-LABEL: atomic_store_f16x4_monotonic_agent: | |
| ; GFX11: ; %bb.0: | |
| ; GFX11-NEXT: flat_store_b64 v[2:3], v[0:1] | |
| ; GFX11-NEXT: s_endpgm | |
| ; | |
| ; GFX12-LABEL: atomic_store_f16x4_monotonic_agent: | |
| ; GFX12: ; %bb.0: | |
| ; GFX12-NEXT: flat_store_b64 v[2:3], v[0:1] scope:SCOPE_DEV | |
| ; GFX12-NEXT: s_endpgm | |
| store atomic <4 x half> %in, ptr addrspace(0) %out syncscope("agent") monotonic, align 8 | |
| ret void | |
| } | |
| define amdgpu_cs void @atomic_store_i16x4_monotonic_agent(<4 x i16> %in, ptr addrspace(0) %out) { | |
| ; GFX9-LABEL: atomic_store_i16x4_monotonic_agent: | |
| ; GFX9: ; %bb.0: | |
| ; GFX9-NEXT: flat_store_dwordx2 v[2:3], v[0:1] | |
| ; GFX9-NEXT: s_endpgm | |
| ; | |
| ; GFX10-LABEL: atomic_store_i16x4_monotonic_agent: | |
| ; GFX10: ; %bb.0: | |
| ; GFX10-NEXT: flat_store_dwordx2 v[2:3], v[0:1] | |
| ; GFX10-NEXT: s_endpgm | |
| ; | |
| ; GFX11-LABEL: atomic_store_i16x4_monotonic_agent: | |
| ; GFX11: ; %bb.0: | |
| ; GFX11-NEXT: flat_store_b64 v[2:3], v[0:1] | |
| ; GFX11-NEXT: s_endpgm | |
| ; | |
| ; GFX12-LABEL: atomic_store_i16x4_monotonic_agent: | |
| ; GFX12: ; %bb.0: | |
| ; GFX12-NEXT: flat_store_b64 v[2:3], v[0:1] scope:SCOPE_DEV | |
| ; GFX12-NEXT: s_endpgm | |
| store atomic <4 x i16> %in, ptr addrspace(0) %out syncscope("agent") monotonic, align 8 | |
| ret void | |
| } | |
| define amdgpu_cs void @atomic_store_i16x4_monotonic_agent_offset_min(<4 x i16> %in, ptr addrspace(0) %out) { | |
| ; GFX9-LABEL: atomic_store_i16x4_monotonic_agent_offset_min: | |
| ; GFX9: ; %bb.0: | |
| ; GFX9-NEXT: v_add_co_u32_e32 v2, vcc, 0xfffff000, v2 | |
| ; GFX9-NEXT: v_addc_co_u32_e32 v3, vcc, -1, v3, vcc | |
| ; GFX9-NEXT: flat_store_dwordx2 v[2:3], v[0:1] | |
| ; GFX9-NEXT: s_endpgm | |
| ; | |
| ; GFX10-LABEL: atomic_store_i16x4_monotonic_agent_offset_min: | |
| ; GFX10: ; %bb.0: | |
| ; GFX10-NEXT: v_add_co_u32 v2, vcc_lo, v2, 0xfffff000 | |
| ; GFX10-NEXT: v_add_co_ci_u32_e32 v3, vcc_lo, -1, v3, vcc_lo | |
| ; GFX10-NEXT: flat_store_dwordx2 v[2:3], v[0:1] | |
| ; GFX10-NEXT: s_endpgm | |
| ; | |
| ; GFX11-SDAG-LABEL: atomic_store_i16x4_monotonic_agent_offset_min: | |
| ; GFX11-SDAG: ; %bb.0: | |
| ; GFX11-SDAG-NEXT: v_add_co_u32 v2, vcc_lo, 0xfffff000, v2 | |
| ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | |
| ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e64 v3, null, -1, v3, vcc_lo | |
| ; GFX11-SDAG-NEXT: flat_store_b64 v[2:3], v[0:1] | |
| ; GFX11-SDAG-NEXT: s_endpgm | |
| ; | |
| ; GFX11-GISEL-LABEL: atomic_store_i16x4_monotonic_agent_offset_min: | |
| ; GFX11-GISEL: ; %bb.0: | |
| ; GFX11-GISEL-NEXT: v_add_co_u32 v2, vcc_lo, v2, 0xfffff000 | |
| ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | |
| ; GFX11-GISEL-NEXT: v_add_co_ci_u32_e64 v3, null, -1, v3, vcc_lo | |
| ; GFX11-GISEL-NEXT: flat_store_b64 v[2:3], v[0:1] | |
| ; GFX11-GISEL-NEXT: s_endpgm | |
| ; | |
| ; GFX12-LABEL: atomic_store_i16x4_monotonic_agent_offset_min: | |
| ; GFX12: ; %bb.0: | |
| ; GFX12-NEXT: flat_store_b64 v[2:3], v[0:1] offset:-4096 scope:SCOPE_DEV | |
| ; GFX12-NEXT: s_endpgm | |
| %gep = getelementptr inbounds i8, ptr addrspace(0) %out, i64 -4096 | |
| store atomic <4 x i16> %in, ptr addrspace(0) %gep syncscope("agent") monotonic, align 8 | |
| ret void | |
| } | |
| define amdgpu_cs void @atomic_store_i16x4_monotonic_agent_offset_max(<4 x i16> %in, ptr addrspace(0) %out) { | |
| ; GFX9-LABEL: atomic_store_i16x4_monotonic_agent_offset_max: | |
| ; GFX9: ; %bb.0: | |
| ; GFX9-NEXT: flat_store_dwordx2 v[2:3], v[0:1] offset:4088 | |
| ; GFX9-NEXT: s_endpgm | |
| ; | |
| ; GFX10-LABEL: atomic_store_i16x4_monotonic_agent_offset_max: | |
| ; GFX10: ; %bb.0: | |
| ; GFX10-NEXT: v_add_co_u32 v2, vcc_lo, v2, 0xff8 | |
| ; GFX10-NEXT: v_add_co_ci_u32_e32 v3, vcc_lo, 0, v3, vcc_lo | |
| ; GFX10-NEXT: flat_store_dwordx2 v[2:3], v[0:1] | |
| ; GFX10-NEXT: s_endpgm | |
| ; | |
| ; GFX11-LABEL: atomic_store_i16x4_monotonic_agent_offset_max: | |
| ; GFX11: ; %bb.0: | |
| ; GFX11-NEXT: flat_store_b64 v[2:3], v[0:1] offset:4088 | |
| ; GFX11-NEXT: s_endpgm | |
| ; | |
| ; GFX12-LABEL: atomic_store_i16x4_monotonic_agent_offset_max: | |
| ; GFX12: ; %bb.0: | |
| ; GFX12-NEXT: flat_store_b64 v[2:3], v[0:1] offset:4088 scope:SCOPE_DEV | |
| ; GFX12-NEXT: s_endpgm | |
| %gep = getelementptr inbounds i8, ptr addrspace(0) %out, i64 4088 | |
| store atomic <4 x i16> %in, ptr addrspace(0) %gep syncscope("agent") monotonic, align 8 | |
| ret void | |
| } | |
| define amdgpu_cs void @atomic_store_i32x2_monotonic_agent(<2 x i32> %in, ptr addrspace(0) %out) { | |
| ; GFX9-LABEL: atomic_store_i32x2_monotonic_agent: | |
| ; GFX9: ; %bb.0: | |
| ; GFX9-NEXT: flat_store_dwordx2 v[2:3], v[0:1] | |
| ; GFX9-NEXT: s_endpgm | |
| ; | |
| ; GFX10-LABEL: atomic_store_i32x2_monotonic_agent: | |
| ; GFX10: ; %bb.0: | |
| ; GFX10-NEXT: flat_store_dwordx2 v[2:3], v[0:1] | |
| ; GFX10-NEXT: s_endpgm | |
| ; | |
| ; GFX11-LABEL: atomic_store_i32x2_monotonic_agent: | |
| ; GFX11: ; %bb.0: | |
| ; GFX11-NEXT: flat_store_b64 v[2:3], v[0:1] | |
| ; GFX11-NEXT: s_endpgm | |
| ; | |
| ; GFX12-LABEL: atomic_store_i32x2_monotonic_agent: | |
| ; GFX12: ; %bb.0: | |
| ; GFX12-NEXT: flat_store_b64 v[2:3], v[0:1] scope:SCOPE_DEV | |
| ; GFX12-NEXT: s_endpgm | |
| store atomic <2 x i32> %in, ptr addrspace(0) %out syncscope("agent") monotonic, align 8 | |
| ret void | |
| } | |
| define amdgpu_cs void @atomic_store_bf16x2_monotonic_agent(<2 x bfloat> %in, ptr addrspace(0) %out) { | |
| ; GFX9-LABEL: atomic_store_bf16x2_monotonic_agent: | |
| ; GFX9: ; %bb.0: | |
| ; GFX9-NEXT: flat_store_dword v[1:2], v0 | |
| ; GFX9-NEXT: s_endpgm | |
| ; | |
| ; GFX10-LABEL: atomic_store_bf16x2_monotonic_agent: | |
| ; GFX10: ; %bb.0: | |
| ; GFX10-NEXT: flat_store_dword v[1:2], v0 | |
| ; GFX10-NEXT: s_endpgm | |
| ; | |
| ; GFX11-LABEL: atomic_store_bf16x2_monotonic_agent: | |
| ; GFX11: ; %bb.0: | |
| ; GFX11-NEXT: flat_store_b32 v[1:2], v0 | |
| ; GFX11-NEXT: s_endpgm | |
| ; | |
| ; GFX12-LABEL: atomic_store_bf16x2_monotonic_agent: | |
| ; GFX12: ; %bb.0: | |
| ; GFX12-NEXT: flat_store_b32 v[1:2], v0 scope:SCOPE_DEV | |
| ; GFX12-NEXT: s_endpgm | |
| store atomic <2 x bfloat> %in, ptr addrspace(0) %out syncscope("agent") monotonic, align 4 | |
| ret void | |
| } | |
| define amdgpu_cs void @atomic_store_bf16x4_monotonic_agent(<4 x bfloat> %in, ptr addrspace(0) %out) { | |
| ; GFX9-LABEL: atomic_store_bf16x4_monotonic_agent: | |
| ; GFX9: ; %bb.0: | |
| ; GFX9-NEXT: flat_store_dwordx2 v[2:3], v[0:1] | |
| ; GFX9-NEXT: s_endpgm | |
| ; | |
| ; GFX10-LABEL: atomic_store_bf16x4_monotonic_agent: | |
| ; GFX10: ; %bb.0: | |
| ; GFX10-NEXT: flat_store_dwordx2 v[2:3], v[0:1] | |
| ; GFX10-NEXT: s_endpgm | |
| ; | |
| ; GFX11-LABEL: atomic_store_bf16x4_monotonic_agent: | |
| ; GFX11: ; %bb.0: | |
| ; GFX11-NEXT: flat_store_b64 v[2:3], v[0:1] | |
| ; GFX11-NEXT: s_endpgm | |
| ; | |
| ; GFX12-LABEL: atomic_store_bf16x4_monotonic_agent: | |
| ; GFX12: ; %bb.0: | |
| ; GFX12-NEXT: flat_store_b64 v[2:3], v[0:1] scope:SCOPE_DEV | |
| ; GFX12-NEXT: s_endpgm | |
| store atomic <4 x bfloat> %in, ptr addrspace(0) %out syncscope("agent") monotonic, align 8 | |
| ret void | |
| } | |
| ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: | |
| ; GCN: {{.*}} | |
| ; GFX10-GISEL: {{.*}} | |
| ; GFX10-SDAG: {{.*}} | |
| ; GFX12-GISEL: {{.*}} | |
| ; GFX12-SDAG: {{.*}} | |
| ; GFX9-GISEL: {{.*}} | |
| ; GFX9-SDAG: {{.*}} |