Skip to content

Conversation

@shipilev
Copy link
Member

@shipilev shipilev commented Mar 27, 2025

C1 has the 32-bit x86 specific code that supports x87 FPU stack allocations. With 32-bit x86 port removed, we can clean up those parts. 64-bit x86 does not need x87 FPU, since it is baselined on SSE2 and using XMM registers instead.

There are lots of deeper cleanups possible, this PR focuses on removing the x87 FPU allocation/uses in C1. Note current C1 nomenclature is confusing. On all arches, "FPU" means floating-point registers. That is except on x86, where "FPU" means x87 FPU stack, and "XMM" means floating-point registers. This is why we only touch "FPU" code on other architectures only in a light manner. After all 32-bit x86 cleanups land, we might consider renaming "XMM" -> "FPU" in x86 C1 to match the common nomenclature.

Brief tour of changes:

  • FPU stack simulator is not needed anymore, so I removed it and the related infrastructure
  • Lots of 32-bit specific paths that touch x87 FPU registers are pruned
  • Related LIR nodes like lir_fxch, lir_fld, lir_fpop_raw are pruned
  • Simplified the API that is no longer needed, e.g. dropping pop_fpu_stack

This PR would likely conflict with some in-flight cleanups, so it would require merges later. Take a look meanwhile.

Additional testing:

  • Linux x86_64 server fastdebug, tier1
  • Linux x86_64 server fastdebug, tier1 + -XX:TieredStopAtLevel=1
  • Linux x86_64 server fastdebug, all
  • Linux x86_64 server fastdebug, all + -XX:TieredStopAtLevel=1

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-8351156: C1: Remove FPU stack support after 32-bit x86 removal (Sub-task - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/24274/head:pull/24274
$ git checkout pull/24274

Update a local copy of the PR:
$ git checkout pull/24274
$ git pull https://git.openjdk.org/jdk.git pull/24274/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 24274

View PR using the GUI difftool:
$ git pr show -t 24274

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/24274.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 27, 2025

👋 Welcome back shade! 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 Mar 27, 2025

@shipilev 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:

8351156: C1: Remove FPU stack support after 32-bit x86 removal

Reviewed-by: vlivanov, kvn

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 16 new commits pushed to 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
Copy link

openjdk bot commented Mar 27, 2025

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

  • hotspot-compiler

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.

@shipilev shipilev marked this pull request as ready for review March 27, 2025 12:25
@openjdk openjdk bot added the rfr Pull request is ready for review label Mar 27, 2025
@mlbridge
Copy link

mlbridge bot commented Mar 27, 2025

Webrevs

@vnkozlov
Copy link
Contributor

On all arches, "FPU" means floating-point registers.

Which is wrong I think. It should be "FPR". May be file RFE to rename LIR_Opr::is_*_fpu() methods to LIR_Opr::is_*_fpr()

@shipilev
Copy link
Member Author

Which is wrong I think. It should be "FPR". May be file RFE to rename LIR_Opr::is_*_fpu() methods to LIR_Opr::is_*_fpr()

Yes, that would be more accurate. Remains to be seen how intrusive is this rename.

@openjdk
Copy link

openjdk bot commented Mar 27, 2025

@shipilev this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout JDK-8351156-x86-c1-fpustack
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added the merge-conflict Pull request has merge conflict with target branch label Mar 27, 2025
@openjdk openjdk bot removed the merge-conflict Pull request has merge conflict with target branch label Mar 27, 2025
Copy link
Contributor

@iwanowww iwanowww 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.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Mar 27, 2025
@shipilev
Copy link
Member Author

Are you still good with this, @vnkozlov? I would like to integrate it sooner to unblock some dependent cleanup work.

Copy link
Contributor

@vnkozlov vnkozlov left a comment

Choose a reason for hiding this comment

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

Good.

@shipilev
Copy link
Member Author

Thank you! Here we go.

/integrate

@openjdk
Copy link

openjdk bot commented Mar 31, 2025

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

  • 2592513: 8350577: Fix missing Assertion Predicates when splitting loops
  • 59629f8: 8351040: [REDO] Protection zone for easier detection of accidental zero-nKlass use
  • 8cbadf7: 8317976: Optimize SIMD sort for AMD Zen 4
  • b9d7a75: 8352879: TestPeriod.java and TestGetContentType.java run wrong test class
  • 895aabc: 8351233: [ASAN] avx2-emu-funcs.hpp:151:20: error: ‘D.82188’ is used uninitialized
  • 3d2c3cd: 8352970: Remove unnecessary Windows version check in Win32ShellFolderManager2
  • c70ad6a: 8352906: stdout/err.encoding on Windows set by incorrect Win32 call
  • da3bb06: 8352685: Opensource JInternalFrame tests - series2
  • d809033: 8341775: Duplicate manifest files are removed by jarsigner after signing
  • a269bef: 8350459: MontgomeryIntegerPolynomialP256 multiply intrinsic with AVX2 on x86_64
  • ... and 12 more: https://git.openjdk.org/jdk/compare/b73663a2b4fe7049fc0990c1a1e51221640b4e29...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Mar 31, 2025

@shipilev Pushed as commit 23e3b3f.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot-compiler [email protected] integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants