mirror of
https://github.com/hedge-dev/XenonRecomp.git
synced 2025-05-23 10:22:06 +00:00
Recompiler: Use implementation aliases
This commit is contained in:
parent
c4de70262f
commit
8d8346c2a2
@ -1972,15 +1972,18 @@ bool Recompiler::Recompile(const Function& fn)
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto symbol = image.symbols.find(fn.base);
|
auto symbol = image.symbols.find(fn.base);
|
||||||
|
std::string name;
|
||||||
if (symbol != image.symbols.end())
|
if (symbol != image.symbols.end())
|
||||||
{
|
{
|
||||||
println("PPC_WEAK_FUNC({}) {{", symbol->name);
|
name = symbol->name;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
println("PPC_WEAK_FUNC(sub_{}) {{", fn.base);
|
name = std::format("sub_{}", fn.base);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
println("__attribute__((alias(\"__imp__{}\"))) PPC_WEAK_FUNC({});", name, name);
|
||||||
|
println("PPC_FUNC_IMPL(__imp__{}) {{", name);
|
||||||
println("\tPPC_FUNC_PROLOGUE();");
|
println("\tPPC_FUNC_PROLOGUE();");
|
||||||
|
|
||||||
auto switchTable = switchTables.end();
|
auto switchTable = switchTables.end();
|
||||||
|
@ -14,8 +14,12 @@
|
|||||||
#include <intrin.h>
|
#include <intrin.h>
|
||||||
#include <x86intrin.h>
|
#include <x86intrin.h>
|
||||||
|
|
||||||
|
#define PPC_JOIN(x, y) x##y
|
||||||
|
#define PPC_XSTRINGIFY(x) #x
|
||||||
|
#define PPC_STRINGIFY(x) PPC_XSTRINGIFY(x)
|
||||||
#define PPC_FUNC(x) void x(PPCContext& __restrict ctx, uint8_t* base)
|
#define PPC_FUNC(x) void x(PPCContext& __restrict ctx, uint8_t* base)
|
||||||
#define PPC_EXTERN_FUNC(x) extern PPC_FUNC(x)
|
#define PPC_FUNC_IMPL(x) extern "C" PPC_FUNC(x)
|
||||||
|
#define PPC_EXTERN_FUNC(x) extern "C" PPC_FUNC(x)
|
||||||
#define PPC_WEAK_FUNC(x) __attribute__((weak,noinline)) PPC_FUNC(x)
|
#define PPC_WEAK_FUNC(x) __attribute__((weak,noinline)) PPC_FUNC(x)
|
||||||
|
|
||||||
#define PPC_FUNC_PROLOGUE() __builtin_assume(((size_t)base & 0xFFFFFFFF) == 0)
|
#define PPC_FUNC_PROLOGUE() __builtin_assume(((size_t)base & 0xFFFFFFFF) == 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user