Added an inverse fn for Condition#443
Merged
maximecb merged 1 commit intobetter-bcondfrom Aug 31, 2022
Merged
Conversation
Prevents the need to pass two params and potentially reduces errors.
k0kubun
pushed a commit
that referenced
this pull request
Aug 31, 2022
* Better b.cond usage on AArch64 When we're lowering a conditional jump, we previously had a bit of a complicated setup where we could emit a conditional jump to skip over a jump that was the next instruction, and then write out the destination and use a branch register. Now instead we use the b.cond instruction if our offset fits (not common, but not unused either) and if it doesn't we write out an inverse condition to jump past loading the destination and branching directly. * Added an inverse fn for Condition (#443) Prevents the need to pass two params and potentially reduces errors. Co-authored-by: Jimmy Miller <jimmyhmiller@jimmys-mbp.lan> Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com> Co-authored-by: Jimmy Miller <jimmyhmiller@jimmys-mbp.lan>
noahgibbs
reviewed
Sep 1, 2022
| Condition::GT => Condition::LE, | ||
| Condition::LE => Condition::GT, | ||
|
|
||
| Condition::AL => Condition::AL, |
There was a problem hiding this comment.
In the case of inverting an ALways, presumably you'd get an unexpected result from the code below. Though I don't think you'd ever want to pass it here. So maybe this should panic?
I don't see a "never" type condition code for ARM, so I think inverting an ALways is incorrect/impossible.
Author
|
I think you're right Noah. This should panic.
…On Thu., Sep. 1, 2022, 5:41 a.m. Noah Gibbs, ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In yjit/src/asm/arm64/arg/condition.rs
<#443 (comment)>:
> + Condition::MI => Condition::PL,
+ Condition::PL => Condition::MI,
+
+ Condition::VS => Condition::VC,
+ Condition::VC => Condition::VS,
+
+ Condition::HI => Condition::LS,
+ Condition::LS => Condition::HI,
+
+ Condition::LT => Condition::GE,
+ Condition::GE => Condition::LT,
+
+ Condition::GT => Condition::LE,
+ Condition::LE => Condition::GT,
+
+ Condition::AL => Condition::AL,
In the case of inverting an ALways, presumably you'd get an unexpected
result from the code below. Though I don't think you'd ever want to pass it
here. So maybe this should panic?
I don't see a "never" type condition code for ARM, so I think inverting an
ALways is incorrect/impossible.
—
Reply to this email directly, view it on GitHub
<#443 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFOIJXGPTG2JB7KGDGSZVDV4B24DANCNFSM6AAAAAAQBRL47Q>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prevents the need to pass two params and potentially reduces errors.