forked from OSchip/llvm-project
AMDGPU: Move disassembler support check to constructor
Don't check for unsupported targets for every instruction. llvm-svn: 361406
This commit is contained in:
parent
ca64ef2043
commit
418e23e33c
|
@ -61,7 +61,12 @@ AMDGPUDisassembler::AMDGPUDisassembler(const MCSubtargetInfo &STI,
|
|||
MCContext &Ctx,
|
||||
MCInstrInfo const *MCII) :
|
||||
MCDisassembler(STI, Ctx), MCII(MCII), MRI(*Ctx.getRegisterInfo()),
|
||||
TargetMaxInstBytes(Ctx.getAsmInfo()->getMaxInstLength(&STI)) {}
|
||||
TargetMaxInstBytes(Ctx.getAsmInfo()->getMaxInstLength(&STI)) {
|
||||
|
||||
// ToDo: AMDGPUDisassembler supports only VI ISA.
|
||||
if (!STI.getFeatureBits()[AMDGPU::FeatureGCN3Encoding] && !isGFX10())
|
||||
report_fatal_error("Disassembly not yet supported for subtarget");
|
||||
}
|
||||
|
||||
inline static MCDisassembler::DecodeStatus
|
||||
addOperand(MCInst &Inst, const MCOperand& Opnd) {
|
||||
|
@ -189,10 +194,6 @@ DecodeStatus AMDGPUDisassembler::getInstruction(MCInst &MI, uint64_t &Size,
|
|||
CommentStream = &CS;
|
||||
bool IsSDWA = false;
|
||||
|
||||
// ToDo: AMDGPUDisassembler supports only VI ISA.
|
||||
if (!STI.getFeatureBits()[AMDGPU::FeatureGCN3Encoding] && !isGFX10())
|
||||
report_fatal_error("Disassembly not yet supported for subtarget");
|
||||
|
||||
unsigned MaxInstBytesNum = std::min((size_t)TargetMaxInstBytes, Bytes_.size());
|
||||
Bytes = Bytes_.slice(0, MaxInstBytesNum);
|
||||
|
||||
|
|
Loading…
Reference in New Issue