@@ -1200,6 +1200,23 @@ class AMDGPUStructBufferLoad<LLVMType data_ty = llvm_any_ty> : DefaultAttrsIntri
12001200def int_amdgcn_struct_buffer_load_format : AMDGPUStructBufferLoad;
12011201def int_amdgcn_struct_buffer_load : AMDGPUStructBufferLoad;
12021202
1203+ class AMDGPUStructAtomicBufferLoad<LLVMType data_ty = llvm_any_ty> : Intrinsic <
1204+ [data_ty],
1205+ [llvm_v4i32_ty, // rsrc(SGPR)
1206+ llvm_i32_ty, // vindex(VGPR)
1207+ llvm_i32_ty, // offset(VGPR/imm, included in bounds checking and swizzling)
1208+ llvm_i32_ty, // soffset(SGPR/imm, excluded from bounds checking and swizzling)
1209+ llvm_i32_ty], // auxiliary/cachepolicy(imm):
1210+ // bit 0 = glc, bit 1 = slc, bit 2 = dlc (gfx10/gfx11),
1211+ // bit 3 = swz, bit 4 = scc (gfx90a)
1212+ // gfx940: bit 0 = sc0, bit 1 = nt, bit 3 = swz, bit 4 = sc1
1213+ // gfx12+: bits [0-2] = th, bits [3-4] = scope,
1214+ // bit 6 = swz
1215+ // all: volatile op (bit 31, stripped at lowering)
1216+ [ImmArg<ArgIndex<4>>, IntrWillReturn, IntrNoCallback, IntrNoFree], "", [SDNPMemOperand]>,
1217+ AMDGPURsrcIntrinsic<0>;
1218+ def int_amdgcn_struct_atomic_buffer_load : AMDGPUStructAtomicBufferLoad;
1219+
12031220class AMDGPUStructPtrBufferLoad<LLVMType data_ty = llvm_any_ty> : DefaultAttrsIntrinsic <
12041221 [data_ty],
12051222 [AMDGPUBufferRsrcTy, // rsrc(SGPR)
@@ -1219,6 +1236,24 @@ class AMDGPUStructPtrBufferLoad<LLVMType data_ty = llvm_any_ty> : DefaultAttrsIn
12191236def int_amdgcn_struct_ptr_buffer_load_format : AMDGPUStructPtrBufferLoad;
12201237def int_amdgcn_struct_ptr_buffer_load : AMDGPUStructPtrBufferLoad;
12211238
1239+ class AMDGPUStructPtrAtomicBufferLoad<LLVMType data_ty = llvm_any_ty> : Intrinsic <
1240+ [data_ty],
1241+ [AMDGPUBufferRsrcTy, // rsrc(SGPR)
1242+ llvm_i32_ty, // vindex(VGPR)
1243+ llvm_i32_ty, // offset(VGPR/imm, included in bounds checking and swizzling)
1244+ llvm_i32_ty, // soffset(SGPR/imm, excluded from bounds checking and swizzling)
1245+ llvm_i32_ty], // auxiliary/cachepolicy(imm):
1246+ // bit 0 = glc, bit 1 = slc, bit 2 = dlc (gfx10/gfx11),
1247+ // bit 3 = swz, bit 4 = scc (gfx90a)
1248+ // gfx940: bit 0 = sc0, bit 1 = nt, bit 3 = swz, bit 4 = sc1
1249+ // gfx12+: bits [0-2] = th, bits [3-4] = scope,
1250+ // bit 6 = swz
1251+ // all: volatile op (bit 31, stripped at lowering)
1252+ [IntrArgMemOnly, NoCapture<ArgIndex<0>>,
1253+ ImmArg<ArgIndex<4>>, IntrWillReturn, IntrNoCallback, IntrNoFree], "", [SDNPMemOperand]>,
1254+ AMDGPURsrcIntrinsic<0>;
1255+ def int_amdgcn_struct_ptr_atomic_buffer_load : AMDGPUStructPtrAtomicBufferLoad;
1256+
12221257class AMDGPURawBufferStore<LLVMType data_ty = llvm_any_ty> : DefaultAttrsIntrinsic <
12231258 [],
12241259 [data_ty, // vdata(VGPR)
0 commit comments