Condition code testing after inline assembly
Andi Kleen
ak@muc.de
Tue Jan 20 18:39:00 GMT 1998
Hello,
I recently wanted to test the condition codes generated by an inline
assembler statement. I then found this statement in the info pages:
`` It is a natural idea to look for a way to give access to the
condition code left by the assembler instruction. However, when we
attempted to implement this, we found no way to make it work reliably.
The problem is that output operands might need reloading, which would
result in additional following "store" instructions. On most machines,
these instructions would alter the condition code before there was time
to test it. This problem doesn't arise for ordinary "test" and
"compare" instructions because they don't have any output operands. ''
I don't understand this. Why is not possible to first test the
condition, branch and then duplicate the necessary reloads for output
operands in both paths? Any insights on this would be appreciated.
Thanks,
-Andi
More information about the Gcc
mailing list