Skip to content

8355644: Optimize Math.cbrt for AArch64 platforms with an intrinsic implementation #25085

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

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

theRealAph
Copy link
Contributor

@theRealAph theRealAph commented May 7, 2025

This is the AArch64 version of the cbrt intrinsic. Unfortunately, it doesn't provide much of an advantage over C2-compiled Java, so it's not worth doing.


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-8355644: Optimize Math.cbrt for AArch64 platforms with an intrinsic implementation (Enhancement - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 25085

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

Using diff file

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

@theRealAph theRealAph marked this pull request as draft May 7, 2025 08:44
@bridgekeeper
Copy link

bridgekeeper bot commented May 7, 2025

👋 Welcome back aph! 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 May 7, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk
Copy link

openjdk bot commented May 7, 2025

@theRealAph The following labels will be automatically applied to this pull request:

  • core-libs
  • graal
  • hotspot
  • shenandoah

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

@theRealAph
Copy link
Contributor Author

The reason for the speed difference is worth a remark here. The intrinsic for x86 gets its advantage over the Java code in the JDK by avoiding divide instructions altogether. Apple M silicon can issue a divide instruction every cycle, so this advantage turns into a disadvantage, because the algorithm using division has fewer instructions than this intrinsic. One Arm Neoverse silicon, which does not have super-fast floating-point division, there is an advantage, but it's really only a small one. See the Bug for more details.

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

Successfully merging this pull request may close these issues.

1 participant