Skip to content

aarch64: Fix miscompile lowering the extr instruction#12907

Merged
cfallin merged 1 commit intobytecodealliance:mainfrom
alexcrichton:fix-aarch64-extr
Mar 31, 2026
Merged

aarch64: Fix miscompile lowering the extr instruction#12907
cfallin merged 1 commit intobytecodealliance:mainfrom
alexcrichton:fix-aarch64-extr

Conversation

@alexcrichton
Copy link
Copy Markdown
Member

This commit fixes a miscompile in the lowering of the extr instruction for the aarch64 backend where one of the shift operands is 0. In this edge case the generated extr instruction did not match the input CLIF semantics, calculating a different value. The fix here is to only use the extr instruction when both immediates are larger than 0.

This commit fixes a miscompile in the lowering of the `extr` instruction
for the aarch64 backend where one of the shift operands is 0. In this
edge case the generated `extr` instruction did not match the input CLIF
semantics, calculating a different value. The fix here is to only use
the `extr` instruction when both immediates are larger than 0.
@alexcrichton alexcrichton requested review from a team as code owners March 31, 2026 13:19
@alexcrichton alexcrichton requested review from fitzgen and removed request for a team March 31, 2026 13:19
Copy link
Copy Markdown
Member

@cfallin cfallin left a comment

Choose a reason for hiding this comment

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

Good find!

@cfallin cfallin added this pull request to the merge queue Mar 31, 2026
Merged via the queue into bytecodealliance:main with commit 33e8b3d Mar 31, 2026
78 checks passed
@alexcrichton alexcrichton deleted the fix-aarch64-extr branch April 1, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants