[Tarantool-patches] [PATCH luajit] ARM64: Fix assembly of HREFK.

Igor Munkin imun at tarantool.org
Thu Jun 30 15:11:18 MSK 2022


Sergey,

I've checked the patch into all long-term branches with ARM64 support in
tarantool/luajit and bumped a new version in master, 2.10.

On 27.10.21, Sergey Kaplun wrote:
> From: Mike Pall <mike>
> 
> Reported by Jason Teplitz.
> 
> (cherry picked from commit 06cd9fce7df440323647174f1ca4a01281ec8acd)
> 
> LDR instruction with register offset [1] has a restriction, that the
> destination register must be different from the register used for offset
> base. HREFK IR emits LDR instruction for a load of node key to a
> register. Base register to offset contains a node address. The register
> holding the node address is not excluded from a allow set, when loading
> the key value to a new register, and may be chosen by the register
> allocator as a destination for the key value, which violates the
> aforementioned restriction.
> 
> This patch excludes the node register from the allowing set in the
> allocation of register for a key value.
> 
> Sergey Kaplun:
> * added the description and the test for the problem
> 
> [1]: https://developer.arm.com/documentation/dui0489/c/arm-and-thumb-instructions/memory-access-instructions/ldr-and-str--register-offset-
> 
> Part of tarantool/tarantool#6548
> ---
> 
> Branch: https://github.com/tarantool/luajit/tree/skaplun/lj-357-arm64-hrefk
> Tarantool branch: https://github.com/tarantool/tarantool/tree/skaplun/lj-357-arm64-hrefk
> LuaJIT issue: https://github.com/LuaJIT/LuaJIT/issues/357
> Issue: https://github.com/tarantool/tarantool/issues/6548
> 
>  src/lj_asm_arm64.h                            | 11 ++++----
>  .../lj-357-arm64-hrefk.test.lua               | 27 +++++++++++++++++++
>  2 files changed, 32 insertions(+), 6 deletions(-)
>  create mode 100644 test/tarantool-tests/lj-357-arm64-hrefk.test.lua
> 

<snipped>

> -- 
> 2.31.0
> 

-- 
Best regards,
IM


More information about the Tarantool-patches mailing list