Skip to content
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

Allow i128 amount operands on shift instructions in the x64 backend #2886

Merged
merged 1 commit into from
May 10, 2021

Conversation

afonso360
Copy link
Contributor

Fixes #2727.

We handle the i128 cases by just ignoring the upper half of the source.

@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator cranelift:area:x64 Issues related to x64 codegen labels May 8, 2021
Copy link
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.

Thank you @afonso360 for this PR!

Overall looks great; just one thought on the tests below.


function %ishl_amt_i128(i64, i64, i8) -> i64, i64 {
block0(v0: i64, v1: i64, v2: i8):
v3 = uextend.i128 v2
Copy link
Member

Choose a reason for hiding this comment

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

Could we add some cases that test the masking as well? A simple way to do this might just be v3 = uextend.i64 v2 / v4 = iconcat v3, v3, i.e. extend to 64 bits then replicate the 64 bits into the low and high parts.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I've updated the existing test cases so that they all do that

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

Thanks!

@cfallin cfallin merged commit db8ccb5 into bytecodealliance:main May 10, 2021
@afonso360 afonso360 deleted the x64-i128-shift-amt branch May 10, 2021 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cranelift:area:x64 Issues related to x64 codegen cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cranelift: ishl.i128 with i128 shift amount panics
2 participants