Skip to contentSkip to conversation

Linux Kernel Floating Point Emulation and CORDIC

DISCUSSION Arthur Jerijian 3 participants 3 messages Dec 24, 1999

lore
Share & tools
lore
#0 lore raw

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 [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#1 lore raw
Quoted 4 lines · Arthur Jerijian

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

Quoted 8 lines

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.

Signature · 6 lines
						Brian Gerst

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/
#2 lore raw
Quoted 5 lines · Brian Gerst

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 [email protected]
Please read the FAQ at http://www.tux.org/lkml/