|
|
|
@ -98,9 +98,11 @@ JitCompilerA64::JitCompilerA64()
|
|
|
|
|
memset(reg_changed_offset, 0, sizeof(reg_changed_offset));
|
|
|
|
|
memcpy(code, (void*) randomx_program_aarch64, CodeSize);
|
|
|
|
|
|
|
|
|
|
#ifdef __GNUC__
|
|
|
|
|
__builtin___clear_cache(reinterpret_cast<char*>(code), reinterpret_cast<char*>(code + CodeSize));
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_BUILTIN_CLEAR_CACHE
|
|
|
|
|
__builtin___clear_cache(reinterpret_cast<char*>(code), reinterpret_cast<char*>(code + CodeSize));
|
|
|
|
|
#else
|
|
|
|
|
sys_icache_invalidate(code, code + CodeSize);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JitCompilerA64::~JitCompilerA64()
|
|
|
|
@ -169,9 +171,11 @@ void JitCompilerA64::generateProgram(Program& program, ProgramConfiguration& con
|
|
|
|
|
codePos = ((uint8_t*)randomx_program_aarch64_update_spMix1) - ((uint8_t*)randomx_program_aarch64);
|
|
|
|
|
emit32(ARMV8A::EOR | 10 | (IntRegMap[config.readReg0] << 5) | (IntRegMap[config.readReg1] << 16), code, codePos);
|
|
|
|
|
|
|
|
|
|
#ifdef __GNUC__
|
|
|
|
|
__builtin___clear_cache(reinterpret_cast<char*>(code + MainLoopBegin), reinterpret_cast<char*>(code + codePos));
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_BUILTIN_CLEAR_CACHE
|
|
|
|
|
__builtin___clear_cache(reinterpret_cast<char*>(code), reinterpret_cast<char*>(code + CodeSize));
|
|
|
|
|
#else
|
|
|
|
|
sys_icache_invalidate(code, code + CodeSize);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void JitCompilerA64::generateProgramLight(Program& program, ProgramConfiguration& config, uint32_t datasetOffset)
|
|
|
|
@ -226,9 +230,11 @@ void JitCompilerA64::generateProgramLight(Program& program, ProgramConfiguration
|
|
|
|
|
emit32(ARMV8A::ADD_IMM_LO | 2 | (2 << 5) | (imm_lo << 10), code, codePos);
|
|
|
|
|
emit32(ARMV8A::ADD_IMM_HI | 2 | (2 << 5) | (imm_hi << 10), code, codePos);
|
|
|
|
|
|
|
|
|
|
#ifdef __GNUC__
|
|
|
|
|
__builtin___clear_cache(reinterpret_cast<char*>(code + MainLoopBegin), reinterpret_cast<char*>(code + codePos));
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_BUILTIN_CLEAR_CACHE
|
|
|
|
|
__builtin___clear_cache(reinterpret_cast<char*>(code), reinterpret_cast<char*>(code + CodeSize));
|
|
|
|
|
#else
|
|
|
|
|
sys_icache_invalidate(code, code + CodeSize);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<size_t N>
|
|
|
|
@ -344,9 +350,11 @@ void JitCompilerA64::generateSuperscalarHash(SuperscalarProgram(&programs)[N], s
|
|
|
|
|
memcpy(code + codePos, p1, p2 - p1);
|
|
|
|
|
codePos += p2 - p1;
|
|
|
|
|
|
|
|
|
|
#ifdef __GNUC__
|
|
|
|
|
__builtin___clear_cache(reinterpret_cast<char*>(code + CodeSize), reinterpret_cast<char*>(code + codePos));
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_BUILTIN_CLEAR_CACHE
|
|
|
|
|
__builtin___clear_cache(reinterpret_cast<char*>(code), reinterpret_cast<char*>(code + CodeSize));
|
|
|
|
|
#else
|
|
|
|
|
sys_icache_invalidate(code, code + CodeSize);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template void JitCompilerA64::generateSuperscalarHash(SuperscalarProgram(&programs)[RANDOMX_CACHE_ACCESSES], std::vector<uint64_t> &reciprocalCache);
|
|
|
|
|