mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Linux Kernel Floating Point Emulation and CORDIC
@ 1999-12-23 23:58 Arthur Jerijian
  1999-12-24  1:50 ` Brian Gerst
  0 siblings, 1 reply; 4+ messages in thread
From: Arthur Jerijian @ 1999-12-23 23:58 UTC (permalink / raw)
  To: linux-kernel

For the mathematics and theoretical computer science enthusiasts here on this
list:

I have taken a look at the source code of the Linux Kernel floating point
emulation engine for i386 (as of 2.2.12, don't know if it changed in 2.3.x). I
noticed that it uses Taylor/Maclaurin polynomials to approximate the sine,
cosine, tangent, and inverse tangent functions. Wouldn't CORDIC be a better
algorithm for computing trigonometric and exponential functions instead? CORDIC
is a method for calculating mathematical functions using only addition,
shifting, and looking up entries in a table. More details can be found at 
http://www.ezcomm.com/%7Ecyliax/Articles/RobNav/sidebar.html

Thanks,
--Arthur

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Linux Kernel Floating Point Emulation and CORDIC
  1999-12-23 23:58 Linux Kernel Floating Point Emulation and CORDIC Arthur Jerijian
@ 1999-12-24  1:50 ` Brian Gerst
  1999-12-24 17:11   ` Matthew Wilcox
  0 siblings, 1 reply; 4+ messages in thread
From: Brian Gerst @ 1999-12-24  1:50 UTC (permalink / raw)
  To: Linux kernel mailing list

Arthur Jerijian wrote:
> 
> For the mathematics and theoretical computer science enthusiasts here on this
> list:
> 
> I have taken a look at the source code of the Linux Kernel floating point
> emulation engine for i386 (as of 2.2.12, don't know if it changed in 2.3.x). I
> noticed that it uses Taylor/Maclaurin polynomials to approximate the sine,
> cosine, tangent, and inverse tangent functions. Wouldn't CORDIC be a better
> algorithm for computing trigonometric and exponential functions instead? CORDIC
> is a method for calculating mathematical functions using only addition,
> shifting, and looking up entries in a table. More details can be found at
> http://www.ezcomm.com/%7Ecyliax/Articles/RobNav/sidebar.html

I don't think it's worth the effort to rewrite and retest the FP
emulation code.  It is only needed on some 386 and 486 machines, as all
pentiums and later always have built in FPUs.  Nobody should be doing
any serious number crunching on those old processors.  Just my 2 cents
though.

-- 

						Brian Gerst

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Linux Kernel Floating Point Emulation and CORDIC
  1999-12-24  1:50 ` Brian Gerst
@ 1999-12-24 17:11   ` Matthew Wilcox
  0 siblings, 0 replies; 4+ messages in thread
From: Matthew Wilcox @ 1999-12-24 17:11 UTC (permalink / raw)
  To: Brian Gerst; +Cc: Linux kernel mailing list

On Thu, Dec 23, 1999 at 08:50:47PM -0500, Brian Gerst wrote:
> I don't think it's worth the effort to rewrite and retest the FP
> emulation code.  It is only needed on some 386 and 486 machines, as all
> pentiums and later always have built in FPUs.  Nobody should be doing
> any serious number crunching on those old processors.  Just my 2 cents
> though.

But not all the world is intel -- there is FP emulation code for Alpha,
ARM, MIPS, m68k, PPC and Sparc in the tree.  However, I seem to remember
someone analysing the FP emulator (on ARM) and concluding that the
cost of emulating FP instructions was dominated by the trap handler
and instruction decode.  So there's not much point in replacing the
algorithms with more efficient algorithms when it's not going to make
much difference.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Linux Kernel Floating Point Emulation and CORDIC
@ 1999-12-24 22:53 nathan.zook
  0 siblings, 0 replies; 4+ messages in thread
From: nathan.zook @ 1999-12-24 22:53 UTC (permalink / raw)
  To: lightmanaj, linux-kernel

EEEEEwwww!  Cordic is UGLY!  There is a reason that Intel & we (AMD) have
gone with polyonmial & rational function approximations.  BTW, our
algorithms are quite accurate.  If you are running in another world, or just
want to emulate, look into equal-ripple approximations.  You will chew some
serious processor power finding good functions, but what you get can be
nice.

Nathan


> -----Original Message-----
> From:	Arthur Jerijian [SMTP:lightmanaj@earthlink.net]
> Sent:	Thursday, December 23, 1999 5:58 PM
> To:	linux-kernel@vger.rutgers.edu
> Subject:	Linux Kernel Floating Point Emulation and CORDIC
> 
> For the mathematics and theoretical computer science enthusiasts here on
> this
> list:
> 
> I have taken a look at the source code of the Linux Kernel floating point
> emulation engine for i386 (as of 2.2.12, don't know if it changed in
> 2.3.x). I
> noticed that it uses Taylor/Maclaurin polynomials to approximate the sine,
> cosine, tangent, and inverse tangent functions. Wouldn't CORDIC be a
> better
> algorithm for computing trigonometric and exponential functions instead?
> CORDIC
> is a method for calculating mathematical functions using only addition,
> shifting, and looking up entries in a table. More details can be found at 
> http://www.ezcomm.com/%7Ecyliax/Articles/RobNav/sidebar.html
> 
> Thanks,
> --Arthur
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.rutgers.edu
> Please read the FAQ at http://www.tux.org/lkml/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1999-12-24 22:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-12-23 23:58 Linux Kernel Floating Point Emulation and CORDIC Arthur Jerijian
1999-12-24  1:50 ` Brian Gerst
1999-12-24 17:11   ` Matthew Wilcox
1999-12-24 22:53 nathan.zook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®