RFR: 8321003: RISC-V: C2 MulReductionVI [v5]

Fei Yang fyang at openjdk.org
Wed Feb 19 00:51:59 UTC 2025


On Tue, 18 Feb 2025 14:30:28 GMT, Hamlin Li <mli at openjdk.org> wrote:

>> src/hotspot/cpu/riscv/riscv_v.ad line 2494:
>> 
>>> 2492: 
>>> 2493: instruct reduce_mulF(fRegF dst, fRegF fsrc, vReg vsrc,
>>> 2494:                      vReg tmp1, vReg tmp2) %{
>> 
>> Seems to me that we need a `predicate(!n->as_Reduction()->requires_strict_order())` for all these newly-added floating-point reduce multiply matched rules. The reason is that your `reduce_mul_fp_v` doesn't respect the order of the operands. And we should better rename the name of the match rules to something like `unordered_reduce_mulF`.
>> 
>> Reference: https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/x86/x86.ad#L5281
>
> Yes, you're right, fixed. Thanks!

Thanks for the update. So now the FP reduce multiply will only apply to the Vector-API use case. Did you check the auto-vectorization use case? I suppose the two tests `ProdRed_Double.java` & `ProdRed_Float.java` which are enabled for riscv64 by this PR won't work with this update.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23580#discussion_r1960789839


More information about the hotspot-compiler-dev mailing list