Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Oct 2001 13:41:02 -0800 (PST)
From:      Kelly Yancey <kbyanc@posi.net>
To:        Bakul Shah <bakul@bitblocks.com>
Cc:        Poul-Henning Kamp <phk@critter.freebsd.dk>, Peter Jeremy <peter.jeremy@alcatel.com.au>, Peter Wemm <peter@wemm.org>, arch@FreeBSD.ORG
Subject:   Re: 64 bit times revisited.. 
Message-ID:  <Pine.BSF.4.21.0110311322110.38054-100000@gateway.posi.net>
In-Reply-To: <200110312104.QAA16756@wellington.cnchost.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 31 Oct 2001, Bakul Shah wrote:

> > Using double in the kernel is not needed.
> 
> Not needed because...?
> 
> Actually double arithmetic is even faster! 45ns for divide on
> the same machine where I get 130ns for long long divide.  In
> the program I posted change all long long to double and fix
> up io conversion.  Changing it to long double yields 62ns;
> still faster than long long.  I bet your 128 bit fixed point
> will be much worse.
> 

  Yes, but to use floating-point in the kernel would require architectures
like the x86 to save the fp state on every context switch[*]. If my memory
serves me, FNSAVE on the x86 takes a heck of a lot longer than 130ns for all
current processor models.

  Kelly

[*] Actually, you wouldn't have to save fp state on every context switch,
    instead you could just set the CR0.TS bit on entry to the kernel, so that
    if the kernel were to use fp registers, a DNA exception would be thrown
    allowing the fp state to be saved. If I read i386/support.s right, this
    is not implemented and it is doubtful it would be worth implementing.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0110311322110.38054-100000>