[PLUG] Floating Point arithmetic in the Kernel

Manas Alekar maalekar at gmail.com
Tue Oct 23 13:55:43 IST 2007


Sadly, there is no way to define the state of the floating point unit in the
kernel. Also, the presence of an FPU is not an assumption you want to make.
Lastly, it is a headache to keep a track of where you can use and FPU and
where you cannot (Yes, you can use a global lock, but why incur that
overhead ?).

I guess the legacy comes from not wanting floating point codes double
faulting in kernel mode on 386.

Cheers,
Manas

On 8/18/07, श्रीधर नारायण दैठणकर <ghodechhap at ghodechhap.net> wrote:
>
> On Saturday 18 Aug 2007 20:08:12 Shantanoo Mahajan wrote:
> > Integer calculations are much more faster than floating point
> > calculations.
> > Generally, integer calculations are necessary and sufficient for the
> > things
> > done in kernel code. But if you really required floating point, you
> > can always
> > do that.
>
> Dumb question. Consider gettimeofday(). Whats the point of having two
> int/longs in a struct when a float would have sufficed? Not to mention
> calculating time interval etc are bit easier?
>
> Just a thought..
>
> Shridhar
>
> --
> ______________________________________________________________________
> Pune GNU/Linux Users Group Mailing List:      (plug-mail at plug.org.in)
> List Information:  http://plug.org.in/cgi-bin/mailman/listinfo/plug-mail
> Send 'help' to plug-mail-request at plug.org.in for mailing instructions.
>


More information about the Plug-mail mailing list