Subject: Re: C runqueue
To: David Laight <david@l8s.co.uk>
From: Charles M. Hannum <abuse@spamalicious.com>
List: port-i386
Date: 10/23/2002 16:55:02
> It has to be faster to do:
> movzbl P_PRIORITY(%eax),%cl
> shrb $1,%cl
> shrb $1,%cl
> movl $1,%edx
> shrl %cl,%edx
> orl %edx,_C_LABEL(sched_whichqs)
> leal _C_LABEL(sched_qs)(,%ecx,8),%ecx
> Although that is a rather long chain of dependant instructions.
Certainly not on a P4. In addition to the variable shift being slow,
you're also using a shift in the LEA instruction, whereas I'm using
just an add. Even going to L2 cache, my code should be faster on the
P4.