Forums

Forums (http://www.abandonia.com/vbullet/index.php)
-   Programming (http://www.abandonia.com/vbullet/forumdisplay.php?f=25)
-   -   Using the math coprocessor? (http://www.abandonia.com/vbullet/showthread.php?t=25918)

The Fifth Horseman 06-10-2010 09:45 AM

Using the math coprocessor?
 
Hi,
I've been recently looking into algorithms for identifying nth root of a number.
It appears that in order to achieve maximum efficiency, I should implement the algorithm so that the FPU coprocessor is being used for the floating-point operations rather than the main CPU.

My question is fairly simple: Where can I find some documentation to get started? My usual sources of reference for C++ programming produce nothing at all.

Kippesoep 06-10-2010 10:13 AM

That's because it's not needed. Current compilers will automatically use the FPU when you use floating point math. Just use floats or doubles and you will automatically benefit from the FPU, unless you explicitly enable emulation (which was used for pre-Pentium processors).

Japo 06-10-2010 10:15 PM

Most modern CPUs don't have a math co-processor "per se" any longer, at least according to the Wikipedia. I would be surprised to hear that you need to tell a compiler how to do each floating point operation. I think you're off track, although I know nothing specific to this.

Kanalia 27-03-2011 09:48 AM

Yep, just like Japo said, FPUs (or "math coprocessors") that are outside of the main CPU's die are a thing of the past. Since the times when Intel Pentium Pro/Pentium II processors reigned over the desktop highlands, FPUs sit inside the main CPU.

If you REALLY need to specifically do something on the FPU, you'd have to resort to some kind of specific math library for C/C++ or resort to x86 assembler code. Other then that, the compiler does the job for ya, just like Kippesoep said.


The current time is 02:27 AM (GMT)

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.