Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8271601: Math.floorMod(int, int) and Math.floorMod(long, long) differ in their logic #4962

Closed
wants to merge 1 commit into from

Conversation

rgiulietti
Copy link
Contributor

@rgiulietti rgiulietti commented Aug 2, 2021

Hello,

please review this tiny change in the implementation of j.l.Math.floorMod(int, int).

While the results are unaffected, all of
floorDiv(int, int)
floorDiv(long, long)
floorMod(long, long)
use x ^ y in the tests to correct the result if needed.

Not only is the proposed change more consistent with the other methods, but it might benefit later stages in the cpu to proceed with the evaluation of x ^ y in parallel with the previous x % y and, depending of the outcome, even further down.

Greetings
Raffaello


Progress

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

Issue

  • JDK-8271601: Math.floorMod(int, int) and Math.floorMod(long, long) differ in their logic

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4962

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

Using diff file

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

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Aug 2, 2021

👋 Welcome back rgiulietti! 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 label Aug 2, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Aug 2, 2021

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

  • core-libs

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 core-libs label Aug 2, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Aug 2, 2021

Webrevs

bplb
bplb approved these changes Aug 2, 2021
Copy link
Member

@bplb bplb left a comment

This looks all right to me. Verified by running all java/lang/Math tests against the patch.

@openjdk
Copy link

@openjdk openjdk bot commented Aug 2, 2021

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

8271601: Math.floorMod(int, int) and Math.floorMod(long, long) differ in their logic

Reviewed-by: bpb

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

  • 977b8c4: 8271836: runtime/ErrorHandling/ClassPathEnvVar.java fails with release VMs
  • 04134fc: 8264543: Cross modify fence optimization for x86
  • 9e76909: 8271824: mark hotspot runtime/CompressedOops tests which ignore external VM flags
  • e49b7d9: 8271828: mark hotspot runtime/classFileParserBug tests which ignore external VM flags
  • 68f7847: 8271825: mark hotspot runtime/LoadClass tests which ignore external VM flags
  • 3d40cac: 8271821: mark hotspot runtime/MinimalVM tests which ignore external VM flags
  • 33ec3a4: 8271744: mark hotspot runtime/getSysPackage tests which ignore external VM flags
  • b48f31d: 8271743: mark hotspot runtime/jni tests which ignore external VM flags
  • 66c653c: 8271721: Split gc/g1/TestMixedGCLiveThreshold into separate tests
  • 68dd828: 8271224: runtime/EnclosingMethodAttr/EnclMethodAttr.java doesn't check exit code
  • ... and 18 more: https://git.openjdk.java.net/jdk/compare/0a85236396c667c8d2c890e4384c623b39455075...master

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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@bplb) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready label Aug 2, 2021
@rgiulietti
Copy link
Contributor Author

@rgiulietti rgiulietti commented Aug 4, 2021

/integrate

@openjdk openjdk bot added the sponsor label Aug 4, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Aug 4, 2021

@rgiulietti
Your change (at version afd5172) is now ready to be sponsored by a Committer.

@bplb
Copy link
Member

@bplb bplb commented Aug 10, 2021

/sponsor

@openjdk
Copy link

@openjdk openjdk bot commented Aug 10, 2021

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

  • 57ae9fb: 8140442: Add getOutermostTypeElement to javax.lang.model utility class
  • 67869b4: 8270137: Kerberos Credential Retrieval from Cache not Working in Cross-Realm Setup
  • 35b399a: 8269130: Replace usages of Collection.toArray() with Collection.toArray(T[]) to avoid redundant array copying
  • 2b05fae: 8260262: Use common code in function unmap_shared() in perfMemory_posix.cpp
  • f2599ad: 8272196: Remove unused class ParStrongRootsScope
  • 1f88134: 8271869: AArch64: build errors with GCC11 in frame::saved_oop_result
  • 089e83b: 8266490: Extend the OSContainer API to support the pids controller of cgroups
  • 2384e12: 8270098: ZGC: ZBarrierSetC2::clone_at_expansion fails with "Guard against surprises" assert
  • d53d94b: 8271925: ZGC: Arraycopy stub passes invalid oop to load barrier
  • 3b899ef: 8272168: some hotspot runtime/logging tests don't check exit code
  • ... and 94 more: https://git.openjdk.java.net/jdk/compare/0a85236396c667c8d2c890e4384c623b39455075...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Aug 10, 2021
@openjdk openjdk bot added integrated and removed ready rfr sponsor labels Aug 10, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Aug 10, 2021

@bplb @rgiulietti Pushed as commit 66d1faa.

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

@rgiulietti rgiulietti deleted the JDK-8271601 branch Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs integrated
2 participants