Make decompiler more successful (#66)

* w/early-return-and-break

* more edge cases

* all instructions in non asm functions now convert to ir

* cleanup

* implement rarely used control flow in IR

* clang format
This commit is contained in:
water111
2020-10-11 18:27:44 -04:00
committed by GitHub
parent 30e0e4204b
commit 1e1b5e7c00
11 changed files with 970 additions and 22 deletions
+12 -2
View File
@@ -116,9 +116,10 @@ bool InstructionAtom::is_link_or_label() const {
}
/*!
* Convert entire instruction to a string.
* Convert just the name of the opcode to a string, omitting src/dst, but including
* suffixes (interlock, broadcasts and destination)
*/
std::string Instruction::to_string(const LinkedObjectFile& file) const {
std::string Instruction::op_name_to_string() const {
auto& info = gOpcodeInfo[(int)kind];
// the name
@@ -162,6 +163,15 @@ std::string Instruction::to_string(const LinkedObjectFile& file) const {
if (cop2_dest & 1)
result.push_back('w');
}
return result;
}
/*!
* Convert entire instruction to a string.
*/
std::string Instruction::to_string(const LinkedObjectFile& file) const {
auto& info = gOpcodeInfo[(int)kind];
auto result = op_name_to_string();
// relative store and load instructions have a special syntax in MIPS
if (info.is_store) {