svn commit: r220632 - head/sys/x86/x86

Jung-uk Kim jkim at FreeBSD.org
Thu Apr 14 18:06:19 UTC 2011


On Thursday 14 April 2011 01:08 pm, Jung-uk Kim wrote:
> Author: jkim
> Date: Thu Apr 14 17:08:23 2011
> New Revision: 220632
> URL: http://svn.freebsd.org/changeset/base/220632
>
> Log:
>   Use newly added rdtsc32() for the timecounter_get_t method.

It only seems to make big difference in amd64, probably because 
rdtsc() is implemented differently in inline asm.

tsc_get_timecount (before):
        pushq   %rbp
        movq    %rsp, %rbp
        rdtsc
        mov     %eax, %eax
        salq    $32, %rdx
        leave
        orq     %rax, %rdx
        movl    %edx, %eax
        ret

tsc_get_timecount (after):
        pushq   %rbp
        movq    %rsp, %rbp
        rdtsc
        leave
        ret

Similar problem was also observed when it is inlined.

BTW, clang does not have this issue. :-)

Jung-uk Kim


More information about the svn-src-head mailing list