IR: Add IR type CoprocInfo

This commit is contained in:
MerryMage 2016-12-31 10:46:13 +00:00 committed by Merry
parent 890b2f75ad
commit d8a37e287c
4 changed files with 19 additions and 3 deletions

View file

@ -39,6 +39,10 @@ Value::Value(u64 value) : type(Type::U64) {
inner.imm_u64 = value;
}
Value::Value(std::array<u8, 8> value) : type(Type::CoprocInfo) {
inner.imm_coproc = value;
}
bool Value::IsImmediate() const {
if (type == Type::Opaque)
return inner.inst->GetOpcode() == Opcode::Identity ? inner.inst->GetArg(0).IsImmediate() : false;
@ -103,5 +107,12 @@ u64 Value::GetU64() const {
return inner.imm_u64;
}
std::array<u8, 8> Value::GetCoprocInfo() const {
if (type == Type::Opaque && inner.inst->GetOpcode() == Opcode::Identity)
return inner.inst->GetArg(0).GetCoprocInfo();
DEBUG_ASSERT(type == Type::CoprocInfo);
return inner.imm_coproc;
}
} // namespace IR
} // namespace Dynarmic