Skip to content

Added an inverse fn for Condition #443

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 1 commit into from
Aug 31, 2022
Merged

Conversation

maximecb
Copy link

Prevents the need to pass two params and potentially reduces errors.

Prevents the need to pass two params and potentially reduces errors.
@maximecb maximecb merged commit ece7d9a into better-bcond Aug 31, 2022
@maximecb maximecb deleted the inverse-condition branch August 31, 2022 16:32
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 <[email protected]>

Co-authored-by: Maxime Chevalier-Boisvert <[email protected]>
Co-authored-by: Jimmy Miller <[email protected]>
Condition::GT => Condition::LE,
Condition::LE => Condition::GT,

Condition::AL => Condition::AL,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@maximecb
Copy link
Author

maximecb commented Oct 11, 2022 via email

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

Successfully merging this pull request may close these issues.

3 participants