Thanks to visit codestin.com
Credit goes to github.com

Skip to content

WASM, WASM_X64: Support shift operations #1482

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

Merged
merged 4 commits into from
Feb 1, 2023

Conversation

ubaidsk
Copy link
Collaborator

@ubaidsk ubaidsk commented Jan 31, 2023

This PR adds support of left shift and right shift operations in the wasm and wasm_x64 backends. For right shift, I currently used signed/arithmetic right shift operation (this seems similar to the llvm backend). Other possibility is using unsigned/logical right shift operation.

@ubaidsk ubaidsk added the wasm label Jan 31, 2023
@ubaidsk ubaidsk requested a review from certik January 31, 2023 16:54
@ubaidsk
Copy link
Collaborator Author

ubaidsk commented Jan 31, 2023

This is ready. Please possibly review and share feedback.

@ubaidsk
Copy link
Collaborator Author

ubaidsk commented Jan 31, 2023

This PR might fail after merging of #1481. As the test integration_tests/bit_operations_i32.py was enabled for the wasm_x64 backend in the commit TEST: Enable suporting tests and the wasm_x64 backend currently does not have support for shift operations.

@certik certik mentioned this pull request Jan 31, 2023
23 tasks
@certik
Copy link
Contributor

certik commented Jan 31, 2023

All tests passed and I now rebased on top of the latest master.

@ubaidsk ubaidsk changed the title WASM: Support shift operations WASM, WASM_X64: Support shift operations Feb 1, 2023
@ubaidsk
Copy link
Collaborator Author

ubaidsk commented Feb 1, 2023

The tests should hopefully pass now.

The new commits X86Assembler: Implement SHL and SAR Instructions and
WASM_X64: Support I32Shl() and I32ShrS() need review.

@ubaidsk
Copy link
Collaborator Author

ubaidsk commented Feb 1, 2023

I am adding this to auto-merge as it seems approved. I will support changes/updates suggested (if any) for recently added commits in a new PR.

@ubaidsk ubaidsk enabled auto-merge February 1, 2023 06:47
@ubaidsk ubaidsk merged commit 9417d7e into lcompilers:main Feb 1, 2023
@ubaidsk ubaidsk deleted the wasm_shift_opts branch February 1, 2023 07:44
@certik
Copy link
Contributor

certik commented Feb 1, 2023

Yes, this is good, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants