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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

cranelift: Fix shifts and implement rotates in interpreter #4519

Merged
merged 2 commits into from
Aug 11, 2022

Conversation

afonso360
Copy link
Contributor

馃憢 Hey,

This PR fixes some issues with shifts in the interpreter and implements rotates.

It also fixes some issues with the x64 implementation where some type combinations for rotl/rotr were not lowered.

cc: @jameysharp @cfallin

@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator cranelift:area:x64 Issues related to x64 codegen labels Jul 24, 2022
Copy link
Contributor

@jameysharp jameysharp left a comment

Choose a reason for hiding this comment

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

I don't feel qualified to review the x64 ISLE rules here, so I think @cfallin (or perhaps @abrown or @elliottt?) should glance at this. That said, the new tests look comprehensive to me, and they pass in CI, which gives me good confidence that the lowering changes are correct. The interpreter implementation also looks plausible.

Unfortunately we've changed CI configuration since you opened this PR, so you'll need to rebase to get the new CI actions to run before we can merge this.



;; This is a regression test for rotates on x64
;; See: https://github.com/bytecodealliance/wasmtime/pull/3610
Copy link
Contributor

Choose a reason for hiding this comment

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

I really appreciate that you not only tracked down where these particular tests came from, but also left a link here in case anybody else wonders!

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.

This is great -- the 8/16-bit cases becoming simpler is something I hadn't anticipated, but I double-checked and we do indeed generate the 8/16-bit variants of the instructions, so we get the correct semantics for tree. Thanks!

@cfallin cfallin merged commit e4adc46 into bytecodealliance:main Aug 11, 2022
afonso360 added a commit to afonso360/wasmtime that referenced this pull request Aug 11, 2022
These were moved to the main shifts file in bytecodealliance#4519 but this file was accidentaly left in tree.

It also fixes the missing sshr_i8_i8 testcase
afonso360 added a commit to afonso360/wasmtime that referenced this pull request Aug 11, 2022
These were moved to the main shifts file in bytecodealliance#4519 but this file was accidentaly left in tree.

It also fixes the missing sshr_i8_i8 testcase
jameysharp pushed a commit that referenced this pull request Aug 12, 2022
* cranelift: Remove shifts-small-types runtests

These were moved to the main shifts file in #4519 but this file was accidentaly left in tree.

It also fixes the missing sshr_i8_i8 testcase

* cranelift: Add shifts to fuzzer

* cranelift: Add extends to fuzzer
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.

None yet

3 participants