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 6770E4F62BD; Tue, 4 Jul 2023 20:19:37 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6770E4F62BD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1688491177; bh=35PI+MbcYBudAe/k0J++AvTuZnr7/vkdqwWkaBfea5k=; 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=FffqPVXKs73eTuC0qTVV7SrD2TissBkK7Ic0d+0b2vokxLy8hyHnGrz2fy4mxDoa2 9GkDGXQQkd9EnvLMoPNH9d4djEF+fu1Dx6smCXQSbkL32/EDQ++eaELnHomAmNE7NQ k8WU5SJj/MijOlx29/CNbwcaRYB+kpYYhlR1t1lk= Received: from smtp45.i.mail.ru (smtp45.i.mail.ru [95.163.41.83]) (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 CC24B4F314A for ; Tue, 4 Jul 2023 20:18:37 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org CC24B4F314A Received: by smtp45.i.mail.ru with esmtpa (envelope-from ) id 1qGjfg-002sTJ-Sy; Tue, 04 Jul 2023 20:18:37 +0300 Date: Tue, 4 Jul 2023 17:09:45 +0000 To: Maxim Kokryashkin Message-ID: References: <20230613124237.2520-1-m.kokryashkin@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230613124237.2520-1-m.kokryashkin@tarantool.org> X-Clacks-Overhead: GNU Terry Pratchett X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD90EBD74C6BAAC9DBAE9A61822823A68649EFBB1BF04C9EBAE182A05F538085040F2B7D039DA821636BD56A782FAEA02514E029EDBCE6C912E6C94C7F258BF9856 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE72E4E5201E1C2E308EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006376EC5B14D896A2D978638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8A947EB9DB75E6097DDBFE50D8B912CDD117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCAA867293B0326636D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8B0E007FA4003F52FEA471835C12D1D977C4224003CC836476EB9C41850244470149FD398EE364050F0AC5B80A05675ACD4D0DA9BD313A0613B3661434B16C20ACC84D3B47A649675FE827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8B2303E78B907142AC75ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A5C337491A736C6042F29C3B33AB07FB4B4AC914ACE363F4E6F87CCE6106E1FC07E67D4AC08A07B9B06A1CB4668A9CA5FACB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D346B1FF97F6D0959A20B571E8B33A66A3B67F8A4F5009F3BCEFA095FB3B7FA82CE4CC36B403AC015DE1D7E09C32AA3244C20889DEC30E857FE262575674B86BDFED08D48398F32B4A6BAD658CF5C8AB4025DA084F8E80FEBD376A4ED3E9341DC2FCD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojtu6fghEd2rUC73EjQAvfsA== X-Mailru-Sender: 2FEBA92C8E508479FE7B9A1DF348D531DE778E16EE5854745DAFEFA9411C5AA6520D52D5CF215F1E2326FE6F2A341ACE0FB9F97486540B4CD9E8847AB8CFED4D9ABF8A61C016C2CFB0DAF586E7D11B3E67EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit v2] x64: Fix 64 bit shift code generation. 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" 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 > > 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 > > -- > 2.40.1 > -- Best regards, IM