How to replace member of instructions in different SubtargetFeature

I have two instruction sets that are almost the same.The only difference is typeop and InstrItinClass .
Such as:

class SMovBase<bits<3> typeop,bits<3> op ,bits<4> inner_op, string instr_asm,RegisterClass RC,InstrItinClass itin>:DSPInstruction;
//FeatureDSP001
def MovIGH : SMovBase<7,5,0b0001,"movigh",CPURegs,SLOT1>;
//FeatureDSP002
def MovIGH : SMovBase<1,5,0b0001,"movigh",CPURegs,SLOT2>;

How can I use different member in a instruction record though subtargetFeature?
something like:

def MovIGH : SMovBase<XX,5,0b0001,"movigh",CPURegs,YY>{
if(subtargetFeature == FeatureDSP001)
XX=7
if(subtargetFeature == FeatureDSP002)
XX=1
if(subtargetFeature == FeatureDSP001)
YY=SLOT1
if(subtargetFeature == FeatureDSP002)
YY=SLOT2
}

llvm/test/TableGen/HwModeEncodeDecode.td has a test for an encoding that varies by HwMode that you could use. As far as I know there’s no way to do it based on features, you’ll have to use HwMode.

Thanks for your reply.
I have read HwModeEncodeDecode.td. I have two questions.

1.SLOT1 or SLOT2 is a InstrItinClass, which is used for VLIW. Does HwMode affect packaging?
2.if HwMode works, How to activate this HwMode?
something like:

def ModeA : HwMode<"+a">;
def ModeB : HwMode<"+b">;
console: ./llc.exe +a

I solve it with differnt SchedMachineModel.