mirror of
https://github.com/N64Recomp/N64Recomp.git
synced 2025-06-29 13:36:17 +00:00
Implement trap instructions as conditional breaks
This commit is contained in:
parent
989a86b369
commit
a8b247ed03
7 changed files with 92 additions and 46 deletions
|
@ -177,4 +177,19 @@ namespace N64Recomp {
|
|||
{ InstrId::cpu_sdc1, { StoreOpType::SDC1, Operand::FtU64 }},
|
||||
{ InstrId::cpu_swc1, { StoreOpType::SWC1, Operand::FtU32L }},
|
||||
};
|
||||
|
||||
const std::unordered_map<InstrId, TrapOp> trap_ops {
|
||||
{ InstrId::cpu_tge, { BinaryOpType::GreaterEq, {{ UnaryOpType::ToS64, UnaryOpType::ToS64 }, { Operand::Rs, Operand::Rt }}}},
|
||||
{ InstrId::cpu_tgeu, { BinaryOpType::GreaterEq, {{ UnaryOpType::ToU64, UnaryOpType::ToU64 }, { Operand::Rs, Operand::Rt }}}},
|
||||
{ InstrId::cpu_tlt, { BinaryOpType::Less, {{ UnaryOpType::ToS64, UnaryOpType::ToS64 }, { Operand::Rs, Operand::Rt }}}},
|
||||
{ InstrId::cpu_tltu, { BinaryOpType::Less, {{ UnaryOpType::ToU64, UnaryOpType::ToU64 }, { Operand::Rs, Operand::Rt }}}},
|
||||
{ InstrId::cpu_teq, { BinaryOpType::Equal, {{ UnaryOpType::None, UnaryOpType::None }, { Operand::Rs, Operand::Rt }}}},
|
||||
{ InstrId::cpu_tne, { BinaryOpType::NotEqual, {{ UnaryOpType::None, UnaryOpType::None }, { Operand::Rs, Operand::Rt }}}},
|
||||
{ InstrId::cpu_tgei, { BinaryOpType::GreaterEq, {{ UnaryOpType::ToS64, UnaryOpType::ToS64 }, { Operand::Rs, Operand::ImmS16 }}}},
|
||||
{ InstrId::cpu_tgeiu, { BinaryOpType::GreaterEq, {{ UnaryOpType::ToU64, UnaryOpType::ToU64 }, { Operand::Rs, Operand::ImmS16 }}}},
|
||||
{ InstrId::cpu_tlti, { BinaryOpType::Less, {{ UnaryOpType::ToS64, UnaryOpType::ToS64 }, { Operand::Rs, Operand::ImmS16 }}}},
|
||||
{ InstrId::cpu_tltiu, { BinaryOpType::Less, {{ UnaryOpType::ToU64, UnaryOpType::ToU64 }, { Operand::Rs, Operand::ImmS16 }}}},
|
||||
{ InstrId::cpu_teqi, { BinaryOpType::Equal, {{ UnaryOpType::None, UnaryOpType::None }, { Operand::Rs, Operand::ImmS16 }}}},
|
||||
{ InstrId::cpu_tnei, { BinaryOpType::NotEqual, {{ UnaryOpType::None, UnaryOpType::None }, { Operand::Rs, Operand::ImmS16 }}}},
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue