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 1E022215DEA; Thu, 30 Mar 2023 20:45:00 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 1E022215DEA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1680198300; bh=KIfPMT/cNLCBviG7TxM7Zm9Xujlg4HkzqnKmIDtjhbY=; 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=a/RPG9eIJFxS0uHuHBMA980cxysKmNkPQpGf5Ejgb+oQRSAWuNun6OyPPCDWn3lej kq76uEslFPolXLr+GzUxCHJcFkauoufUlGp24wUbddVNjXJyS6OShBgcAv8laihCPS FtAtXSxrtbdiM1jT+A8CYEYlOKK+TkEL3Zs/+5jM= Received: from smtp16.i.mail.ru (smtp16.i.mail.ru [95.163.41.69]) (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 E8673215DEA for ; Thu, 30 Mar 2023 20:44:40 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E8673215DEA Received: by smtp16.i.mail.ru with esmtpa (envelope-from ) id 1phwKF-00G653-Tz; Thu, 30 Mar 2023 20:44:40 +0300 Date: Thu, 30 Mar 2023 17:37:25 +0000 To: Maksim Kokryashkin Message-ID: References: <20230208200550.48291-1-max.kokryashkin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230208200550.48291-1-max.kokryashkin@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett X-Mailru-Src: smtp X-7564579A: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD9F8F06A4ADC2A029ED392DF46D9BBD91993351BDDA8FBAA571313CFAB8367EF908E2BE116634AD74D452F07C5ACFDE89DB0C1EF2380467B9361083FF6DCA8A41555B84A25CBF950A9 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE73F300A97FDD4E158EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063729381D024F10DD158638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8BF95EF41E79EE05AA9B95225EAB6809E117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC2BE06DBDC430765AA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F4460429728776938767073520CCD848CCB6FE560CCB629EEF1311BF91D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EED76C6ED7039589DE03CEA74F0D118906D8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE367F1C1C3ABB44F3A6E0066C2D8992A16C4224003CC836476E2F48590F00D11D6E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F790063747074E5DE1517656EFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A5B0085B67179196BBD1AB6342A5BB1557EB4D71A37B8E96C2F87CCE6106E1FC07E67D4AC08A07B9B0DB8A315C1FF4794DBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742DC8270968E61249B1004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D3472E5ECC12A9739C114E34A2688EC23C057288A917E5A7C1C7A55D8E2DDF825AB134367B2C2EFCC171D7E09C32AA3244CCF128CCC66132550E98754F761F61647858039643087248083B48618A63566E0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojiHgmeVjUOtL5ddLlouLyjA== X-Mailru-Sender: 2FEBA92C8E508479FE7B9A1DF348D53155CFAF2723FD49F9D5694D0B0F05DEEEF0438378444612742326FE6F2A341ACE0FB9F97486540B4CD9E8847AB8CFED4D9ABF8A61C016C2CFB0DAF586E7D11B3E67EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit v8] Fix math.min()/math.max() inconsistencies. 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, 2.11 and 2.10. On 08.02.23, Maksim Kokryashkin via Tarantool-patches wrote: > From: Mike Pall > > (cherry-picked from commit 03208c8162af9cc01ca76ee1676ca79e5abe9b60) > > `math.min()`/`math.max()` could produce different results. > Previously, dirty values on the Lua stack could be > treated as arguments to `math.min()`/`math.max()`. > This patch adds check for the number of arguments provided to > math.min/max, which fixes the issue. > > Also, several fold optimizations were modified or > deleted due to inconsistencies between compiler > and interpreter on NaN-values. > > Changes in `fold_kfold_numarith()` also required > to replace the `CC_LO/CC_HI` comparison modes with the `CC_LE/CC_PL` > on aarch64 platforms. The issue is thoroughly described just before > the corresponding test. > > Changes for MIPS and PPC architectures are ommited, due to the > absence of other patches the are dependent on. > > Maxim Kokryashkin & Sergey Kaplun: > * added the description and tests for the problem > > Resolves tarantool/tarantool#6163 > --- > Changes in v8: > - Fixed comments as per review by Sergey > > Branch: https://github.com/tarantool/luajit/tree/fckxorg/gh-6163-min-max > PR: https://github.com/tarantool/tarantool/pull/7455 > Issue for x86 misbehavior: https://github.com/LuaJIT/LuaJIT/issues/957 > src/lj_asm_arm.h | 6 +- > src/lj_asm_arm64.h | 6 +- > src/lj_opt_fold.c | 53 ++-- > src/lj_vmmath.c | 4 +- > src/vm_arm.dasc | 4 +- > src/vm_arm64.dasc | 4 +- > src/vm_x64.dasc | 2 +- > src/vm_x86.dasc | 2 +- > test/tarantool-tests/gh-6163-min-max.test.lua | 263 ++++++++++++++++++ > 9 files changed, 296 insertions(+), 48 deletions(-) > create mode 100644 test/tarantool-tests/gh-6163-min-max.test.lua > > -- > 2.37.1 (Apple Git-137.1) > -- Best regards, IM