Files
jak-project/decompiler/IR2/OpenGoalMapping.h
T
Tyler Wilding 142961a747 decomp: the majority of navigate and rolling-lightning-mole (#741)
* decomp: Add texture-upload to ref tests

* maybe 50% done?

* 5 functions to go!

* decomp: stuck in `navigate`

* work-around fp issue

* some cleanup and label casts

* working on supporting asm instructions -- this is currently WRONG

* support ASM operations

* fixes for asm op support

* decomp: finish the vast majority of `navigate`

* format

* update test though i think this suggests a regression!

* decomp: cleanup some more of navigate

* decomp: finish `rolling-lightning-mole`

* revert `r0` handling for `pcpyud` and `pextuw`

* update ref tests

* lint

* fix a failing test

* help

* navigate mostly works now, with some potential bugs

* remove my debugging logs

* update ref tests

* review feedback cleanup

* these are all likely fine

* can't get the crab to chase me anymore

* the crab is back
2022-01-18 01:14:47 -05:00

54 lines
1.3 KiB
C++

#pragma once
#include <string>
#include <optional>
#include <utility>
#include <map>
#include "common/goos/Object.h"
#include "decompiler/Disasm/Register.h"
#include "decompiler/Disasm/Instruction.h"
#include "decompiler/IR2/IR2_common.h"
#include "Env.h"
#include "AtomicOp.h"
#include "common/util/assert.h"
namespace decompiler {
struct OpenGOALAsm {
enum class InstructionModifiers {
BROADCAST,
DEST_MASK,
FTF,
FSF,
OFFSET,
SWAP_FIRST_TWO_SOURCE_ARGS,
ACC_THIRD_SRC_ARG,
QWORD_CAST
};
struct Function {
std::string funcTemplate = "";
std::vector<InstructionModifiers> modifiers = {};
bool allows_modifier(InstructionModifiers);
};
OpenGOALAsm(Instruction _instr);
OpenGOALAsm(Instruction _instr,
std::optional<RegisterAccess> _dst,
const std::vector<std::optional<RegisterAccess>>& _src);
bool valid = true;
bool todo = false;
Instruction m_instr;
std::optional<RegisterAccess> m_dst;
std::vector<std::optional<RegisterAccess>> m_src;
OpenGOALAsm::Function func;
std::string full_function_name();
std::vector<goos::Object> get_args(const std::vector<DecompilerLabel>& labels, const Env& env);
};
extern const std::map<InstructionKind, OpenGOALAsm::Function> MIPS_ASM_TO_OPEN_GOAL_FUNCS;
} // namespace decompiler