lkml.org 
[lkml]   [2004]   [Mar]   [17]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateWed, 17 Mar 2004 13:17:30 -0500
FromChris Friesen <>
SubjectRe: arithmetic functions for linux driver
VINOD GOPAL wrote:
> Hi,
>  I am new to linux world and this mailing list.
> 
>  I need to use the arithmetic functions like sin, cos,
> exp, log, etc in linux device driver.
> 
>  On search read , not to use libm from kernel driver
> as it will harm the fpu registers.
> 
>   Do you have any insight how to support these
> functions in linux driver or any code that is
> available which I can make use of?

Best would be to try and have userspace do it for you.

If you really need to do it in the kernel on the fly, you'll need to either

1) save and restore the floating point context yourself
2) use fixed point calculations

As an optimization for 2, you could pre-calculate some lookup tables and 
interpolate.


Chris


-- 
Chris Friesen                    | MailStop: 043/33/F10
Nortel Networks                  | work: (613) 765-0557
3500 Carling Avenue              | fax:  (613) 765-2986
Nepean, ON K2H 8E9 Canada        | email: cfriesen@nortelnetworks.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:01    [from the cache]
©2003-2008