RFR: 8331558: AArch64: optimize integer remainder [v2]
Andrew Haley
aph at openjdk.org
Wed May 8 09:32:54 UTC 2024
On Wed, 8 May 2024 08:44:21 GMT, Bhavana Kilambi <bkilambi at openjdk.org> wrote:
>>> 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 than M0.
>
> Agreed. MSUB can use either M0/M1 in case of V3. Also N3 is the same as N1/N2, so that's ok. I think the changes made right now, might be ok for the currently available N/V series but when support is added in the JDK for the next versions (like N3, V3, ... Nx, Vx) then these changes may or may not be applicable. It might be better to either test for specific cpu's instead of checking for "neoverse_family" (because when V3 support is added and is included in the neoverse_family, then this check will have to be modified) or have a separate method which tests if the given CPU matches N1,N2,V1,V2. In the future, it's just a matter of adding more versions to this method as and when applicable.
And it might also be that separate mul/sub neither helps nor hurts V3. Let's not over-engineer this patch.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19093#discussion_r1593731708
More information about the hotspot-dev
mailing list