Closed iucoen closed 2 years ago
gcc for i386 and x86_64 support setting output of inline assembly block based on condition flags.
For example
int is_zero; asm("test %1, %1" : "=@ccz"(is_zero) : "=r"(0));
would set is_zero to 1. On i386 that assembly block would be equivalent to:
asm("test %1, %1\n ""setz %0\n" : "=r"(is_zero) : "=r"(0));
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.
wrong repo
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.