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
}