8347794: RISC-V: Add Zfhmin - Float cleanup #23130
Open
+403
−233
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey, please consider.
I'm looking making RVA23 support complete and I was looking into adding Zfhmin.
I notice Zfh instructions didn't have any asserts checking if this extensions was enabled.
I then notice that we had the inferior instruction description using a funct7 instead of FMT + funct5.
We also had this same format repeated many times.
This patch takes all instructions format duplicates and replaces them with 'fp_base'.
fadd_s is thus described in code as:
fp_base<S_32_sp, 0b00000>(Rd, Rs1, Rs2, rm);
Instead of:
INSN(fadd_s, 0b1010011, 0b0000000);
It then moves zfh/zfhmin to a sepererate section and assert checks them.
Also as a bonus RoundingMode uses camel case while fclass_mask C, style.
So I changed fclass_mask to FClassBit, now thinking about it not sure if it should be bit or mask.
As in the context of the instruction fclass it is a bit, but when using the helpers e.g. zero it's a mask.
Tested:
jdk/java/lang/Math
jdk/java/util/Formatter/
jdk/java/lang/Float/
jdk/java/lang/Double/
hotspot/jtreg/compiler/floatingpoint/
hotspot/jtreg/compiler/c2/FloatingPointFoldingTest.java
hotspot/jtreg/compiler/eliminateAutobox/
hotspot/jtreg/vmTestbase/jit/
And tier1 twice, no FP issues. (Using UseZfh/min)
Thanks, Robbin
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/23130/head:pull/23130
$ git checkout pull/23130
Update a local copy of the PR:
$ git checkout pull/23130
$ git pull https://git.openjdk.org/jdk.git pull/23130/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 23130
View PR using the GUI difftool:
$ git pr show -t 23130
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/23130.diff
Using Webrev
Link to Webrev Comment