* Floating Point Operation in Kernel
@ 2006-12-12 21:16 jimmy liu
2006-12-12 22:09 ` Grant Likely
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: jimmy liu @ 2006-12-12 21:16 UTC (permalink / raw)
To: linuxppc-embedded
I am writing a module which need be integrated to the
linux kernel with floating point operations for
mpc82xx. The kernel does not provide support for
floating point operations. Does anybody have good idea
to implement it or make it to work around?
____________________________________________________________________________________
Yahoo! Music Unlimited
Access over 1 million songs.
http://music.yahoo.com/unlimited
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Floating Point Operation in Kernel
2006-12-12 21:16 Floating Point Operation in Kernel jimmy liu
@ 2006-12-12 22:09 ` Grant Likely
2006-12-13 1:45 ` Carlos Munoz
2006-12-14 23:19 ` Andrew E. Mileski
2 siblings, 0 replies; 6+ messages in thread
From: Grant Likely @ 2006-12-12 22:09 UTC (permalink / raw)
To: jimmy liu; +Cc: linuxppc-embedded
On 12/12/06, jimmy liu <jimmyzhmliu@yahoo.com> wrote:
> I am writing a module which need be integrated to the
> linux kernel with floating point operations for
> mpc82xx. The kernel does not provide support for
> floating point operations. Does anybody have good idea
> to implement it or make it to work around?
The official answer is: "Don't do that." :)
Here's the more generous reply: The kernel explicitly does not
support floating point in the kernel. Save/restore on floating point
registers is expensive. In fact, IIRC, floating point registers for
user space use 'lazy save/restore'; ie. the registers are not saved on
every context switch; they are only saved if another user space
process tries to perform FP operations.
To support FP access in kernel space means you must fit your code into
the already complex FP save/restore state machine; or you need to
disable all interrupts and perform your own FP register save/restore
within the context of your driver. And it's a pretty safe bet that
you'll have trouble getting the driver into mainline.
Why do you need kernel space FP?
--
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Floating Point Operation in Kernel
2006-12-12 21:16 Floating Point Operation in Kernel jimmy liu
2006-12-12 22:09 ` Grant Likely
@ 2006-12-13 1:45 ` Carlos Munoz
2006-12-13 16:20 ` jimmy liu
2006-12-14 23:19 ` Andrew E. Mileski
2 siblings, 1 reply; 6+ messages in thread
From: Carlos Munoz @ 2006-12-13 1:45 UTC (permalink / raw)
To: jimmy liu; +Cc: linuxppc-embedded
jimmy liu wrote:
>I am writing a module which need be integrated to the
>linux kernel with floating point operations for
>mpc82xx. The kernel does not provide support for
>floating point operations. Does anybody have good idea
>to implement it or make it to work around?
>
>
>
>
>____________________________________________________________________________________
>Yahoo! Music Unlimited
>Access over 1 million songs.
>http://music.yahoo.com/unlimited
>_______________________________________________
>Linuxppc-embedded mailing list
>Linuxppc-embedded@ozlabs.org
>https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
>
What exactly is the floating point operation you need to implement ?
Carlos
--
There are two rules for success in life:
1) Never tell everything you know.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Floating Point Operation in Kernel
2006-12-13 1:45 ` Carlos Munoz
@ 2006-12-13 16:20 ` jimmy liu
2006-12-13 16:35 ` Ben Warren
0 siblings, 1 reply; 6+ messages in thread
From: jimmy liu @ 2006-12-13 16:20 UTC (permalink / raw)
To: Carlos Munoz; +Cc: linuxppc-embedded
We has a hardware driver need the floating point
operation to do timing recover. Maybe, we have to do
it in user space.
--- Carlos Munoz <carlos@kenati.com> wrote:
> jimmy liu wrote:
>
> >I am writing a module which need be integrated to
> the
> >linux kernel with floating point operations for
> >mpc82xx. The kernel does not provide support for
> >floating point operations. Does anybody have good
> idea
> >to implement it or make it to work around?
> >
> >
> >
> >
>
>____________________________________________________________________________________
> >Yahoo! Music Unlimited
> >Access over 1 million songs.
> >http://music.yahoo.com/unlimited
> >_______________________________________________
> >Linuxppc-embedded mailing list
> >Linuxppc-embedded@ozlabs.org
>
>https://ozlabs.org/mailman/listinfo/linuxppc-embedded
> >
> >
> What exactly is the floating point operation you
> need to implement ?
>
>
> Carlos
>
> --
> There are two rules for success in life:
> 1) Never tell everything you know.
>
>
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Floating Point Operation in Kernel
2006-12-13 16:20 ` jimmy liu
@ 2006-12-13 16:35 ` Ben Warren
0 siblings, 0 replies; 6+ messages in thread
From: Ben Warren @ 2006-12-13 16:35 UTC (permalink / raw)
To: jimmy liu; +Cc: linuxppc-embedded
On Wed, 2006-12-13 at 08:20 -0800, jimmy liu wrote:
> We has a hardware driver need the floating point
> operation to do timing recover. Maybe, we have to do
> it in user space.
>
Have you considered doing the math in fixed point instead? I realize
that certain data sets make this difficult but this has been a standard
technique in resource-constrained systems forever.
regards,
Ben
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Floating Point Operation in Kernel
2006-12-12 21:16 Floating Point Operation in Kernel jimmy liu
2006-12-12 22:09 ` Grant Likely
2006-12-13 1:45 ` Carlos Munoz
@ 2006-12-14 23:19 ` Andrew E. Mileski
2 siblings, 0 replies; 6+ messages in thread
From: Andrew E. Mileski @ 2006-12-14 23:19 UTC (permalink / raw)
To: linuxppc-embedded
jimmy liu wrote:
> I am writing a module which need be integrated to the
> linux kernel with floating point operations for
> mpc82xx. The kernel does not provide support for
> floating point operations. Does anybody have good idea
> to implement it or make it to work around?
How about my fixed point routines. They use S31.32 fixed format, which
is often better precision than using floats, though it has less range.
Awkward to use, but handy when you absolutely need to.
I originally wrote it for MP3 decoding on ARM, but it should be
portable to anything supporting "signed long long" format (hence
the name). http://cvs.isoar.ca/math-sll/
--
Andrew E. Mileski
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-12-15 0:13 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-12 21:16 Floating Point Operation in Kernel jimmy liu
2006-12-12 22:09 ` Grant Likely
2006-12-13 1:45 ` Carlos Munoz
2006-12-13 16:20 ` jimmy liu
2006-12-13 16:35 ` Ben Warren
2006-12-14 23:19 ` Andrew E. Mileski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).