Re: Post-increment constraint in inline assembly (SuperH)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 29, 2018 at 05:57:47PM +0100, Georg-Johann Lay wrote:
> YMMV, I am not even sure if it is correct or even makes complete sense.
> 
> The "m>"(*src) operand doesn't even express that src is changing, and 
> the constraint allows to use post-increment, but does not force it.

src does not change.  If the compiler chooses to use a post-increment
then this asm will increment the register used.  Which is equal to src
on input to this asm, but not on output in that case.

src is a C variable.  The compiler translates C to assembler code that
implements the same stuff.  Inline assembler integrates with C and the
internal GCC representation, not directly with the generated assembler
code.  Extended asm is not like basic asm (which essentially just drops
a block of assembler code in the middle of the compiler's output, no
questions asked).

> And my experience with inline asm is this: if one doesn't express all 
> side effects (which is the case for "m>"(src)), then the asm will bite 
> you sooner or later; even it it appeared to work fine in the past.

Certainly.  But "m>" describes everything as it should.


Segher



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux