[m68k] asm regression with 3.3/3.4/3.5

Segher Boessenkool segher@kernel.crashing.org
Fri May 14 01:03:00 GMT 2004


Hi Gunther,

Try:

#define osfunc(v1,v2)                                   \
({                                                      \
 int _v1 = (v1);                                        \
 int _v2 = (v2);                                        \
 {                                                      \
   register int _d0 __asm("d0") = _v1;                  \
   register int _d1 __asm("d1") = 0xDEADBEAF;           \
   register int _a0 __asm("a0") = _v2;                  \
   register int _a1 __asm("a1") = 0xDEADBEAF;           \
   register void *const _a6 __asm("a6") = (base);       \
   __asm volatile ("jsr a6@(-0x84:W)"                   \
   : "+r" (_d0), "=r" (_d1), "+r" (_a0), "=r" (_a1), "+r"(_a6) \
   : : "fp0", "fp1", "cc", "memory");                   \
  }                                                     \
})
(Note: I merged the multiple register asm's referring
to the same reg into one.  I don't think it will always
work correctly, otherwise).
Any register asm that's used in the asm block has to be
either a clobber or an output.  Yes I learnt this the hard
way.  Yes it would be so much nicer if we could specify
specific regs in asm inputs.  \end{rant}
Segher




More information about the Gcc mailing list