Skip to content

8384507: Incorrect vector reassociation for signed saturating addition#31172

Open
jatin-bhateja wants to merge 1 commit into
openjdk:masterfrom
jatin-bhateja:JDK-8384507
Open

8384507: Incorrect vector reassociation for signed saturating addition#31172
jatin-bhateja wants to merge 1 commit into
openjdk:masterfrom
jatin-bhateja:JDK-8384507

Conversation

@jatin-bhateja
Copy link
Copy Markdown
Member

@jatin-bhateja jatin-bhateja commented May 15, 2026

Reassociating vector broadcasts expects the vector operation to be associative, since we perform the following transformation:

VectorOp(ReplicateA, VectorOp(ReplicateB, Operand3))
  => VectorOp(Operand3, VectorOp(ReplicateA, ReplicateB))

Signed saturating addition is not an associative operation, i.e. sat_add(a, sat_add(b, c)) != sat_add(sat_add(a, b), c) because intermediate clamping can change the final result. This patch introduces is_associative_vector_operation() which skips the reassociation transformation for signed saturating addition while continuing to allow it for unsigned saturating addition (which is associative).

Please review and share your feedback.

Best Regards,
Jatin



Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issue

  • JDK-8384507: Incorrect vector reassociation for signed saturating addition (Bug - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 31172

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper Bot commented May 15, 2026

👋 Welcome back jbhateja! 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.

@jatin-bhateja
Copy link
Copy Markdown
Member Author

/label add hotspot-compiler-dev

@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 15, 2026

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

@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 15, 2026

@jatin-bhateja
The hotspot-compiler label was successfully added.

@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 15, 2026

The total number of required reviews for this PR has been set to 2 based on the presence of this label: hotspot-compiler. This can be overridden with the /reviewers command.

@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 15, 2026

@jatin-bhateja To determine the appropriate audience for reviewing this pull request, one or more labels corresponding to different subsystems will normally be applied automatically. However, no automatic labelling rule matches the changes in this pull request. In order to have an "RFR" email sent to the correct mailing list, you will need to add one or more applicable labels manually using the /label pull request command.

Applicable Labels
  • build
  • client
  • compiler
  • core-libs
  • hotspot
  • hotspot-compiler
  • hotspot-gc
  • hotspot-jfr
  • hotspot-runtime
  • i18n
  • ide-support
  • javadoc
  • jdk
  • net
  • nio
  • security
  • serviceability
  • shenandoah

@openjdk openjdk Bot added the rfr Pull request is ready for review label May 15, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge Bot commented May 15, 2026

Webrevs

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

Labels

hotspot-compiler [email protected] rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

1 participant