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 5AD61EE5752; Wed, 15 Jan 2025 16:11:39 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5AD61EE5752 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1736946699; bh=mMWYjn64hefxfGrx/BZf8YlzbDQvf72luJ97spvyTq4=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=dWxFhMJYDboc2hLmoRUDxgp3X1Bk08TquXfFCjOxlNhyUxUN+62VqLUcMlSmcdw2t /lSTQ0A/WKIA4bEO1RMB44oYag0dE+z9prJZ1yaLIOEy02BH81B0snp/O5S+aNZBRO 91D3dVv3X9tCPbkl3B/yv90V9BOiuA+qI8goO2og= Received: from send264.i.mail.ru (send264.i.mail.ru [95.163.59.103]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 6CAFFEE574B for ; Wed, 15 Jan 2025 16:11:38 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6CAFFEE574B Received: by exim-smtp-6758d5575c-6mlzf with esmtpa (envelope-from ) id 1tY3BJ-000000007HD-26Zf; Wed, 15 Jan 2025 16:11:37 +0300 Date: Wed, 15 Jan 2025 16:10:59 +0300 To: Sergey Bronnikov Cc: tarantool-patches Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9CAF828D4DCE9EB9524190862C3D49D72DE6D892D422B40E8182A05F538085040E0612E57C8AD5D513DE06ABAFEAF6705C95B7CF0843A16EAED8EBF7919461A62D5A0AF8C34EAAAE4 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7956F10FFCC7409BAEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637389D8DDD54F43F7A8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8353F15C729AF9A2D11E2DAC354A1AAA6840338F80FEC991ACC7F00164DA146DAFE8445B8C89999728AA50765F79006372A3B24BF85B2E607389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8ED96AA85C75E140D117882F4460429728AD0CFFFB425014E868A13BD56FB6657E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F7900637BC468E7E89D8C5D6EFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A5331D5F131086893F5002B1117B3ED69612E1BC7DCB4DE5093D2BBC1EF78EDEBE823CB91A9FED034534781492E4B8EEAD9DB614F8F96CFA30BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D346B222596F62B8FA99711BAEA4B4D3396E7B66215622B5DA98F719F5F60BF3861D88D0E3964EE8F211D7E09C32AA3244C08314F60DDC2A10477DD89D51EBB77421C6622199A7A8BCCEA455F16B58544A2E30DDF7C44BCB90DA5AE236DF995FB59829709634694AABAED6A17656DB59BCAD427812AF56FC65B X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojsala1BEF1WABhF+9eo/3ag== X-DA7885C5: D7D981F4580CB822F255D290C0D534F93FEE692D1DC7693300178703004929C48A7DDB48E82A7F1D5B1A4C17EAA7BC4BEF2421ABFA55128DAF83EF9164C44C7E X-Mailru-Sender: 689FA8AB762F739381B31377CF4CA21947CE0660B977561561AF8C761739D81AAC0C4484C5953AF1E49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 1/2] Cleanup CPU detection and tuning for old CPUs. 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: Sergey Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergey! Thanks for the review! Updated the commit message and force-pushed the branch. On 14.01.25, Sergey Bronnikov wrote: > Hi, Sergey, > > thanks for the patch! > > LGTM with a minor comment > > Sergey > > On 13.01.2025 18:17, Sergey Kaplun wrote: > > From: Mike Pall > > > > (cherry picked from commit 0eddcbead2d67c16dcd4039a6765b9d2fc8ea631) > > > > This patch does the following refactoring: > > 1) Drops optimizations for the Intel Atom CPU [1]: removes the > > `JIT_F_LEA_AGU` flag and related optimizations. The considerations > > for the use of LEA are complex and very CPU-specific, mostly > > dependent on the number of operands. Mostly, it isn't worth it due to > > the extra register pressure and/or extra instructions. > > I would say explicitly that `JIT_F_LEA_AGU` is used in "Well, yes, that > applies to the original and obsolete Atom architecture. Today "Intel > Atom" is just a trade name for reduced-performance implementations of > the current Intel architecture." > > as Mike explained in LUAJIT#24. So there are no any risks for tarantool > users > > regarding performance degradation. Added, as you suggested. The new commit message is the following: | Cleanup CPU detection and tuning for old CPUs. | | (cherry picked from commit 0eddcbead2d67c16dcd4039a6765b9d2fc8ea631) | | This patch does the following refactoring: | 1) Drops optimizations for the Intel Atom CPU [1]: removes the | `JIT_F_LEA_AGU` flag and related optimizations. The considerations | for the use of LEA are complex and very CPU-specific, mostly | dependent on the number of operands. Mostly, it isn't worth it due to | the extra register pressure and/or extra instructions. | Be aware that it applies to the original and obsolete Atom | architecture. Today "Intel Atom" is just a trade name for | reduced-performance implementations of the current Intel | architecture. | 2) Drops optimizations for the AMD K8, K10 CPU [2][3]: removes the | `JIT_F_PREFER_IMUL` flag and related optimizations. | 3) Refactors JIT flags defined in the . Now all CPU-specific | JIT flags are defined as the left shift of `JIT_F_CPU` instead of | hardcoded constants, similar for the optimization flags. | 4) Adds detection of the ARM8 CPU. | 5) Drops the check for SSE2 since the VM already presumes CPU supports | it. | 6) Adds checks for `__ARM_ARCH`[4] macro in . | 7) Drops outdated comment in the amalgamation file about memory | requirements. | | Sergey Kaplun: | * added the description for the patch | | [1]: https://en.wikipedia.org/wiki/Intel_Atom | [2]: https://en.wikipedia.org/wiki/AMD_K8 | [3]: https://en.wikipedia.org/wiki/AMD_K10 | [4]: https://developer.arm.com/documentation/dui0774/l/Other-Compiler-specific-Features/Predefined-macros | | Part of tarantool/tarantool#10709 > > > 2) Drops optimizations for the AMD K8, K10 CPU [2][3]: removes the > > `JIT_F_PREFER_IMUL` flag and related optimizations. > > 3) Refactors JIT flags defined in the . Now all CPU-specific > > JIT flags are defined as the left shift of `JIT_F_CPU` instead of > > hardcoded constants, similar for the optimization flags. > > 4) Adds detection of the ARM8 CPU. > > 5) Drops the check for SSE2 since the VM already presumes CPU supports > > it. > > 6) Adds checks for `__ARM_ARCH`[4] macro in . > > 7) Drops outdated comment in the amalgamation file about memory > > requirements. > > > > Sergey Kaplun: > > * added the description for the patch > > > > [1]:https://en.wikipedia.org/wiki/Intel_Atom > > [2]:https://en.wikipedia.org/wiki/AMD_K8 > > [3]:https://en.wikipedia.org/wiki/AMD_K10 > > [4]:https://developer.arm.com/documentation/dui0774/l/Other-Compiler-specific-Features/Predefined-macros > > > > Part of tarantool/tarantool#10709 > > --- -- Best regards, Sergey Kaplun