Skip to content

8382039: Add support do_arch_array_entry() template#30704

Open
adinn wants to merge 5 commits intoopenjdk:masterfrom
adinn:JDK-8382039
Open

8382039: Add support do_arch_array_entry() template#30704
adinn wants to merge 5 commits intoopenjdk:masterfrom
adinn:JDK-8382039

Conversation

@adinn
Copy link
Copy Markdown
Contributor

@adinn adinn commented Apr 13, 2026

This PR implements support for declaring arch-specific stubs which store their entries and present them to clients as an array. It uses this machinery to model the entries of the AArch64- and X86-specific vector_iota_entries stubs as arrays and changes all uses of these entries so the are accessed using an array index calculated from an associated basic type.



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-8382039: Add support do_arch_array_entry() template (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 30704

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper bot commented Apr 13, 2026

👋 Welcome back adinn! 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
Copy Markdown

openjdk bot commented Apr 13, 2026

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

8382039: Add support do_arch_array_entry() template

Reviewed-by: asmehra

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:

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 changed the title 8382039: Add support do_arch_array_entry() template 8382039: Add support do_arch_array_entry() template Apr 13, 2026
@openjdk openjdk bot added the hotspot hotspot-dev@openjdk.org label Apr 13, 2026
@openjdk
Copy link
Copy Markdown

openjdk bot commented Apr 13, 2026

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

@adinn
Copy link
Copy Markdown
Contributor Author

adinn commented Apr 13, 2026

@vnkozlov I have added the machinery for arch-specific stub entry arrays and used it to model the vector iota indices entries on aarch64 and x86_64.

The patch involves some duplication of code in the arch directories. I thought about making this code generic but decided that was inappropriate since it is only used on these two architectures. If you disagree it can be moved up.

@openjdk openjdk bot added the rfr Pull request is ready for review label Apr 13, 2026
@adinn
Copy link
Copy Markdown
Contributor Author

adinn commented Apr 13, 2026

@ashu-mehra Could you also please review this?

@mlbridge
Copy link
Copy Markdown

mlbridge bot commented Apr 13, 2026

Webrevs

@adinn
Copy link
Copy Markdown
Contributor Author

adinn commented Apr 13, 2026

Oops, apologies I pushed a new fix to the wrong branch (reverted to previous fix).

@openjdk
Copy link
Copy Markdown

openjdk bot commented Apr 13, 2026

@adinn Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information.

@adinn
Copy link
Copy Markdown
Contributor Author

adinn commented Apr 13, 2026

@offamitkumar @RealFYang @TheRealMDoerr This change ought to be unproblematic on s390, riscv and ppc as they do not use the new stub definition capability. However, once the cross-compile builds complete it would be very helpful if you could check the changes and ensure that the build can run java -version or java HelloWorld.

Copy link
Copy Markdown
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.

Thank you, @adinn. Looks good. I will submit testing.

@vnkozlov
Copy link
Copy Markdown
Contributor

Unfortunately some vector tests failed (produced wrong results) on Aarch64 normal (not AOT) execution:
compiler/vectorapi/VectorRearrangeTest.java
testlibrary_tests/template_framework/examples/TestVectorTypes.java

Caused by: java.lang.RuntimeException: assertEquals expected: -0.2818233743404943 but was: -0.822990709876618

@adinn
Copy link
Copy Markdown
Contributor Author

adinn commented Apr 14, 2026

@vnkozlov I believe @ashu-mehra spotted the problem. The vector rearrange code can be fed basic type T_DOUBLE or T_LONG for a vector type but in both cases it needs to use the vector iota indices for T_LONG to control the shuffle. My patch was selecting the indices using the supplied basic type -- which fails when we are shuffling a vector that is (nominally) DOUBLE. I pushed a correction which should enablethe vector tests to pass.

(Sorry, but I don't have easy access to an SVE machine to run these tests).

@TheRealMDoerr
Copy link
Copy Markdown
Contributor

@offamitkumar @RealFYang @TheRealMDoerr This change ought to be unproblematic on s390, riscv and ppc as they do not use the new stub definition capability. However, once the cross-compile builds complete it would be very helpful if you could check the changes and ensure that the build can run java -version or java HelloWorld.

java -version still works on linux ppc64le and AIX.

@RealFYang
Copy link
Copy Markdown
Member

RealFYang commented Apr 14, 2026

Hi, hotspot:tier1 test result is good on linux-riscv64. Thanks for the ping.

@ashu-mehra
Copy link
Copy Markdown
Contributor

looks good now.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Apr 14, 2026
@vnkozlov
Copy link
Copy Markdown
Contributor

I start new testing.

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

Labels

hotspot hotspot-dev@openjdk.org ready Pull request is ready to be integrated rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

5 participants