Source-Changes archive

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

Re: CVS commit: src/sys/arch



On Mon, Mar 10, 2008 at 10:03:40PM +0000, Andrew Doran wrote:
> 
> Log Message:
> Implement an optimized, preemption-safe asm version of tsc_get_timecount().
> The C version needs work to be preemption safe. Cuts the clock cycles
> for microtime() from 950 down to 300 on a Pentium D.

I'm not sure about this bit:

+       movl    $0, %edx
+       subl    CC_CC(%edi), %eax       /* cc -= cc->cc_cc; */
+       adcl    $0, %edx                /* if (cc < 0) cc += 0x100000000; */
+       mull    CC_DELTA(%edi)          /* rcc = (cc * ci->ci_cc.cc_delta) */
+       divl    CC_DENOM(%edi)          /*     / ci->ci_cc.cc_denom */
+       addl    CC_VAL(%edi), %eax      /*     + ci->ci_cc.cc_val; */

I thought 'mull' did '%edx:%eax = %eax * mem32' so the value of %edx
on entry is rather irrelevant.

I'd also have thought it would be possible to do 'multiply by reciprocal'
instead of divide.

        David

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index