tech-kern archive

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

Re: Make condition variables take absolute wakeup time



In article <200805071605.MAA14765%Sparkle.Rodents.Montreal.QC.CA@localhost> der 
wrote:
: > These days, does hz >> 2 ever generate better code than hz / 4?

: <kernel.h> says hz is signed, so, if shifts are faster than divides, I
: would expect >>2 to be faster than /4.  If the hardware doesn't have a
: signed-integer divide but does have shifts (eg, least common
: denominator sparc32), >>2 should be smaller than /4 too.

  Actually, I would expect modern compilers to know that and convert
/4 into >>2 internally, when advantageous.  IIUC, we are talking about
constants here.

                                        yours,
                                        dillo


Home | Main Index | Thread Index | Old Index