This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [m68k] asm regression with 3.3/3.4/3.5
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Gunther Nikl <gni at gecko dot de>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 13 May 2004 15:21:28 +0200
- Subject: Re: [m68k] asm regression with 3.3/3.4/3.5
- References: <20040512154332.GA94251@lorien.int.gecko.de>
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