mirror of
https://github.com/hch12907/orbum.git
synced 2024-06-02 19:38:16 -04:00
Add more VuInstruction field extraction functions
id(), is(), it(), imm12(), imm15()
This commit is contained in:
parent
289f10893d
commit
be92f7143a
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue