Skip to content

Added an inverse fn for Condition#443

Merged
maximecb merged 1 commit intobetter-bcondfrom
inverse-condition
Aug 31, 2022
Merged

Added an inverse fn for Condition#443
maximecb merged 1 commit intobetter-bcondfrom
inverse-condition

Conversation

@maximecb
Copy link
Copy Markdown

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 <jimmyhmiller@jimmys-mbp.lan>

Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
Co-authored-by: Jimmy Miller <jimmyhmiller@jimmys-mbp.lan>
Condition::GT => Condition::LE,
Condition::LE => Condition::GT,

Condition::AL => Condition::AL,
Copy link
Copy Markdown

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
Copy Markdown
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