Open iucoen opened 2 years ago
Hello @iucoen,
OK, I will look into how to handle "=@cc
..."
constraints more properly.
From what I see, GCC in general basically skips over unrecognized characters (e.g. @
) in constraints. The i386 back-end actually implements an extra TARGET_MD_ASM_ADJUST
hook to specially parse and handle "=@cc
..."
constraints. Perhaps the IA-16 back-end can do something similar.
Thank you!
Hello @iucoen,
In the meantime, you can get your code to test for the __GCC_ASM_FLAG_OUTPUTS__
macro — as described in the gcc
info file — to see if the compiler supports "=@cc
..."
.
Thank you!
gcc for i386 and x86_64 support setting output of inline assembly block based on condition flags.
For example
would set is_zero to 1. On i386 that assembly block would be equivalent to:
With gcc-ia16, "=@cc" would get parsed as just "c", and the compiler emits a "mov %cx, %0" instead, which is wrong. If "=@cc" is not supported, the compiler should at least fail with an error, not interpret the constraint to mean %cx.