cfallin opened PR #3610 from fix-narrow-type-rotate
to main
:
Uncovered by @bjorn3 (thanks!): 8- and 16-bit rotates were not working
properly in recent versions of Cranelift with part of the lowering
migrated to ISLE.This PR fixes a few issues:
8- and 16-bit rotate-left needs to mask a constant amount, if any,
because we use a 32-bit rotate instruction and so don't get the
appropriate shift-amount masking for free from x86 semantics.
operand_size_from_type
was incorrect: it only handled 32- and 64-bit
types and silently returnedOperandSize::Size32
for everything else.
Now uses theOperandSize::from_ty(ty)
helper as the pre-ISLE code
did.Our test coverage for narrow value types is not great; this PR adds some
runtests for rotl/rotr but more would always be better!<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
cfallin requested alexcrichton for a review on PR #3610.
alexcrichton submitted PR review.
cfallin updated PR #3610 from fix-narrow-type-rotate
to main
.
cfallin merged PR #3610.
Last updated: Nov 22 2024 at 16:03 UTC