Tarantool development patches archive
 help / color / mirror / Atom feed
From: Igor Munkin via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Sergey Kaplun <skaplun@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH luajit] Fix FOLD rule for strength reduction of widening.
Date: Thu, 30 Jun 2022 15:09:55 +0300	[thread overview]
Message-ID: <Yr2SkxaDgkLVW+Cu@tarantool.org> (raw)
In-Reply-To: <20211018185341.32155-1-skaplun@tarantool.org>

Sergey,

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

On 18.10.21, Sergey Kaplun wrote:
> From: Mike Pall <mike>
> 
> Reported by Matthew Burk.
> 
> (cherry picked from commit 9f0caad0e43f97a4613850b3874b851cb1bc301d)
> 
> The simplify_conv_sext optimization is used for reduction of widening.
> cdata indexing narrow optimization uses it for narrowing of a C array
> index. The optimization eliminates sign extension for corresponding
> integer value. However, this conversion cannot be omitted for non
> constant values (for example loading stack slots) as far as their sign
> extension may change. The emitted machine code may be incorrect without
> aforementioned conversion (for example mov instruction instead movsxd is
> used on x86 architecture). As a result the value in a destination
> register during trace execution is invalid.
> 
> This patch allows this optimization only for constant integer values.
> 
> Sergey Kaplun:
> * added the description and the test for the problem
> ---
> 
> Tarantool branch: https://github.com/tarantool/tarantool/tree/skaplun/gh-noticket-fix-fold-simplify-conv-sext
> Branch: https://github.com/tarantool/luajit/tree/skaplun/gh-noticket-fix-fold-simplify-conv-sext
> 
>  src/lj_opt_fold.c                             |  2 +-
>  .../lj-fix-fold-simplify-conv-sext.test.lua   | 35 +++++++++++++++++++
>  2 files changed, 36 insertions(+), 1 deletion(-)
>  create mode 100644 test/tarantool-tests/lj-fix-fold-simplify-conv-sext.test.lua
> 

<snipped>

> -- 
> 2.31.0
> 

-- 
Best regards,
IM

      parent reply	other threads:[~2022-06-30 12:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-18 18:53 Sergey Kaplun via Tarantool-patches
2021-10-27 16:08 ` sergos via Tarantool-patches
2021-10-28 11:36   ` Sergey Kaplun via Tarantool-patches
2021-10-28 12:37     ` sergos via Tarantool-patches
2021-10-29  7:49       ` Sergey Kaplun via Tarantool-patches
2022-06-28 13:21 ` Igor Munkin via Tarantool-patches
2022-06-30 12:09 ` Igor Munkin via Tarantool-patches [this message]

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=Yr2SkxaDgkLVW+Cu@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=imun@tarantool.org \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH luajit] Fix FOLD rule for strength reduction of widening.' \
    /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