From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id D1F6F6ECE4; Thu, 30 Jun 2022 15:17:51 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D1F6F6ECE4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1656591471; bh=38/eXUqr4A5KJMUkMBF+g+5mPpZANmV3/ajiYWpI/K8=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=iS7qd9EMq7w42IT9LGkoT5cALzmB9HxojX5w9USyGm0v7Dw0uF5ZSwKp/+l9RwEJ7 qd4TtPsJE1f2z/a8F4X+tnlV3W41it+uCx5Xw2qQ01eyv5Bto21KIC1K3oB8mb3QR7 u3Zn9soNNPHlrEx1u2EzxeM/IAQ7dYMX6RIzLBDE= Received: from smtpng3.i.mail.ru (smtpng3.i.mail.ru [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id E56FC6ECE3 for ; Thu, 30 Jun 2022 15:17:06 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E56FC6ECE3 Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1o6t6X-0006qm-UM; Thu, 30 Jun 2022 15:17:06 +0300 Date: Thu, 30 Jun 2022 15:09:55 +0300 To: Sergey Kaplun Message-ID: References: <20211018185341.32155-1-skaplun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20211018185341.32155-1-skaplun@tarantool.org> X-Clacks-Overhead: GNU Terry Pratchett X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9F05DDD76985F9126D76547AB773229DD18E19CE8538291F4182A05F5380850400670836248EB2FCEF9759720427D37DAAEAFF324FB0D9AC694C76D720CF2E207 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7B9FBA884A7C9B8BAEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006376AEB812070489DF38638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8DD8A2B464A7EFE1EB4C8698095859F58117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCAA867293B0326636D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8B55D5BE2F85BDEC5FA471835C12D1D977C4224003CC8364762BB6847A3DEAEFB0F43C7A68FF6260569E8FC8737B5C2249EC8D19AE6D49635B68655334FD4449CB9ECD01F8117BC8BEAAAE862A0553A39223F8577A6DFFEA7CD0F529D6CE73765543847C11F186F3C59DAA53EE0834AAEE X-8FC586DF: 6EFBBC1D9D64D975 X-C1DE0DAB: 9604B64F49C60606AD91A466A1DEF99B296C473AB1E14218C6CDE5D1141D2B1CF0FC9FF3B6FB18F8B62F654DF100F9914E0D557C2CE5D2C2AD91A466A1DEF99B296C473AB1E14218B936CB490224F2464EEA7BD89490CAC0EDDA962BC3F61961 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D345B8C2BEC800D102105B2D306657651155DD51C6BDE429FD4731FF4BF8A829D6F5D75E46D7A2C74EE1D7E09C32AA3244C4E9D76F06FB6C65519D23790CDCAEF2B853296C06374E602927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojhvrbUd41KJlBty6WaqckSQ== X-Mailru-Sender: 689FA8AB762F7393CC2E0F076E87284E9724906720A0257CC1DC4B0FCB4DC74CA7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E3365FEEDEB644C299C0ED14614B50AE0675 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] Fix FOLD rule for strength reduction of widening. X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Igor Munkin via Tarantool-patches Reply-To: Igor Munkin Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 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 > > 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 > > -- > 2.31.0 > -- Best regards, IM