Trending
PT Health Watch: How Pregnancy-Induced Hypertension puts mother, baby at risk is trending now As shawarma consumption soars among Nigerians, experts fear cancer, kidney disease rise is trending now Healthy living: Wetin you fit do now to stay healthy for your 70s is trending now Tonga's volcano looked small, but researchers say its collapse may have supercharged a ts… is trending now On this day in space! Sept. 27, 1997: NASA's Mars Pathfinder lander sends its last transm… is trending now Scientists discover two new species of sea spiders along Canadian coastline is trending now Nigerian Scientist Achieves Breakthrough In Quantum Technology is trending now Women's Super League: Why are Arsenal struggling to score goals? is trending now AFCON 2027 qualifiers: Top goalscorers after Matchday 1 is trending now Spain beat North Korea on penalties to win 2026 U20 Women’s World Cup is trending now Orjan Nyland horror mistake hands Portugal victory as Goncalo Ramos strikes to spoil Erli… is trending now Why December? Reasons Some Filmmakers Prefer the Festive Season for Cinema Releases is trending now PT Health Watch: How Pregnancy-Induced Hypertension puts mother, baby at risk is trending now As shawarma consumption soars among Nigerians, experts fear cancer, kidney disease rise is trending now Healthy living: Wetin you fit do now to stay healthy for your 70s is trending now Tonga's volcano looked small, but researchers say its collapse may have supercharged a ts… is trending now On this day in space! Sept. 27, 1997: NASA's Mars Pathfinder lander sends its last transm… is trending now Scientists discover two new species of sea spiders along Canadian coastline is trending now Nigerian Scientist Achieves Breakthrough In Quantum Technology is trending now Women's Super League: Why are Arsenal struggling to score goals? is trending now AFCON 2027 qualifiers: Top goalscorers after Matchday 1 is trending now Spain beat North Korea on penalties to win 2026 U20 Women’s World Cup is trending now Orjan Nyland horror mistake hands Portugal victory as Goncalo Ramos strikes to spoil Erli… is trending now Why December? Reasons Some Filmmakers Prefer the Festive Season for Cinema Releases is trending now
Technology

Going on a Tangent with the Intel 8087’s Hybrid CORDIC Algorithm

Going on a Tangent with the Intel 8087’s Hybrid CORDIC Algorithm

Continuing their reverse-engineering of Intel’s 8087 FPU, [Ken Shirriff] and friends took a look at one of the trigonometric functions, specifically FPTAN.  The most exciting part with such reverse-engineering is …read more

Continuing their reverse-engineering of Intel’s 8087 FPU, [Ken Shirriff] and friends took a look at one of the trigonometric functions, specifically FPTAN.  The most exciting part with such reverse-engineering is probably figuring out which algorithm was used in the implementation, while trying to determine the reasoning behind the final hardware design.

If you’re running a simple MCU or MPU like the 6502 or Z80 without hardware functions you’d likely use an algorithm such as CORDIC or similar, as this requires only basic hardware features like addition, subtraction, bitshift, and look-up tables. One can also use polynomial approximation if there’s hardware support for a potential speed-up, or as is the case in the 8087, create a hybrid approach that targets speed and accuracy.

In the article the exact implementation to get to 64 bits of accuracy is detailed, starting with the 16 bits calculated using CORDIC before switching to the Padé approximant technique involving the ratio of two polynomials. Since after calculating the brunt of the final value with CORDIC the remainder is a fairly small value this polynomial approximation not just very accurate but also fast.

This approach allows the FPTAN and similar trigonometric functions in this FPU to hit a very high level of accuracy and not require the look-up table sizes and additional time required to work through the remaining bits with CORDIC. For those who want to see the full algorithm Intel’s engineers used, [Ken] has the full microcode listing with comments in the article as well.

As for the exact speed-up from this approach, [Ken] calculates for one value that FPTAN would spend 33% on CORDIC pseudo-division, 47% on CORDIC pseudo-multiplication and a mere 15% on the polynomial approximation along with about 5% overhead.

With the Pentium series of CPUs Intel moved completely away from CORDIC, as it’s clear that as accurate as it may be, it’s hard to scale to a significant number of bits without incurring significant time penalties. With the introduction of SIMD instructions the x87 ISA has further seen its functionality reduced, but this analysis shows once again why the 8087 made such an impact when it was released.

View original source →

Related

More from Hackaday Blog