Skip to content
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

Investigate if/when BinaryOp.negated() should swap left/right for better matches #167

Open
zbanks opened this issue Nov 5, 2021 · 0 comments

Comments

@zbanks
Copy link
Collaborator

zbanks commented Nov 5, 2021

Brought up by Maide on Discord.

A lot of if (y == x) statements output by mips2c need to be rewritten to if (x == y) to match.

This seems to be related to simplify_expression() and when (y == x) != 0 is re-written to y == x, but it needs more investigation to figure out how to make the matches better:

  • Does it affect both integer & floats?
  • Is it just equality, or also ordering comparisons? (Is there a certain set of instructions?)
  • Can this be used to replace the 123 == x --> x == 123 reordering that's based on isinstance(..., Literal)?
  • Is it consistent across both GCC & IDO?
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

No branches or pull requests

1 participant