[llvm] [AMDGPU][MC] Support src modifiers for v_mov_b32 and v_movrel* instructions (PR #76498)

Joe Nash via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 9 11:35:52 PST 2024


================
@@ -369,22 +369,41 @@ defm V_CLREXCP : VOP1Inst <"v_clrexcp", VOP_NO_EXT<VOP_NONE>>;
 }
 
 // Restrict src0 to be VGPR
-def VOP_MOVRELS : VOPProfile<[i32, i32, untyped, untyped]> {
+def VOP_PERMLANE : VOPProfile<[i32, i32, untyped, untyped]> {
   let Src0RC32 = VRegSrc_32;
   let Src0RC64 = VRegSrc_32;
 }
 
+class VOP_MOVRELS_CLASS : VOPProfile<[i32, i32, untyped, untyped]> {
+  let Src0RC32 = VRegSrc_32;
+  let Src0RC64 = VRegSrc_32;
+
+  let InsVOP3Base = (ins FPVRegInputMods:$src0_modifiers, VGPRSrc_32:$src0);
+  let InsVOP3DPP = (ins VGPR_32:$old, FPVRegInputMods:$src0_modifiers, VGPRSrc_32:$src0, dpp_ctrl:$dpp_ctrl, row_mask:$row_mask, bank_mask:$bank_mask, bound_ctrl:$bound_ctrl);
+  let InsVOP3DPP16 = (ins VGPR_32:$old, FPVRegInputMods:$src0_modifiers, VGPRSrc_32:$src0, dpp_ctrl:$dpp_ctrl, row_mask:$row_mask, bank_mask:$bank_mask, bound_ctrl:$bound_ctrl, FI:$fi);
+  let InsVOP3DPP8 = (ins VGPR_32:$old, FPVRegInputMods:$src0_modifiers, VGPRSrc_32:$src0, dpp8:$dpp8, FI:$fi);
+  
+  let HasModifiers = 1;
+
+  let Src0Mod = FPVRegInputMods;
----------------
Sisyph wrote:

These overrides of  HasModifiers , Src0Mod, Src0ModVOP3DPP, Src0ModDPP   should be done before redefining InsVOP3Base. It looks like by doing so you might avoid having to override InsVOP3Base at all?

https://github.com/llvm/llvm-project/pull/76498


More information about the llvm-commits mailing list