|
From: Daniel J S. <dan...@ie...> - 2006-09-25 01:48:03
|
Joe Koski wrote: > My total knowledge of this subject consists of owning a copy of Abramowitz > and Stegun, so please excuse me it the following is a red herring. > > On his daily blog on the g95 website, g95.sourceforge.net, Andy Vaught wrote > ===================== > September 6 > Bill McKie pointed out that x86/OSX wasn't trapping overflows during real > exponentiation. It turns out that OSX uses the MMX unit to do exponentiation > instead of the x87. So I added code to set the bits for MMX traps. Not only > does the MMX exponentiation use about six times the code that the x87 uses, > but it turns out that OSX doesn't handle traps from the MMX unit correctly > either, reporting only a generic floating point exception. To add insult to > injury, it takes about 3/4 of second (!) to process a floating point > exception on OSX, be it x86 or powerpc. > > September 13 > The origin of this problem was detecting overflow during exponentiation on > OSX/386, which uses the SSE unit to do the math. I ran a speed test > comparing exponentiation using the SSE unit with x87, and the x87 is 25% > faster, and delivers a more accurate result because the intermediate > quantities are carried to 64 bits in the mantissa. So the solution is not to > bend over backwards for the SSE unit, but rather use the x87 for > exponentiation where it is available. > ===================== Wonder why they would choose that? The extra instructions to set up the MMX registers only pays off, I think, when one actually uses the multiple registers. For a single computation, the more general and common approach would be better... They aren't expecting an MMX version of gnuplot, I hope. ;-) Dan |