mirror of
https://github.com/hedge-dev/XenonRecomp.git
synced 2025-04-19 19:01:17 +00:00
Add a read barrier after every label.
This commit is contained in:
parent
261e8c1d60
commit
7fa7ff161f
@ -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);
|
||||
|
@ -9,12 +9,12 @@
|
||||
#include <cstring>
|
||||
#include <cmath>
|
||||
#include <csetjmp>
|
||||
#include <intrin.h>
|
||||
|
||||
#ifdef __clang__
|
||||
#include <x86intrin.h>
|
||||
#define PPC_NOINLINE __attribute__((noinline))
|
||||
#else
|
||||
#include <intrin.h>
|
||||
#define __restrict__ __restrict
|
||||
#define __builtin_bswap16 _byteswap_ushort
|
||||
#define __builtin_bswap32 _byteswap_ulong
|
||||
|
Loading…
x
Reference in New Issue
Block a user