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

RFC: unary operations #440

Open
andres-erbsen opened this issue Jan 3, 2025 · 1 comment
Open

RFC: unary operations #440

andres-erbsen opened this issue Jan 3, 2025 · 1 comment

Comments

@andres-erbsen
Copy link
Contributor

andres-erbsen commented Jan 3, 2025

I will probably need to add unary bitwise negation for MSVC -WError compatibility; a "-1" literal isn't allowed there. Probably best to desugar in the flattening phase?

@samuelgruetter
Copy link
Contributor

Yeah, the flattening phase could emit SOp resVar bopname.xor argVar argVar for unary bitwise negation. Or if you want a cheaper solution, you could also just define bitwiseNeg x := expr.xor x x at the source level in bedrock2.Syntax, there's already enough precedent for that 😉

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

2 participants