Rick Mann <[email protected]> wrote:
> Ah! I guess here's a case where the compiler isn't smart enough.
No, the problem sits in front of the computer. ;-)
> Theoretically, because the code is inlined, it should be able to
> work out the inverse and then generate the immediate operand for
> andi.
Then you have to constrain it as an immediate value. If you constrain
it as a register ("r"), the code must use it as a register. The
compiler cannot analyze your inline assembly code itself; this is just
a "black box" to the compiler.
It's even possible to provide two different implementations, based on
whether it's a compile-time constant or not that is being passed down
to the inline function. I think it's something like the operator
__constant_p or such (which you have to apply to your mask), please
have a look into the GCC documentation.
--
cheers, J"org .-.-. --... ...-- -.. . DL8DTL
http://www.sax.de/~joerg/ NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)
_______________________________________________
AVR-chat mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-chat