From: Igor Munkin via Tarantool-patches <tarantool-patches@dev.tarantool.org> To: Maxim Kokryashkin <max.kokryashkin@gmail.com> Cc: tarantool-patches@dev.tarantool.org Subject: Re: [Tarantool-patches] [PATCH luajit v2] x64: Fix 64 bit shift code generation. Date: Tue, 4 Jul 2023 17:09:45 +0000 [thread overview] Message-ID: <ZKRSWSAKGGdK34sr@tarantool.org> (raw) In-Reply-To: <20230613124237.2520-1-m.kokryashkin@tarantool.org> Max, I've checked the patchset into all long-term branches in tarantool/luajit and bumped a new version in master, release/2.11 and release/2.10. On 13.06.23, Maxim Kokryashkin via Tarantool-patches wrote: > From: Mike Pall <mike> > > Reported by Philipp Kutin. > Fix contributed by Peter Cawley. > > (cherry-picked from commit 03a7ebca4f6819658cdaa12ba3af54a17b8035e9) > > In a situation where a variable shift left bitwise rotation that > has a 64-bit result is recorded on an x86 64-bit processor and > the result is supposed to end up in the `rcx` register, that value > could be written into the `ecx` instead, thus being truncated into > 32 bits. This patch fixes the described behavior, so now that > value is written into the `rcx`. > > Resulting assembly changes from the following before the patch: > | rol rsi, cl > | mov ecx, esi > > to the following after the patch: > | rol rsi, cl > | mov rcx, rsi > > Importantly, the same behavior is impossible with the right > rotation on machines with BMI2 support because there is a > BMI2 instruction for it, so it is handled differently. > > Maxim Kokryashkin: > * added the description and the test for the problem > > Part of tarantool/tarantool#8516 > --- > Changes in v2: > - Fixed comments as per review by Sergey > > Branch: https://github.com/tarantool/luajit/tree/fckxorg/fix-bit-shift-generation > PR: https://github.com/tarantool/tarantool/pull/8727 > > src/lj_asm_x86.h | 2 +- > test/tarantool-tests/CMakeLists.txt | 1 + > .../fix-bit-shift-generation.test.lua | 48 +++++++++++++++++++ > .../fix-bit-shift-generation/CMakeLists.txt | 1 + > .../libtestbitshift.c | 8 ++++ > 5 files changed, 59 insertions(+), 1 deletion(-) > create mode 100644 test/tarantool-tests/fix-bit-shift-generation.test.lua > create mode 100644 test/tarantool-tests/fix-bit-shift-generation/CMakeLists.txt > create mode 100644 test/tarantool-tests/fix-bit-shift-generation/libtestbitshift.c > <snipped> > -- > 2.40.1 > -- Best regards, IM
next prev parent reply other threads:[~2023-07-04 17:19 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-06-13 12:42 Maxim Kokryashkin via Tarantool-patches 2023-06-28 10:57 ` Sergey Kaplun via Tarantool-patches 2023-06-29 8:59 ` Igor Munkin via Tarantool-patches 2023-07-04 17:09 ` Igor Munkin via Tarantool-patches [this message] -- strict thread matches above, loose matches on Subject: below -- 2023-06-09 9:13 Maxim Kokryashkin via Tarantool-patches 2023-06-09 9:50 ` Sergey Kaplun via Tarantool-patches
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=ZKRSWSAKGGdK34sr@tarantool.org \ --to=tarantool-patches@dev.tarantool.org \ --cc=imun@tarantool.org \ --cc=max.kokryashkin@gmail.com \ --subject='Re: [Tarantool-patches] [PATCH luajit v2] x64: Fix 64 bit shift code generation.' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox