Request for discussion: Rewrite of inline assembler docs
Richard Sandiford
rdsandiford@googlemail.com
Fri Mar 28 07:56:00 GMT 2014
dw <limegreensocks@yahoo.com> writes:
> Using this clobber causes the compiler to flush all (modified) registers
> being used to store memory-based values to memory before executing the
> @code{asm} statement. Further, the compiler will not assume that any
> memory-based values read before the @code{asm} will remain unchanged
> after the @code{asm}; it will reload them as needed. This effectively
> forms a read/write memory barrier for the compiler. For performance
> reasons, some variables only exist in registers and never get written to
> memory. The "memory" clobber does not force these values to get written
> to memory.
Sounds good to me.
> Anything else?
Nope, that's it :-)
Thanks,
Richard
More information about the Gcc
mailing list