Post-increment constraint in inline assembly (SuperH)

Sébastien Michelland sebastien.mld@numericable.fr
Sun Jan 28 13:33:00 GMT 2018


Hello,

I am trying to generate a call to the SH-4A unaligned move "movua.l 
@rm+, r0" instruction. Currently my inline-assembly approach using
the '>' constraint is rejected by the compiler:

   #include <stdint.h>

   void f(void)
   {
           uint32_t longword, *src;
           __asm__(
                   "movua.l %1, %0"
                   : "=z" (longword)
                   : ">" (src)
           );
   }

   % sh3eb-elf-gcc -S movua.c -o movua.s -ffreestanding
   movua.c: In function 'f':
   movua.c:6:2: warning: asm operand 1 probably doesn't match constraints
     __asm__(
     ^~~~~~~
   movua.c:6:2: error: impossible constraint in 'asm'

I have tried a lot of variations to no avail.

Am I using the '>' constraint the wrong way? What would be the proper 
way to generate this instruction?

Regards,
Sébastien



More information about the Gcc-help mailing list