[Tarantool-patches] [PATCH luajit] ARM64: Fix {AHUV}LOAD specialized to nil/false/true.

Igor Munkin imun at tarantool.org
Thu Mar 30 20:37:13 MSK 2023


Sergey,

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

On 25.01.23, Sergey Kaplun via Tarantool-patches wrote:
> From: Mike Pall <mike>
> 
> Reported by caohongqing.
> 
> (cherry picked from commit 5bf0da3d7c02f9959fa3a9fb721e0565137b70c8)
> 
> If there is high register pressure, and there are almost all registers
> in use during the aforementioned assembling, the same register is chosen
> as the one holding the given stack slot and the one holding the constant
> value for the type comparison. As the result we get the following
> assertion guard check in assembly:
> | cmp   x0, x0, lsr #32
> | bne   ->0
> Which is always false.
> 
> This happens because the `tmp` register (used for loading constant type
> to compare in assertion guard) is scratched from `gpr` register set, but
> not from `allow` set, which is used during picking the register for slot
> loading (at the begging `allow` and `gpr` sets are the same).
> 
> This patch changes `allow` set to `gpr` to fix the issue.
> 
> Sergey Kaplun:
> * added the description and the test for the problem
> 
> Part of tarantool/tarantool#8069
> ---
> 
> Branch: https://github.com/tarantool/luajit/tree/skaplun/or-94-fix-bool-ahuvload
> PR: https://github.com/tarantool/tarantool/pull/8214
> Issues:
> * https://github.com/tarantool/tarantool/issues/8069
> * https://github.com/openresty/luajit2/pull/94
> 
>  src/lj_asm_arm64.h                            |   2 +-
>  .../or-94-arm64-ir-ahuvload-bool.test.lua     | 145 ++++++++++++++++++
>  2 files changed, 146 insertions(+), 1 deletion(-)
>  create mode 100644 test/tarantool-tests/or-94-arm64-ir-ahuvload-bool.test.lua
> 

<snipped>

> -- 
> 2.34.1
> 

-- 
Best regards,
IM


More information about the Tarantool-patches mailing list