floating point in the kernel

2003-02-12 Thread Parveen Patel

Hi,

Can I use floating point operations inside the FreeBSD kernel version
4.7-stable? It used to be a policy not to use it for obvious performance
probelms.

Are there any known work arounds?
Like some standard efficient techniques to convert floating point
operations to fixed point operations without losing too much precision.

Thanks,
-Parveen.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message



Re: floating point in the kernel

2003-02-12 Thread Parveen Patel

Thanks for your response.
My only concern is a square root operation I have to do. Is there some
standard routine that will do it for long long or else I can pull out some
code from gnu/i386/fpemul to do my computations.

-Parveen.

On Wed, 12 Feb 2003, Dan Nelson wrote:

 In the last episode (Feb 12), Parveen Patel said:
  Can I use floating point operations inside the FreeBSD kernel version
  4.7-stable? It used to be a policy not to use it for obvious
  performance probelms.

 You're not supposed to.  I think this was the last time it was brought
 up:

 http://groups.google.com/groups?threadm=746alr%24d44%241%40FreeBSD.csie.NCTU.edu.tw

  Are there any known work arounds? Like some standard efficient
  techniques to convert floating point operations to fixed point
  operations without losing too much precision.

 Multiply your numbers by 10^9, store everything in long longs, and
 write your own printf_fake_fp function that shifts the decimal point?

 --
   Dan Nelson
   [EMAIL PROTECTED]




To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message



Re: floating point in the kernel

2003-02-12 Thread Kris Kennaway
On Wed, Feb 12, 2003 at 07:50:23PM -0700, Parveen Patel wrote:
 
 Thanks for your response.
 My only concern is a square root operation I have to do. Is there some
 standard routine that will do it for long long or else I can pull out some
 code from gnu/i386/fpemul to do my computations.

You probably should try to restructure your code so you don't need to
do this.

Kris



msg19133/pgp0.pgp
Description: PGP signature


Re: floating point in the kernel

2003-02-12 Thread Dan Nelson
In the last episode (Feb 12), Parveen Patel said:
 Can I use floating point operations inside the FreeBSD kernel version
 4.7-stable? It used to be a policy not to use it for obvious
 performance probelms.

You're not supposed to.  I think this was the last time it was brought
up:

http://groups.google.com/groups?threadm=746alr%24d44%241%40FreeBSD.csie.NCTU.edu.tw

 Are there any known work arounds? Like some standard efficient
 techniques to convert floating point operations to fixed point
 operations without losing too much precision.

Multiply your numbers by 10^9, store everything in long longs, and
write your own printf_fake_fp function that shifts the decimal point?

-- 
Dan Nelson
[EMAIL PROTECTED]

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message



Re: floating point in the kernel

2003-02-12 Thread Dan Nelson
In the last episode (Feb 12), Parveen Patel said:
 Thanks for your response. My only concern is a square root operation
 I have to do. Is there some standard routine that will do it for long
 long or else I can pull out some code from gnu/i386/fpemul to do my
 computations.

Try http://www.azillionmonkeys.com/qed/sqroot.html , which has a whole
bunch of sqrt functions.  Also remember that if you're only comparing
the sqrt to something else, it may be easier to square the rest of the
equation instead.

-- 
Dan Nelson
[EMAIL PROTECTED]

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message