On Tue, 19 Nov 2024 08:43:06 GMT, Jatin Bhateja <[email protected]> wrote:
>> src/hotspot/cpu/x86/x86.ad line 11015:
>>
>>> 11013: ins_encode %{
>>> 11014: int vlen_enc = vector_length_encoding(this);
>>> 11015: __ evfmadd132ph($dst$$XMMRegister, $src2$$XMMRegister,
>>> $src1$$XMMRegister, vlen_enc);
>>
>> Wondering if for auto vectorization the natural fma form is dst = dst + src1
>> * src2 i.e.
>> match(Set dst (FmaVHF dst (Binary src1 src2)));
>> which then leads to fmadd231.
>
> ISA supports multiple flavors, the current scheme is in line with the wiring
> of inputs done before matching.
You could save some reg/reg movs with 231 flavor.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21490#discussion_r1848290834