RFR: 8347981: RISC-V: Add Zfa zli imm loads [v3]
Fei Yang
fyang at openjdk.org
Thu Jan 23 06:03:54 UTC 2025
On Wed, 22 Jan 2025 14:29:13 GMT, Robbin Ehn <rehn at openjdk.org> wrote:
>> Hi, please consider!
>>
>> This patch the Zfa zli floating point immediate load.
>> As a bonus it adds fmv_?_x(Rd, zr); for loading fp/dp 0x0.
>> There are some more instruction in Zfa, but this was such a clear use-case so I only did fli as a start.
>>
>> When using one of the 32 'popular' floats we can now materialze them without a load.
>> E.g.
>> `float f = f1 * 0.5 + f2 * 2.0;`
>> Only require 2 loads instead of 4: as '0.5' and '2.0' is such popular float values.
>>
>> As Java is often memory bound we should also investigate doing lui+ssli+fmv for float/doubles instead of a load when materializing.
>>
>> Note the _fli_s/_fli_d will be proper merged on the 8347794: RISC-V: Add Zfhmin - Float cleanup.
>>
>> Passes:
>> ./test/jdk/java/lang/Math
>> ./test/hotspot/jtreg/compiler/floatingpoint/
>> ./test/jdk/java/util/Formatter/
>> ./test/jdk/java/lang/Float/
>> ./test/jdk/java/lang/Double/
>> ./test/hotspot/jtreg/compiler/c2/FloatingPointFoldingTest.java
>> ./test/hotspot/jtreg/compiler/eliminateAutobox/
>> ./test/hotspot/jtreg/vmTestbase/jit/
>>
>> Running tier1
>>
>> Thanks!
>
> Robbin Ehn has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits:
>
> - Merge branch 'master' into zfa
> - Merge branch 'master' into zfa
> - EXPERIMENTAL
> - Merge branch 'master' into zfa
> - Merge branch 'master' into zfa
> - Flip bool static decl
> - Merge branch 'master' into zfa
> - Baseline
Thanks for the update. Seems fine to me modulo one minor comment.
src/hotspot/cpu/riscv/vm_version_riscv.hpp line 160:
> 158: decl(ext_Zbs , "Zbs" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZbs)) \
> 159: decl(ext_Zcb , "Zcb" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZcb)) \
> 160: decl(ext_Zfa , "Zfa" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZfa)) \
Are we auto-enabling an experimental feature?
-------------
PR Review: https://git.openjdk.org/jdk/pull/23171#pullrequestreview-2568931169
PR Review Comment: https://git.openjdk.org/jdk/pull/23171#discussion_r1926407162
More information about the hotspot-dev
mailing list