RFR: 8357695: RISC-V: Move vector intrinsic condition checks into match_rule_supported_vector [v3]

Dingli Zhang dzhang at openjdk.org
Tue May 27 04:27:46 UTC 2025


On Tue, 27 May 2025 03:48:58 GMT, Fei Yang <fyang at openjdk.org> wrote:

>> Dingli Zhang has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Merge Op_RoundVF and Op_RoundVD
>
> src/hotspot/cpu/riscv/riscv_v.ad line 127:
> 
>> 125:       case Op_FmaVF:
>> 126:       case Op_FmaVD:
>> 127:         return UseRVV && UseFMA;
> 
> Since `UseRVV` flag has already been checked on function entry at L58, the `UseRVV` check here could be removed.
> Similar for case `Op_RoundVF` and case `Op_RoundVD`.

Thanks for review! Fixed.

> src/hotspot/cpu/riscv/riscv_v.ad line 132:
> 
>> 130:       // regression when MaxVectorSize == 16. So only enable the intrinsic when MaxVectorSize >= 32.
>> 131:       case Op_RoundVF:
>> 132:         return UseRVV && MaxVectorSize >= 32;
> 
> Could we use the input vector length `vlen` to do the check? Maybe `return vlen >= 8;` will do.

Fixed.

> src/hotspot/cpu/riscv/riscv_v.ad line 139:
> 
>> 137:       // regression for double when MaxVectorSize == 64+. So only enable the intrinsic when MaxVectorSize >= 64.
>> 138:       case Op_RoundVD:
>> 139:         return UseRVV && MaxVectorSize >= 64;
> 
> Simiar here. Maybe `return vlen >= 8;` will do.

Fixed.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25438#discussion_r2108131681
PR Review Comment: https://git.openjdk.org/jdk/pull/25438#discussion_r2108131728
PR Review Comment: https://git.openjdk.org/jdk/pull/25438#discussion_r2108131755


More information about the hotspot-compiler-dev mailing list