-
Notifications
You must be signed in to change notification settings - Fork 8
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
Request: flag output #14
Comments
If we do end up supporting this in the future then it would most likely be done through a special operand type such as My main concern with this feature is that it is only supported on x86 and neither Clang nor GCC have any plans to extend it to other architectures. |
Assembly is already as architecture-dependent as anything can get, so I don't think it would be a problem to only support this on certain architectures. If we did end up supporting flag outputs for all architectures, it would still be interesting as A special operand wouldn't be bad, but it would be interesting if the semantics for flags were the same as for registers, i.e. one can set the flag based on a boolean by using |
Isn't this what GCC uses |
LLVM and GCC only support this as an output, and multiple flag outputs are not allowed. It also directly conflicts with |
What’s wrong with |
It's just better for different things to be called different names. |
Are they different things? |
To branch off a flag, this is the current way (x86):
This causes a
test
on ther
register, and then, in most cases, a jump conditional is called. Ideally, this wholer
register would not be a thing and we could just jump conditional right after calling theasm!
.This optmization, however, can not happen because there are no ways of outputting a flag from asm. GCC has an extension which allows it to do this very thing. The desired syntax would be something along the lines of
out("z") r
, withr: bool
.The text was updated successfully, but these errors were encountered: