IR: Implement Conditional Select

This commit is contained in:
MerryMage 2018-01-18 11:36:48 +00:00
parent 7992a319ba
commit 6395f09f94
9 changed files with 126 additions and 0 deletions

View file

@ -55,6 +55,10 @@ Value::Value(std::array<u8, 8> value) : type(Type::CoprocInfo) {
inner.imm_coproc = value;
}
Value::Value(Cond value) : type(Type::Cond) {
inner.imm_cond = value;
}
bool Value::IsImmediate() const {
if (type == Type::Opaque)
return inner.inst->GetOpcode() == Opcode::Identity ? inner.inst->GetArg(0).IsImmediate() : false;
@ -143,5 +147,12 @@ std::array<u8, 8> Value::GetCoprocInfo() const {
return inner.imm_coproc;
}
Cond Value::GetCond() const {
if (type == Type::Opaque && inner.inst->GetOpcode() == Opcode::Identity)
return inner.inst->GetArg(0).GetCond();
ASSERT(type == Type::Cond);
return inner.imm_cond;
}
} // namespace IR
} // namespace Dynarmic