[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: PATCH: mount -O list
From:       Michael Abbott <michael () araneidae ! co ! uk>
Date:       2009-12-04 16:04:31
Message-ID: alpine.DEB.1.10.0912041550410.28657 () venus ! araneidae ! co ! uk
[Download RAW message or body]

On Fri, 4 Dec 2009, Denys Vlasenko wrote:
> On Fri, Dec 4, 2009 at 2:06 PM, Michael Abbott <michael@araneidae.co.uk> wrote:
> > On Fri, 4 Dec 2009, Denys Vlasenko wrote:
> >> On Fri, Dec 4, 2009 at 1:48 PM, Michael Abbott <michael@araneidae.co.uk> wrote:
> >> > On Fri, 4 Dec 2009, walter harms wrote:
> >> >> Michael Abbott schrieb:
> >> >> > 3. strchrnul() -- oh, that is nice!  Is that a busybox special function?
> >> >> > It doesn't seem to be part of glibc.  Of course, makes the step on to the
> >> >> > next item at the end of the loop slightly more clunky.
> >> On the contrary, it makes the step smaller. I checked code size.
> >
> > Intruiging.
> >
> > I was only referring to the difference between
> >        if (!O_comma)
> >                break;
> > and
> >        if (O_opt[O_len] == '\0')
> >                break;
> > and now think I was talking nonsense, each is as clear as each other. 
> >  Of course the first is (potentially) just a register access, while 
> > the second definitely fetches ram
> For that, O_comma needs to survive in register through two nested loops. 
> Not likely, unless your CPU has 64+ registers. gcc spills it into a 
> stack slot.

Well, you piqued my interest with this: my experience with the ARM is that 
its register optimisation is rather good, and in fact 8 persistent 
variable registers plus up to 6 scratch registers (lost by subroutine 
calls) is normally ample: I've compiled the first variant of my code with 
-O2 -S with gcc 4.3.2, and although the resulting assembler is really 
rather opaque (*lots* of branching around makes understanding the flow 
painful), it's pretty clear that O_comma survives in a register; nothing 
is written to store by this routine.

And in fact the compiler clearly has registers to spare.

Of course on the x86 you have *no* registers to speak of... as I recall 
it, the ABI requires everything to be passed on the stack!

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic