inline constexpr size_t Instruction::SizeInCodeUnits(Format format) { switch (format) { case k10x: case k12x: case k11n: case k11x: case k10t: return1; case k20t: case k22x: case k21t: case k21s: case k21h: case k21c: case k23x: case k22b: case k22t: case k22s: case k22c: return2; case k32x: case k30t: case k31t: case k31i: case k31c: case k35c: case k3rc: return3; case k45cc: case k4rcc: return4; case k51l: return5; case kInvalidFormat: return0;
}
}
//------------------------------------------------------------------------------ // VRegA //------------------------------------------------------------------------------ inlinebool Instruction::HasVRegA() const { switch (FormatOf(Opcode())) { case k10t: returntrue; case k10x: returntrue; case k11n: returntrue; case k11x: returntrue; case k12x: returntrue; case k20t: returntrue; case k21c: returntrue; case k21h: returntrue; case k21s: returntrue; case k21t: returntrue; case k22b: returntrue; case k22c: returntrue; case k22s: returntrue; case k22t: returntrue; case k22x: returntrue; case k23x: returntrue; case k30t: returntrue; case k31c: returntrue; case k31i: returntrue; case k31t: returntrue; case k32x: returntrue; case k35c: returntrue; case k3rc: returntrue; case k45cc: returntrue; case k4rcc: returntrue; case k51l: returntrue; default: returnfalse;
}
}
inline int32_t Instruction::VRegA(Format format, uint16_t inst_data) const {
DCHECK_EQ(format, FormatOf(Opcode())); switch (format) { case k10t: return VRegA_10t(inst_data); case k10x: return VRegA_10x(inst_data); case k11n: return VRegA_11n(inst_data); case k11x: return VRegA_11x(inst_data); case k12x: return VRegA_12x(inst_data); case k20t: return VRegA_20t(); case k21c: return VRegA_21c(inst_data); case k21h: return VRegA_21h(inst_data); case k21s: return VRegA_21s(inst_data); case k21t: return VRegA_21t(inst_data); case k22b: return VRegA_22b(inst_data); case k22c: return VRegA_22c(inst_data); case k22s: return VRegA_22s(inst_data); case k22t: return VRegA_22t(inst_data); case k22x: return VRegA_22x(inst_data); case k23x: return VRegA_23x(inst_data); case k30t: return VRegA_30t(); case k31c: return VRegA_31c(inst_data); case k31i: return VRegA_31i(inst_data); case k31t: return VRegA_31t(inst_data); case k32x: return VRegA_32x(); case k35c: return VRegA_35c(inst_data); case k3rc: return VRegA_3rc(inst_data); case k45cc: return VRegA_45cc(inst_data); case k4rcc: return VRegA_4rcc(inst_data); case k51l: return VRegA_51l(inst_data); default:
LOG(FATAL) << "Tried to access vA of instruction " << Name() << " which has no A operand."; exit(EXIT_FAILURE);
}
}
inline uint4_t Instruction::VRegA_35c(uint16_t inst_data) const {
DCHECK_EQ(FormatOf(Opcode()), k35c); return InstB(inst_data); // This is labeled A in the spec.
}
inline uint4_t Instruction::VRegA_45cc(uint16_t inst_data) const {
DCHECK_EQ(FormatOf(Opcode()), k45cc); return InstB(inst_data); // This is labeled A in the spec.
}
//------------------------------------------------------------------------------ // VRegB //------------------------------------------------------------------------------ inlinebool Instruction::HasVRegB() const { switch (FormatOf(Opcode())) { case k11n: returntrue; case k12x: returntrue; case k21c: returntrue; case k21h: returntrue; case k21s: returntrue; case k21t: returntrue; case k22b: returntrue; case k22c: returntrue; case k22s: returntrue; case k22t: returntrue; case k22x: returntrue; case k23x: returntrue; case k31c: returntrue; case k31i: returntrue; case k31t: returntrue; case k32x: returntrue; case k35c: returntrue; case k3rc: returntrue; case k45cc: returntrue; case k4rcc: returntrue; case k51l: returntrue; default: returnfalse;
}
}
inline int32_t Instruction::VRegB(Format format, uint16_t inst_data) const {
DCHECK_EQ(format, FormatOf(Opcode())); switch (format) { case k11n: return VRegB_11n(inst_data); case k12x: return VRegB_12x(inst_data); case k21c: return VRegB_21c(); case k21h: return VRegB_21h(); case k21s: return VRegB_21s(); case k21t: return VRegB_21t(); case k22b: return VRegB_22b(); case k22c: return VRegB_22c(inst_data); case k22s: return VRegB_22s(inst_data); case k22t: return VRegB_22t(inst_data); case k22x: return VRegB_22x(); case k23x: return VRegB_23x(); case k31c: return VRegB_31c(); case k31i: return VRegB_31i(); case k31t: return VRegB_31t(); case k32x: return VRegB_32x(); case k35c: return VRegB_35c(); case k3rc: return VRegB_3rc(); case k45cc: return VRegB_45cc(); case k4rcc: return VRegB_4rcc(); case k51l: return VRegB_51l(); default:
LOG(FATAL) << "Tried to access vB of instruction " << Name() << " which has no B operand."; exit(EXIT_FAILURE);
}
}
//------------------------------------------------------------------------------ // VRegC //------------------------------------------------------------------------------ inlinebool Instruction::HasVRegC() const { switch (FormatOf(Opcode())) { case k22b: returntrue; case k22c: returntrue; case k22s: returntrue; case k22t: returntrue; case k23x: returntrue; case k35c: returntrue; case k3rc: returntrue; case k45cc: returntrue; case k4rcc: returntrue; default: returnfalse;
}
}
inline int32_t Instruction::VRegC(Format format) const {
DCHECK_EQ(format, FormatOf(Opcode())); switch (format) { case k22b: return VRegC_22b(); case k22c: return VRegC_22c(); case k22s: return VRegC_22s(); case k22t: return VRegC_22t(); case k23x: return VRegC_23x(); case k35c: return VRegC_35c(); case k3rc: return VRegC_3rc(); case k45cc: return VRegC_45cc(); case k4rcc: return VRegC_4rcc(); default:
LOG(FATAL) << "Tried to access vC of instruction " << Name() << " which has no C operand."; exit(EXIT_FAILURE);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.