Post-increment constraint in inline assembly (SuperH)

Georg-Johann Lay avr@gjlay.de
Mon Jan 29 09:39:00 GMT 2018


On 29.01.2018 10:12, Andrew Haley wrote:
> On 29/01/18 09:05, Georg-Johann Lay wrote:
>> A different approach is to explicitly use post-increment if that's the
>> favourable addressing mode:
>>
>> __asm__ ("movua.l %1, @%0+"
>>            : "=z" (longword), "+r" (src)
>>            : "m" (*src)
> 
> I'm not familiar with SuperH, but isn't src %1 in this asm, when it
> should be %0 ?

Yes, at least according to Segher's asm dump:

#APP
         movua.l @r4+, r0
#NO_APP

Hence the source should read something like

__asm__ ("movua.l @%1+, %0"
          : "=z" (longword), "+r" (src)
          : "m" (*src));

instead.  Thanks for spotting this.

Johann



More information about the Gcc-help mailing list