[Tarantool-patches] [PATCH luajit] ARM64: Don't fuse sign extensions into logical operands.
Evgeniy Temirgaleev
e.temirgaleev at tarantool.org
Wed Nov 18 12:42:54 MSK 2026
Hi, Sergey!
On 11/18/26 11:31 AM, Sergey Kaplun wrote:
> Hi, Evgeniy!
> Thanks for the review!
>
> On 17.11.26, Evgeniy Temirgaleev wrote:
>> Hi, Sergey! Thanks for the patch! LGTM with a note.
>>
>> On 11/16/26 3:05 PM, Sergey Kaplun wrote:
>>> From: Mike Pall <mike>
>>>
>>> Thanks to Peter Cawley.
>>>
>>> (cherry picked from commit 90742d91c27d185b70d1b4a6343fb6b7c26002db)
>>>
>>> Logical instructions [1] (`orr`, etc.) have no sign extension form
>>> (unlike `ADD Xd, Xn, Wm, SXTW #k`). This makes the fusing sign extension
>>> into them meaningless and leads to the incorrect result in the
>>> JIT-compiled code.
>>>
>>> This patch prevents the fusing of sign extension (`sxtw`) into logical
>>> instructions.
>>>
>>> [1]: https://cybersandeep.gitbook.io/arm64basicguide/chapter-3-basic-arm64-instructions#id-3.2.2-logical-instructions
>> The article contains only basic form of arithmetic and logical (and
>> other) instructions. It omits their complex forms with optional second
>> operand shift and/or extension and is not illustrative for this patch.
>
> Yes, I've failed to find the definition of the logical instructions at
> the non-blocked resources :(. At least it has the definition of logical
> instruction...
> Do you think it is better to remove the link to avoid the confusion?
>
I found a working link [1]. You can use it with the document reference
data: "Arm® Instruction Set. Version 1.0. Reference Guide" (version 25
October 2018), "Chapter D2. A64 General Instructions".
[1]
https://www.heenes.de/ro/material/arm/arm_instruction_set_reference_guide.pdf
>>
>>>
>>> Sergey Kaplun:
>>> * added the description and the test for the problem
>>>
>>> Part of tarantool/tarantool#13442
>>> ---
>
> <snipped>
>
>> --
>> Best regards,
>> Evgeniy Temirgaleev
>>
>
--
--
Best regards,
Evgeniy Temirgaleev
More information about the Tarantool-patches
mailing list