From: Phillip Susi <psusi@cfl.rr.com>
To: "linux-os (Dick Johnson)" <linux-os@analogic.com>
Cc: Jan Engelhardt <jengelh@linux01.gwdg.de>,
beware <wimille@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: Float numbers in module programming
Date: Thu, 30 Mar 2006 12:23:33 -0500 [thread overview]
Message-ID: <442C1415.6080906@cfl.rr.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0603300739050.32259@chaos.analogic.com>
linux-os (Dick Johnson) wrote:
> No. Any file I/O, or anything that takes time sleeps and gives up
> the CPU, ultimately calling schedule(). That means that anybody
> can have its coprocessor state dorked. This has been discussed many
The FPU state is saved across normal thread switches if either the new
or old thread uses the fpu, so this should be safe. Unless this does
not apply to kernel threads?
> times. Also, floating-point is never required for anything!!! It's
> just a convenience for people who like to write code using 10 fingers.
> It has real problems when trying to exactly represent real numbers.
> For instance __all__ real numbers, except for transcendentals, can
> be represented as a ratio of two integers. For instance, you can't
> represent 1/3 exactly as a decimal. It is, however exactly the ratio
> of 1 and 3, two integers. Given this, I'm sure you can find a way
> to perform high-precision mathematics within the kernel without
> using the coprocessor. Usually, it's just a little thought that
> is required. Somebody needs 8 bits to feed into a volume-control
> register, but the value needs to be log-scale. Trivial, even if
> you don't want to use a table.
>
Agreed, adjusting your thinking a bit to stick to integer math is
usually preferred for efficiency reasons.
> If you divulge the mathematics you need calculated, I'll bet you
> will get many answers from responders to the linux-kernel list.
> However, if you expect to use the coprocessor as part of an image
> processing routine and your driver was designed to use that
> coprocessor, then you need a private coprocessor or you need
> a user-space 'driver' that probably communicates using shared-
> memory, this not involving kernel code at all.
>
>
next prev parent reply other threads:[~2006-03-30 17:23 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-29 14:34 Float numbers in module programming beware
2006-03-29 15:02 ` linux-os (Dick Johnson)
2006-03-30 8:11 ` Jan Engelhardt
2006-03-30 13:09 ` linux-os (Dick Johnson)
2006-03-30 17:23 ` Phillip Susi [this message]
2006-04-03 6:55 ` Helge Hafting
2006-04-03 9:20 ` Jan Engelhardt
2006-03-30 17:31 ` Al Viro
2006-03-30 17:40 ` Roland Dreier
2006-03-30 18:02 ` Valdis.Kletnieks
2006-03-30 18:26 ` Andre Noll
2006-03-30 18:46 ` linux-os (Dick Johnson)
2006-03-31 7:57 ` Olivier Galibert
2006-03-31 11:05 ` Peter Williams
2006-03-29 15:07 ` Helge Hafting
2006-03-30 8:12 ` Jan Engelhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=442C1415.6080906@cfl.rr.com \
--to=psusi@cfl.rr.com \
--cc=jengelh@linux01.gwdg.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-os@analogic.com \
--cc=wimille@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.