Date: Thu, 12 Jun 1997 15:50:22 -0700 From: Bill Currie Subject: Re: Inline asm To: Calin Andrian Cc: djgpp AT delorie DOT com Reply-to: billc AT blackmagic DOT tait DOT co DOT nz Message-id: <33A07D2D.D22@blackmagic.tait.co.nz> Organization: Tait Electronics NZ MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit References: <16 AT candrian DOT pcnet DOT ro> Precedence: bulk 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.