elliottt opened PR #5644 from trevor/switch-brif
to main
:
Rework the compilation strategy for switch to:
- use
brif
instead ofbrz
andbrnz
- generate tables inline, rather than delyaing them to after the decision tree has been generated
- avoid allocating new vectors by using slices into the sorted contiguous ranges
- avoid generating some unconditional jumps
- output differences in test output using the
similar
crate for easier debugging<!--
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.
-->
elliottt has marked PR #5644 as ready for review.
elliottt requested jameysharp for a review on PR #5644.
elliottt edited PR #5644 from trevor/switch-brif
to main
:
Rework the compilation strategy for switch to:
- use
brif
instead ofbrz
andbrnz
- generate tables inline, rather than delyaing them to after the decision tree has been generated
- avoid allocating new vectors by using slices into the sorted contiguous ranges
- avoid generating some unconditional jumps
- output differences in test output using the
similar
crate for easier debugging@bjorn3, if you have time to look through this I'd appreciate it!
<!--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.
-->
elliottt updated PR #5644 from trevor/switch-brif
to main
.
elliottt submitted PR review.
elliottt created PR review comment:
This should probably be a smallvec of size 3 instead of a
Vec
.
bjorn3 submitted PR review.
bjorn3 submitted PR review.
bjorn3 created PR review comment:
nit:
similar = { workspace = true }
bjorn3 created PR review comment:
Could you instead call
bx.create_block()
right before using it instead of before the for loop? That did just need a check if you are at the last iteration of the for loop and in that case useotherwise
instead ofbx.create_block()
.
elliottt updated PR #5644 from trevor/switch-brif
to main
.
elliottt updated PR #5644 from trevor/switch-brif
to main
.
elliottt submitted PR review.
elliottt created PR review comment:
It was nice to avoid the explicit index check in the loop, but you're right, that's a simpler implementation :)
bjorn3 submitted PR review.
elliottt updated PR #5644 from trevor/switch-brif
to main
.
jameysharp submitted PR review.
elliottt merged PR #5644.
Last updated: Dec 23 2024 at 12:05 UTC