@@ -1409,6 +1409,23 @@ class AMDGPUStructBufferLoad<LLVMType data_ty = llvm_any_ty> : DefaultAttrsIntri
14091409def int_amdgcn_struct_buffer_load_format : AMDGPUStructBufferLoad;
14101410def int_amdgcn_struct_buffer_load : AMDGPUStructBufferLoad;
14111411
1412+ class AMDGPUStructAtomicBufferLoad<LLVMType data_ty = llvm_any_ty> : Intrinsic <
1413+ [data_ty],
1414+ [llvm_v4i32_ty, // rsrc(SGPR)
1415+ llvm_i32_ty, // vindex(VGPR)
1416+ llvm_i32_ty, // offset(VGPR/imm, included in bounds checking and swizzling)
1417+ llvm_i32_ty, // soffset(SGPR/imm, excluded from bounds checking and swizzling)
1418+ llvm_i32_ty], // auxiliary/cachepolicy(imm):
1419+ // bit 0 = glc, bit 1 = slc, bit 2 = dlc (gfx10/gfx11),
1420+ // bit 3 = swz, bit 4 = scc (gfx90a)
1421+ // gfx940: bit 0 = sc0, bit 1 = nt, bit 3 = swz, bit 4 = sc1
1422+ // gfx12+: bits [0-2] = th, bits [3-4] = scope,
1423+ // bit 6 = swz
1424+ // all: volatile op (bit 31, stripped at lowering)
1425+ [ImmArg<ArgIndex<4>>, IntrWillReturn, IntrNoCallback, IntrNoFree], "", [SDNPMemOperand]>,
1426+ AMDGPURsrcIntrinsic<0>;
1427+ def int_amdgcn_struct_atomic_buffer_load : AMDGPUStructAtomicBufferLoad;
1428+
14121429class AMDGPUStructPtrBufferLoad<LLVMType data_ty = llvm_any_ty> : DefaultAttrsIntrinsic <
14131430 [data_ty],
14141431 [AMDGPUBufferRsrcTy, // rsrc(SGPR)
@@ -1428,6 +1445,24 @@ class AMDGPUStructPtrBufferLoad<LLVMType data_ty = llvm_any_ty> : DefaultAttrsIn
14281445def int_amdgcn_struct_ptr_buffer_load_format : AMDGPUStructPtrBufferLoad;
14291446def int_amdgcn_struct_ptr_buffer_load : AMDGPUStructPtrBufferLoad;
14301447
1448+ class AMDGPUStructPtrAtomicBufferLoad<LLVMType data_ty = llvm_any_ty> : Intrinsic <
1449+ [data_ty],
1450+ [AMDGPUBufferRsrcTy, // rsrc(SGPR)
1451+ llvm_i32_ty, // vindex(VGPR)
1452+ llvm_i32_ty, // offset(VGPR/imm, included in bounds checking and swizzling)
1453+ llvm_i32_ty, // soffset(SGPR/imm, excluded from bounds checking and swizzling)
1454+ llvm_i32_ty], // auxiliary/cachepolicy(imm):
1455+ // bit 0 = glc, bit 1 = slc, bit 2 = dlc (gfx10/gfx11),
1456+ // bit 3 = swz, bit 4 = scc (gfx90a)
1457+ // gfx940: bit 0 = sc0, bit 1 = nt, bit 3 = swz, bit 4 = sc1
1458+ // gfx12+: bits [0-2] = th, bits [3-4] = scope,
1459+ // bit 6 = swz
1460+ // all: volatile op (bit 31, stripped at lowering)
1461+ [IntrArgMemOnly, NoCapture<ArgIndex<0>>,
1462+ ImmArg<ArgIndex<4>>, IntrWillReturn, IntrNoCallback, IntrNoFree], "", [SDNPMemOperand]>,
1463+ AMDGPURsrcIntrinsic<0>;
1464+ def int_amdgcn_struct_ptr_atomic_buffer_load : AMDGPUStructPtrAtomicBufferLoad;
1465+
14311466class AMDGPURawBufferStore<LLVMType data_ty = llvm_any_ty> : DefaultAttrsIntrinsic <
14321467 [],
14331468 [data_ty, // vdata(VGPR)
0 commit comments