RFR: 8296447: RISC-V: Make the operands order of vrsub_vx/vrsub_vi consistent with RVV 1.0 spec [v2]

Ludovic Henry luhenry at openjdk.org
Mon Nov 7 07:39:26 UTC 2022


On Mon, 7 Nov 2022 06:05:16 GMT, Dingli Zhang <dzhang at openjdk.org> wrote:

>> Hi,
>> 
>> At the moment, the operands order of `vrsub_vx` and ` vrsub_vi` is not the same as in the RVV1.0 spec[1]. These instructions use the wrong assembly syntax pattern for vector binary arithmetic instructions (multiply-add)[2].
>> 
>>  `vrsub_vx` was classified as `Vector Single-Width Integer Add and Subtract` in rvv1.0 spec, but is currently classified as `Vector Single-Width Integer Multiply-Add Instructions` and generate the functions under the corresponding macros, which results in the reverse order of the operands `Vs2` and `Rs1` compared to the spec.
>> 
>>  `vrsub_vi` has its own separate macro definition to generate the corresponding function and the order of these operands(`Vs2` and `imm`) is reversed too.
>> 
>> I think it is better to adjust the operands order of these two instructions to be consistent with the spec.
>> 
>> Please take a look and have some reviews. Thanks a lot.
>> 
>> 
>> [1] https://github.com/riscv/riscv-v-spec/blob/v1.0/v-spec.adoc
>> [2] https://github.com/riscv/riscv-v-spec/blob/v1.0/v-spec.adoc#101-vector-arithmetic-instruction-encoding
>> 
>> ## Testing:
>> 
>> - hotspot and jdk tier1 on unmatched board without new failures
>> - test/jdk/jdk/incubator/vector/Int256VectorTests.java with fastdebug on qemu
>> - test/jdk/jdk/incubator/vector/Long256VectorTests.java with fastdebug on qemu
>
> Dingli Zhang has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Remove duplicate macro definition

I also verified it matches with https://github.com/riscv/riscv-opcodes/blob/master/rv_v

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

Marked as reviewed by luhenry (Author).

PR: https://git.openjdk.org/jdk/pull/11009


More information about the hotspot-dev mailing list