mirror of
https://github.com/open-goal/jak-project
synced 2026-06-06 03:39:01 -04:00
f123bf368a
* temp: commit what i have so far decomp: Fix nonempty_intersection impl for MSVC Debugging use-case docs: Add info on getting ASan builds running on Visual Studio w/o exceptions * decomp: initial rlet implementation * decomp: cleanup pass of vector-rewrite stage * decomp: Commit in-progress vector.gc, shortcomings are TODO commented * decomp: More cleanup, rename from being `vector` instr specific Fundamentally, this process can be used for re-writing ANY inline-asm instruction * decomp: Support 4th arg ACC instructions * decomp: Final pass of vector.gc before implementing last instructions * decomp: Better warnings when hitting unimplemented instructs * compiler: Implement inverse-sqrt and mov.vf * decomp: Final manual pass over vector.gc, documented gaps * decomp: Finish decompiling what currently is possible in vector.gc * decomp: Fix Variable -> RegisterAccess conflict * decomp: codacy lint * Address review feedback * Address feedback part 2 * Resolve build failures
53 lines
1.3 KiB
C++
53 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <optional>
|
|
#include <cassert>
|
|
#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"
|
|
|
|
namespace decompiler {
|
|
|
|
struct OpenGOALAsm {
|
|
enum class InstructionModifiers {
|
|
BROADCAST,
|
|
DEST_MASK,
|
|
FTF,
|
|
FSF,
|
|
OFFSET,
|
|
SWAP_FIRST_TWO_SOURCE_ARGS,
|
|
ACC_THIRD_SRC_ARG
|
|
};
|
|
|
|
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;
|
|
std::optional<RegisterAccess> m_dst;
|
|
std::vector<std::optional<RegisterAccess>> m_src;
|
|
Instruction instr;
|
|
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
|