RFR: 8331558: AArch64: optimize integer remainder [v2]

Eric Liu eliu at openjdk.org
Wed May 8 03:30:52 UTC 2024


On Wed, 8 May 2024 02:16:32 GMT, Jin Guojie <duke at openjdk.org> wrote:

>> src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp line 462:
>> 
>>> 460:     if (VM_Version::supports_a53mac() && Ra != zr)
>>> 461:       nop();
>>> 462:     if (VM_Version::is_neoverse_n_series()) {
>> 
>> Why only Neoverse N series? Even on the V series (V1 and V2), both `sdiv/udiv` and `msub` instructions are executed in M0 unit (Integer multi cycle). It should benefit the V series as well. Source: https://developer.arm.com/documentation/pjdoc466751330-9685/latest/ and https://developer.arm.com/documentation/PJDOC-466751330-593177/latest/
>> 
>> A quick run on a V1 machine shows ~15% performance gain for the `IntegerDivMod` tests if we generate separate `mul` and `sub` instructions instead of a single `msub`.
>
> Thanks for your review.
> This new commit includes the support for V1/V2 you mentioned.
> 
> https://github.com/openjdk/jdk/pull/19093/commits/d8b8dbfe102d2716ef9e332aec7c52e566bf1727

> Why only Neoverse N series? Even on the V series (V1 and V2), both `sdiv/udiv` and `msub` instructions are executed in M0 unit (Integer multi cycle). It should benefit the V series as well. Source: https://developer.arm.com/documentation/pjdoc466751330-9685/latest/ and https://developer.arm.com/documentation/PJDOC-466751330-593177/latest/
> 
> A quick run on a V1 machine shows ~15% performance gain for the `IntegerDivMod` tests if we generate separate `mul` and `sub` instructions instead of a single `msub`.

Not sure if this can benefit V3, since MSUB can use M rather M0.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/19093#discussion_r1593337735


More information about the hotspot-dev mailing list