[llvm] [AMDGPU][MC] Add GFX12 SMEM encoding (PR #75215)
Piotr Sobczak via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 14 02:27:27 PST 2023
================
@@ -1235,28 +1239,79 @@ defm S_ATC_PROBE_BUFFER : SM_Real_Probe_gfx11 <0x23>;
// GFX12.
//===----------------------------------------------------------------------===//
-class SMEM_Real_gfx12<bits<8> op, SM_Pseudo ps, string opName = ps.Mnemonic> :
- SMEM_Real_10Plus_common<op, ps, opName, SIEncodingFamily.GFX12,
+class SMEM_Real_gfx12Plus<bits<6> op, SM_Pseudo ps, string opName,
+ int subtarget, RegisterWithSubRegs sgpr_null> :
+ SM_Real<ps, opName>, SIMCInstr<ps.PseudoInstr, subtarget>, Enc64 {
+
+ let Inst{18-13} = op;
+ let Inst{31-26} = 0x3d;
+
+ let Inst{55-32} = !if(ps.has_offset, offset{23-0}, !if(ps.has_soffset, 0, ?));
+ let Inst{63-57} = !if(ps.has_soffset, soffset{6-0},
+ !if(ps.has_offset, sgpr_null.HWEncoding{6-0}, ?));
+}
+
+class SMEM_Real_gfx12<bits<6> op, SM_Pseudo ps, string opName = ps.Mnemonic> :
+ SMEM_Real_gfx12Plus<op, ps, opName, SIEncodingFamily.GFX12,
SGPR_NULL_gfx11plus> {
----------------
piotrAMD wrote:
Nit: indentation (align `SGPR_NULL_gfx11plus` with `op`).
https://github.com/llvm/llvm-project/pull/75215
More information about the llvm-commits
mailing list