Re: using doubles in the kernel

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

 



One reason immediately comes to mind.   This is especially true in interrupt
request handlers.  The handlers need to be as compact as possible as well as
being aligned on byte or word boundaries in memory.   On the newest 64-bit
processors (like the Ultra Sparc or the Itanium), it can be on double-word
boundaries. However, it is the expansion cards and devices (PCI, ISA, USB,
etc) that mainly dictate this. Also, many such cards and devices have
limited  memory spaces (NICs with onboard registers, for example).
Sometimes, handlers have to be within a certain memory size and location.

But if you do need to use single precision, float would be my suggestion.
Doubles will play havoc on alignment that many modules require. And doubles
are usually twice as large byte-wise as floating point on some platforms.

Just my two cents worth.

-- Derek.

----- Original Message -----
From: "Lars Olsson" <lo22@cogs.susx.ac.uk>
To: <kernelnewbies@nl.linux.org>
Sent: Saturday, 06 July, 2002 07:35
Subject: using doubles in the kernel


> Dear all,
> Is there any reason why you should not use doubles and floats in the
> kernel? I remember that someome said that you should not use floating
> point types but I can't remember where. I need to use floating point
> number since I'm implementing a neural network (executing in kernel
> space because of performance reasons) and it is alot easier to implement
> this with floating point numbers.
>
> cheers,
> lars
>
> --
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive:       http://mail.nl.linux.org/kernelnewbies/
> FAQ:           http://kernelnewbies.org/faq/
>
>

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux