RFR: 8343689: AArch64: Optimize MulReduction implementation [v8]
Mikhail Ablakatov
mablakatov at openjdk.org
Thu Aug 14 14:01:16 UTC 2025
On Wed, 13 Aug 2025 12:18:54 GMT, Andrew Haley <aph at openjdk.org> wrote:
>>> Please try to organize things the same way as the Decode section of the ARM.
>>
>> Do you refer to *C4: A64 Instruction Set Encoding*?
>>
>>> Insert a new section called SVE Integer Misc - Unpredicated after SVE bitwise shift by immediate (predicated) and put this pattern there.
>>
>> I assume you might have misinterpreted **predicated** SVE bitwise shift for **unpredicated**.
>>
>> In the *C4: A64 Instruction Set Encoding*, *C4.1.41 SVE Integer Misc - Unpredicated* follows *C4.1.40 SVE Bitwise Shift - Unpredicated* which is not implemented by `src/hotspot/cpu/aarch64/assembler_aarch64.hpp` as far as I can tell. Suggested *SVE bitwise shift by immediate (predicated)* falls into *C4.1.34 SVE Bitwise Shift - Predicated*. If this change is to follow the ordering in *C4: A64 Instruction Set Encoding*, the next proceeding implemented instruction class for `sve_movprfx` (from *C4.1.41*) should be [SVE stack frame adjustment](https://github.com/openjdk/jdk/pull/23181/files/4593a5d717024df01769625993c2b769d8dde311#diff-203c5bbfa5307b5cc529c80acf90e764260db018ed658b949421f91190c56982L3686) which falls into *C4.1.38 SVE Stack Allocation*. The next following implemented instruction class should be [SVE element count](https://github.com/openjdk/jdk/pull/23181/files/4593a5d717024df01769625993c2b769d8dde311#diff-203c5bbfa5307b5cc529c80acf90e764260db018ed658b949421f91190c5
6982L4067) (inconveniently named something else in the source file) which falls into *C4.1.42 SVE Element Count*. The two instruction classes doesn't follow each other in the file, unfortunately, so it's one or the other. Currently it's the latter.
>
>> I assume you might have misinterpreted **predicated** SVE bitwise shift for **unpredicated**.
>
> It's possible. The point is to make sure that any new instruction is in a section corresponding to its section in hte Decoding tables. Please make your best guess as to where that should be, and we'll discuss it.
To (at least partially) conform to the ordering in *C4: A64 Instruction Set Encoding*, it should be placed either right after [SVE stack frame adjustment](https://github.com/openjdk/jdk/pull/23181/files/4593a5d717024df01769625993c2b769d8dde311#diff-203c5bbfa5307b5cc529c80acf90e764260db018ed658b949421f91190c56982L3686) or right before [SVE element count](https://github.com/openjdk/jdk/pull/23181/files/4593a5d717024df01769625993c2b769d8dde311#diff-203c5bbfa5307b5cc529c80acf90e764260db018ed658b949421f91190c56982L4067) as described above. The patch does the latter.
I've started the section, please check https://github.com/openjdk/jdk/pull/23181/commits/4aed1f65e5c392c18b62d5a79b75dc3ae2cff5f6 and resolve the thread if you find it suitable.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23181#discussion_r2276718110
More information about the hotspot-compiler-dev
mailing list