Skip to content

Cranelift: ISLE: aarch64: fix imm12_from_negated_value for i32, i16#6078

Merged
cfallin merged 2 commits into
bytecodealliance:mainfrom
avanhatt:iconst-imm12
Mar 21, 2023
Merged

Cranelift: ISLE: aarch64: fix imm12_from_negated_value for i32, i16#6078
cfallin merged 2 commits into
bytecodealliance:mainfrom
avanhatt:iconst-imm12

Conversation

@avanhatt
Copy link
Copy Markdown
Member

Fixes #5903

This fixes imm12_from_negated_value to correctly sign-extend narrow values before negating them as i64 values, allowing these rules to work for non-zero negative i32 and i16.

As suggested by @jameysharp in that issue, switch imm12_from_negated_value to be a partial term with a corresponding rule.

Also updated + added to the relevant filetest.

@github-actions github-actions Bot added cranelift Issues related to the Cranelift code generator cranelift:area:aarch64 Issues related to AArch64 backend. labels Mar 21, 2023
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.

This makes sense to me -- thanks!

@cfallin cfallin added this pull request to the merge queue Mar 21, 2023
@cfallin cfallin merged commit 13be561 into bytecodealliance:main Mar 21, 2023
@avanhatt avanhatt deleted the iconst-imm12 branch March 27, 2023 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cranelift:area:aarch64 Issues related to AArch64 backend. cranelift Issues related to the Cranelift code generator

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cranelift: ISLE: aarch64: imm12_from_negated_value rules don't apply for i32, i16

2 participants