diff --git a/PowerRecomp/recompiler.cpp b/PowerRecomp/recompiler.cpp index 0269dbf..2beb739 100644 --- a/PowerRecomp/recompiler.cpp +++ b/PowerRecomp/recompiler.cpp @@ -1968,7 +1968,11 @@ bool Recompiler::Recompile(const Function& fn) while (base < end) { if (labels.contains(base)) + { println("loc_{:X}:", base); + // With a read barrier we prevent the compiler from doing unsafe code reordering. I wonder if we could do this better... + println("\t_ReadBarrier();"); + } if (switchTable == switchTables.end()) switchTable = switchTables.find(base); diff --git a/PowerUtils/ppc_context.h b/PowerUtils/ppc_context.h index a2a2382..e6d2b86 100644 --- a/PowerUtils/ppc_context.h +++ b/PowerUtils/ppc_context.h @@ -9,12 +9,12 @@ #include #include #include +#include #ifdef __clang__ #include #define PPC_NOINLINE __attribute__((noinline)) #else -#include #define __restrict__ __restrict #define __builtin_bswap16 _byteswap_ushort #define __builtin_bswap32 _byteswap_ulong