From: Sergey Kaplun via Tarantool-patches <tarantool-patches@dev.tarantool.org> To: Sergey Bronnikov <sergeyb@tarantool.org> Cc: tarantool-patches <tarantool-patches@dev.tarantool.org> Subject: Re: [Tarantool-patches] [PATCH luajit 1/2] Cleanup CPU detection and tuning for old CPUs. Date: Wed, 15 Jan 2025 16:10:59 +0300 [thread overview] Message-ID: <Z4ez42ClQCy-8UGE@root> (raw) In-Reply-To: <e24d7377-665b-45e7-99d6-6a58f2cfc714@tarantool.org> 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 <mike> > > > > (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 <lj_jit.h>. 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 <lj_arch.h>. | 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 <lj_jit.h>. 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 <lj_arch.h>. > > 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 > > --- <snipped> -- Best regards, Sergey Kaplun
next prev parent reply other threads:[~2025-01-15 13:11 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2025-01-14 11:06 [Tarantool-patches] [PATCH luajit 0/2] Refactoring and FMA optimizations Sergey Kaplun via Tarantool-patches 2025-01-14 11:06 ` [Tarantool-patches] [PATCH luajit 1/2] Cleanup CPU detection and tuning for old CPUs Sergey Kaplun via Tarantool-patches 2025-01-14 11:25 ` Sergey Bronnikov via Tarantool-patches 2025-01-15 13:10 ` Sergey Kaplun via Tarantool-patches [this message] 2025-01-14 11:06 ` [Tarantool-patches] [PATCH luajit 2/2] Disable FMA by default. Use -Ofma or jit.opt.start("+fma") to enable Sergey Kaplun via Tarantool-patches 2025-01-14 12:45 ` Sergey Bronnikov via Tarantool-patches 2025-01-15 13:06 ` Sergey Kaplun via Tarantool-patches
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=Z4ez42ClQCy-8UGE@root \ --to=tarantool-patches@dev.tarantool.org \ --cc=sergeyb@tarantool.org \ --cc=skaplun@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH luajit 1/2] Cleanup CPU detection and tuning for old CPUs.' \ /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