RandomX improved performance of GCC compiled binaries

JIT compilator was slower compared to MSVC compiled binary. Up to +0.1% speedup on rx/wow in Linux.
This commit is contained in:
SChernykh 2020-09-22 13:48:11 +02:00
parent 1584cca6d1
commit 9768bf65d1
5 changed files with 20 additions and 7 deletions

View file

@ -267,7 +267,12 @@ void RandomX_ConfigurationBase::Apply()
}
}
#define JIT_HANDLE(x, prev) randomx::JitCompilerX86::engine[k] = &randomx::JitCompilerX86::h_##x
typedef void(randomx::JitCompilerX86::* InstructionGeneratorX86_2)(const randomx::Instruction&);
#define JIT_HANDLE(x, prev) do { \
const InstructionGeneratorX86_2 p = &randomx::JitCompilerX86::h_##x; \
memcpy(randomx::JitCompilerX86::engine + k, &p, sizeof(p)); \
} while (0)
#elif defined(XMRIG_ARMv8)