Skip to content

Commit

Permalink
aarch64 JIT: support soft AES
Browse files Browse the repository at this point in the history
  • Loading branch information
SChernykh committed Sep 27, 2023
1 parent fcf9f12 commit 532a656
Show file tree
Hide file tree
Showing 3 changed files with 518 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/jit_compiler_a64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,15 @@ void JitCompilerA64::generateProgram(Program& program, ProgramConfiguration& con
if (flags & RANDOMX_FLAG_V2) {
codePos = ((uint8_t*)randomx_program_aarch64_v2_FE_mix) - ((uint8_t*)randomx_program_aarch64);

// Disable the jump to RandomX v1 FE mix code by writing "movi v28.4s, 0" instruction
emit32(0x4F00041C, code, codePos);
if (flags & RANDOMX_FLAG_HARD_AES) {
// Disable the jump to RandomX v1 FE mix code by writing "movi v28.4s, 0" instruction
emit32(0x4F00041C, code, codePos);
}
else {
// Jump to RandomX v2 FE mix soft AES code by writing "b randomx_program_aarch64_v2_FE_mix_soft_aes" instruction
const uint32_t offset = (uint8_t*)randomx_program_aarch64_v2_FE_mix_soft_aes - (uint8_t*)randomx_program_aarch64_v2_FE_mix;
emit32(ARMV8A::B | (offset / 4), code, codePos);
}
}

#ifdef __GNUC__
Expand Down
Loading

0 comments on commit 532a656

Please sign in to comment.