Mail Archives: djgpp/1997/06/11/23:48:35
Calin Andrian wrote:
>
> mlsoftware AT aol DOT com (Mlsoftware) wrote:
> >
> >#define quad_memcpy(src, dest, numwords) \
> >__asm__ __volatile__ ( \
> > "cld\n\t" \
> > "rep\n\t" \
> > "movsl" \
> > : : "S" (src), "D" (dest), "c" (numwords) \
> > : "%ecx", "%esi", "%edi" )
>
> Here comes the question: Isn't this inline redundant ? The docs say
> that you have to specify what _unknown_to_the_compiler_ registers
> you clobber. In the above inline, all "clobbered" registers are,
> in fact, input registers - so the compiler should know they change.
>
> Can anybody state this for sure ? (I did use similar inlines for
> rep/insw and rep/outsw and they seem to work without specifying any
> clobbered registers.)
Yeah, I can (from experience). GCC does NOT know they are clobbered
exectly BECAUSE they are input registers. If they were output register,
that would be another matter. I had some weird bugs due to making the
same assumption as you.
Bill
--
Leave others their otherness.
- Raw text -