auto generate instruction classes

This commit is contained in:
Asuka 2020-03-28 22:57:53 +08:00
parent 0d8974ad72
commit 129ee73cd6
4 changed files with 2082 additions and 688 deletions

File diff suppressed because it is too large Load diff

View file

@ -91,6 +91,11 @@ VISOPCInstruction::OP ParserSISOPC::GetVISOPCOp(Instruction::instruction32bit he
}
}
const GCNInstructionFormat& ParserSISOPC::GetSISOPCMeta(SISOPCInstruction::OP op)
{
return g_instructionFormatMapSOPC[op];
}
ParserSI::kaStatus ParserSISOPC::Parse(GDT_HW_GENERATION hwGen, Instruction::instruction32bit hexInstruction, std::unique_ptr<Instruction>& instruction, bool& hasLiteral)
{
unsigned int ridx0 = 0, ridx1 = 0;
@ -102,7 +107,8 @@ ParserSI::kaStatus ParserSISOPC::Parse(GDT_HW_GENERATION hwGen, Instruction::ins
if ((hwGen == GDT_HW_GENERATION_SEAISLAND) || (hwGen == GDT_HW_GENERATION_SOUTHERNISLAND))
{
SISOPCInstruction::OP op = GetSISOPCOp(hexInstruction);
instruction = std::make_unique<SISOPCInstruction>(ssrc0, ssrc1, op, ridx0, ridx1);
auto meta = GetSISOPCMeta(op);
instruction = std::make_unique<SISOPCInstruction>(ssrc0, ssrc1, op, ridx0, ridx1, meta.insClass);
}
else
{

View file

@ -72,6 +72,8 @@ private:
/// \param[in] hexInstruction The 32 bit hexadecimal instruction.
/// \returns An OP.
static VISOPCInstruction::OP GetVISOPCOp(Instruction::instruction32bit hexInstruction);
const GCNInstructionFormat& GetSISOPCMeta(SISOPCInstruction::OP op);
};
#endif //__PARSERSISOPC_H

File diff suppressed because it is too large Load diff