Skip to content

Conversation

@robehn
Copy link
Contributor

@robehn robehn commented Jan 15, 2025

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

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8347794: RISC-V: Add Zfhmin - Float cleanup (Enhancement - P4)

Reviewers

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

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 15, 2025

👋 Welcome back rehn! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jan 15, 2025

@robehn This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8347794: RISC-V: Add Zfhmin - Float cleanup

Reviewed-by: fyang, mli

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 1 new commit pushed to the master branch:

  • f54e0bf: 8345766: C2 should emit macro nodes for ModF/ModD instead of calls during parsing

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 15, 2025
@openjdk
Copy link

openjdk bot commented Jan 15, 2025

@robehn The following label will be automatically applied to this pull request:

  • hotspot

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot hotspot-dev@openjdk.org label Jan 15, 2025
@mlbridge
Copy link

mlbridge bot commented Jan 15, 2025

Webrevs

Copy link
Member

@RealFYang RealFYang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making this cleanup! I only have one minor comment.

@robehn
Copy link
Contributor Author

robehn commented Jan 20, 2025

Thanks for making this cleanup! I only have one minor comment.

Thanks!

Copy link
Member

@RealFYang RealFYang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 20, 2025
@robehn
Copy link
Contributor Author

robehn commented Jan 20, 2025

Looks good to me.

Thank you!

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Jan 20, 2025
Copy link
Member

@RealFYang RealFYang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update. One minor question remain.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 21, 2025
@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Jan 21, 2025
@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 21, 2025
Copy link

@Hamlin-Li Hamlin-Li left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@robehn
Copy link
Contributor Author

robehn commented Jan 21, 2025

Looks good.

Thank you!

@robehn
Copy link
Contributor Author

robehn commented Jan 22, 2025

Thanks guys!

/integrate

@openjdk
Copy link

openjdk bot commented Jan 22, 2025

Going to push as commit fb43849.
Since your change was applied there have been 21 commits pushed to the master branch:

  • 9b98cc0: 8348182: Remove DONT_USE_PRECOMPILED_HEADER
  • d777218: 8346830: Simplify adlc build config for aix
  • 15d6469: 8347817: Timeouts running test/jdk/java/lang/String/concat/HiddenClassUnloading.java with fastdebug builds
  • 3c2a1d8: 8348117: The two-argument overload of SignatureHandlerLibrary::add is not used
  • 8458f88: 8347475: GTK: javax/swing/JColorChooser/Test8152419.java there are no swatches or RGB tab in JColorChooser
  • 7a6ff92: 8345543: Test serviceability/jvmti/vthread/StopThreadTest/StopThreadTest.java failed: expected JVMTI_ERROR_OPAQUE_FRAME instead of: 0
  • bbd8807: 8338428: Add logging of final VM flags while setting properties
  • c38417a: 8348186: C1: Purge fpu_stack_size infrastructure
  • f2a9d26: 8347740: java/io/File/createTempFile/SpecialTempFile.java failing
  • 25fecaa: 8348039: testmake fails at IDEA after JDK-8347825
  • ... and 11 more: https://git.openjdk.org/jdk/compare/0f426e4a6d38423f4945d993e440ee62a7d59e7f...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jan 22, 2025
@openjdk openjdk bot closed this Jan 22, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jan 22, 2025
@openjdk
Copy link

openjdk bot commented Jan 22, 2025

@robehn Pushed as commit fb43849.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@robehn robehn deleted the zfhmin branch January 28, 2025 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants