Add more VuInstruction field extraction functions

id(), is(), it(), imm12(), imm15()
This commit is contained in:
hch12907 2018-08-13 20:32:37 +08:00
parent 289f10893d
commit be92f7143a

View file

@ -50,16 +50,35 @@ struct VuInstruction : public MipsInstruction
return static_cast<ubyte>(FT.extract_from(value));
}
inline ubyte it() const
{
// FT and IT differ in name only
return ft();
}
ubyte fs() const
{
return static_cast<ubyte>(FS.extract_from(value));
}
inline ubyte is() const
{
// FS and IS differ in name only
return fs();
}
ubyte fd() const
{
return static_cast<ubyte>(FD.extract_from(value));
}
inline ubyte id() const
{
// FD and ID differ in name only
return fs();
}
ubyte opcode() const
{
return static_cast<ubyte>(OPCODE.extract_from(value));
@ -85,6 +104,16 @@ struct VuInstruction : public MipsInstruction
return static_cast<uhword>(IMM11.extract_from(value));
}
uhword imm12() const
{
return static_cast<uhword>(IMM11.extract_from(value) | (DEST.extract_from(value) & 1) << 11);
}
uhword imm15() const
{
return static_cast<uhword>(IMM11.extract_from(value) | DEST.extract_from(value));
}
uword imm24() const
{
return static_cast<uword>(IMM24.extract_from(value));