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

x64: fix Inst::store to understand all scalar types #2833

Merged
merged 2 commits into from
Apr 13, 2021

Conversation

abrown
Copy link
Contributor

@abrown abrown commented Apr 13, 2021

In #2826, @bjorn3 found an issue relating to Inst::store--not all types, e.g. I16, were supported. There is no reason Inst::store shouldn't have this functionality: the emission of MovRM already supports this. @bjorn3, can you provide a CLIF test to trigger the error you found?

Also, to make troubleshooting easier in the future, I re-factored lower.rs to use Inst::store in all the places it previously used Inst::mov_r_m. This should make things easier to troubleshoot: only one function, Inst::store, now understands what move instruction is needed for each different CLIF type.

abrown added 2 commits April 13, 2021 12:38
Previously, `Inst::store` only understood a subset of the scalar types, which resulted in failures seen in bytecodealliance#2826. This change allows `Inst::store` to generate instructions for all scalar widths (`8 | 16 | 32 | 64`) since all of these are supported in the emission code of `Inst::MovRM`.
This re-factoring replaces uses of `Inst::mov_r_m` with `Inst::store` to ensure there is only one code location to troubleshoot when generating store instructions for a specific type.
@abrown abrown requested a review from cfallin April 13, 2021 20:24
@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator cranelift:area:x64 Issues related to x64 codegen labels Apr 13, 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.

Looks good!

@cfallin cfallin merged commit 27b3162 into bytecodealliance:main Apr 13, 2021
@abrown abrown deleted the 2826 branch April 13, 2021 23:07
bjorn3 added a commit to bjorn3/wasmtime that referenced this pull request Apr 14, 2021
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.

2 participants