spot_imgspot_img

Going On A Tangent With The Intel 8087’s Hybrid CORDIC Algorithm

- Advertisement -


Persevering with their reverse-engineering of Intel’s 8087 FPU, [Ken Shirriff] and mates took a have a look at one of many trigonometric capabilities, particularly FPTAN.  Essentially the most thrilling half with such reverse-engineering might be determining which algorithm was used within the implementation, whereas attempting to find out the reasoning behind the ultimate {hardware} design.

In the event you’re operating a easy MCU or MPU just like the 6502 or Z80 with out {hardware} capabilities you’d possible use an algorithm similar to CORDIC or related, as this requires solely primary {hardware} options like addition, subtraction, bitshift, and look-up tables. One also can use polynomial approximation if there’s {hardware} assist for a possible speed-up, or as is the case within the 8087, create a hybrid strategy that targets velocity and accuracy.

Within the article the precise implementation to get to 64 bits of accuracy is detailed, beginning with the 16 bits calculated utilizing CORDIC earlier than switching to the Padé approximant approach involving the ratio of two polynomials. Since after calculating the brunt of the ultimate worth with CORDIC the rest is a reasonably small worth this polynomial approximation not simply very correct but additionally quick.

This strategy permits the FPTAN and related trigonometric capabilities on this FPU to hit a really excessive degree of accuracy and never require the look-up desk sizes and extra time required to work by means of the remaining bits with CORDIC. For many who need to see the total algorithm Intel’s engineers used, [Ken] has the total microcode itemizing with feedback within the article as nicely.

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

With the Pentium sequence of CPUs Intel moved fully away from CORDIC, because it’s clear that as correct as it could be, it’s arduous to scale to a big variety of bits with out incurring important time penalties. With the introduction of SIMD directions the x87 ISA has additional seen its performance decreased, however this evaluation exhibits as soon as once more why the 8087 made such an influence when it was launched.

- Advertisement -

Related Articles

Latest Articles