RFR: 8322770: Implement C2 VectorizedHashCode on AArch64 [v20]
Andrew Haley
aph at openjdk.org
Fri Sep 27 14:52:42 UTC 2024
On Fri, 27 Sep 2024 13:36:06 GMT, Mikhail Ablakatov <duke at openjdk.org> wrote:
>> src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp line 5456:
>>
>>> 5454: } else {
>>> 5455: __ uaddwv2(vmul0, vmul0, Assembler::T4S, vdata0, Assembler::T8H);
>>> 5456: }
>>
>> Maybe define `addwv2` and `addwv` in MacroAssembler.
>> Suggestion:
>>
>> __ addwv2(is_signed_subword_type(eltype), vmul0, vmul0, Assembler::T4S, vdata0, Assembler::T8H);
>
> I believe that an interface should be explicit and map 1:1 to real instructions when it comes to assembly whereas possible.
>
> Anyway, regardless of my preferences, as far as I can see, currently `Assembler` provides all other signed/unsigned versions of arithmetic instructions separately. Adding a single method like this would make the whole API inconsistent. Therefore, I suggest leaving it as is.
I have no problem at all with what class Assembler provides. However, when the result looks like this, even a "normal" assembler programmer would suggest macros rather than copy-and-paste:
assert(is_subword_type(eltype), "subword type expected");
if (is_signed_subword_type(eltype)) {
__ saddwv(vmul3, vmul3, Assembler::T4S, vdata3, Assembler::T4H);
__ saddwv(vmul2, vmul2, Assembler::T4S, vdata2, Assembler::T4H);
__ saddwv(vmul1, vmul1, Assembler::T4S, vdata1, Assembler::T4H);
__ saddwv(vmul0, vmul0, Assembler::T4S, vdata0, Assembler::T4H);
} else {
__ uaddwv(vmul3, vmul3, Assembler::T4S, vdata3, Assembler::T4H);
__ uaddwv(vmul2, vmul2, Assembler::T4S, vdata2, Assembler::T4H);
__ uaddwv(vmul1, vmul1, Assembler::T4S, vdata1, Assembler::T4H);
__ uaddwv(vmul0, vmul0, Assembler::T4S, vdata0, Assembler::T4H);
}
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18487#discussion_r1778746689
More information about the hotspot-dev
mailing list