bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simple contribution please?


From: Samuel Thibault
Subject: Re: Simple contribution please?
Date: Wed, 17 Aug 2016 10:50:56 +0200
User-agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)

Richard Braun, on Wed 17 Aug 2016 10:43:46 +0200, wrote:
> On Wed, Aug 17, 2016 at 08:46:34AM +0200, Samuel Thibault wrote:
> > - Are we sure that the direction flag is cleared on entry of the assembly
> > snippets?
> 
> Yes, gcc makes sure it's cleared on entry. See [1] for reference.

Ok :)

> > - I don't think the memcmp, strlen and strcmp snippets need a memory 
> > clobber?
> 
> I'm not sure. Nothing here tells the compiler that the memory
> referenced is read and I don't know what kind of side effects this
> could introduce. After a bit of research, I found this message [2]
> which seems to support this thinking.

Mmm. This is a clobber, so it's supposed to indicate what is written,
not what is read :) But I agree with the "move" rationale, let's be safe
(it doesn't really matter here, there's a memory compiler barrier at the
function call anyway).

> > - should we really use assembly snippets for strcpy and strcmp? In my
> >   non-virtualized tests, a simple C loop such as
> >   do { test = *dest++ = *src++; } while(test);
> >   actually goes quite faster thanks to the gcc optimizer, and the
> >   non-rep snippet won't buy virtualized time (and I guess we don't run
> >   str functions on memory-mapped devices anyway...)
> 
> Actually, assembly isn't used for these functions. Take a look at the
> ARCH_STRING_XXX macros at the beginning of the file.

Ah, ok.

Samuel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]