Navigation Menu

Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

8269879: [PPC64] C2: Math.rint intrinsic uses wrong rounding mode #215

Closed
wants to merge 1 commit into from
Closed

8269879: [PPC64] C2: Math.rint intrinsic uses wrong rounding mode #215

wants to merge 1 commit into from

Conversation

TheRealMDoerr
Copy link
Contributor

@TheRealMDoerr TheRealMDoerr commented Jul 5, 2021

We need to replace the frin and xvrdpi instructions which use a wrong rounding mode. xvrdpic is available with Power7. We can simply switch off RoundDoubleMode intrinsics for older processors (which are outdated).
Note that xvrdpic requires RN=0b00 to use the correct rounding mode. These 2 bits are 0 by default (see "Registers Specified during Process Initialization" in [1]) and are treated as "Limited-Access Bits" (see "2.2.1.2. Limited-Access Bits" in [1] for preservation rules).

[1] "64-Bit ELF V2 ABI Specification" http://cdn.openpowerfoundation.org/wp-content/uploads/resources/leabi/leabi-20170510.pdf


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8269879: [PPC64] C2: Math.rint intrinsic uses wrong rounding mode

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk17 pull/215/head:pull/215
$ git checkout pull/215

Update a local copy of the PR:
$ git checkout pull/215
$ git pull https://git.openjdk.java.net/jdk17 pull/215/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 215

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk17/pull/215.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 5, 2021

👋 Welcome back mdoerr! 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 openjdk bot added the rfr Pull request is ready for review label Jul 5, 2021
@openjdk
Copy link

openjdk bot commented Jul 5, 2021

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

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.java.net label Jul 5, 2021
@mlbridge
Copy link

mlbridge bot commented Jul 5, 2021

Webrevs

Copy link
Contributor

@RealLucy RealLucy left a comment

Choose a reason for hiding this comment

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

The changes look good so far.

You are mentioning that the now used instruction is available from Power7 and that for older versions of the Power spec, the intrinsic should be disabled. I am missing such a change, probably in vm_version_ppc.cpp.

Furthermore, you mention that the instruction needs a special (non-default) setting of the rounding mode control flags. How can such flag setting be assured?
Thanks, Lutz

@TheRealMDoerr
Copy link
Contributor Author

The changes look good so far.

Thanks!

You are mentioning that the now used instruction is available from Power7 and that for older versions of the Power spec, the intrinsic should be disabled. I am missing such a change, probably in vm_version_ppc.cpp.

See change in Matcher::match_rule_supported(int opcode).

Furthermore, you mention that the instruction needs a special (non-default) setting of the rounding mode control flags. How can such flag setting be assured?

No, it's the default setting (see referenced ABI chapters).

Copy link
Contributor

@RealLucy RealLucy 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 your clarification! My "prefabricated" opinion blurred the sights on reality. All fine!

@openjdk
Copy link

openjdk bot commented Jul 6, 2021

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

8269879: [PPC64] C2: Math.rint intrinsic uses wrong rounding mode

Reviewed-by: lucy, goetz

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 2 new commits pushed to the master branch:

  • 6d8fc72: 8268883: C2: assert(false) failed: unscheduable graph
  • 4ad8b04: 8268369: SIGSEGV in PhaseCFG::implicit_null_check due to missing null check

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 ready Pull request is ready to be integrated label Jul 6, 2021
Copy link
Member

@GoeLin GoeLin left a comment

Choose a reason for hiding this comment

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

LGTM

@TheRealMDoerr
Copy link
Contributor Author

Thanks for the reviews!
/integrate

@openjdk
Copy link

openjdk bot commented Jul 7, 2021

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

  • 7fcd5ca: 8266036: class file for sun.misc.Contended not found
  • a49b1dc: 8269772: [macos-aarch64] test compilation failed with "SocketException: No buffer space available"
  • 820f290: 8268859: jshell throws exception while parsing illegal "case true"
  • 815e4af: 8269802: javac fails to compile nested pattern matching switches
  • 2daf39a: 8269830: SA's vm object vtable matching code sometimes matches on incorrect type
  • 0ebf8aa: 8268778: CDS check_excluded_classes needs DumpTimeTable_lock
  • 0d1cd3a: 8269825: [TESTBUG] Missing testing for x86 KNL platforms
  • e0c130f: 8269955: ProblemList compiler/vectorapi/VectorCastShape[64|128]Test.java tests on x86
  • 1166ef2: 8268966: AArch64: 'bad AD file' in some vector conversion tests
  • 3a69024: 8225667: Clarify the behavior of System::gc w.r.t. reference processing
  • ... and 5 more: https://git.openjdk.java.net/jdk17/compare/5b8e1a266e572724a715604ac1c97939bd4db3d1...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Jul 7, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jul 7, 2021
@TheRealMDoerr TheRealMDoerr deleted the 8269879_PPC64_rint branch July 7, 2021 12:52
@openjdk
Copy link

openjdk bot commented Jul 7, 2021

@TheRealMDoerr Pushed as commit 1f2bf1d.

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
hotspot-compiler hotspot-compiler-dev@openjdk.java.net integrated Pull request has been integrated
3 participants