Floating-point unit explained

A floating-point unit (FPU, colloquially a math coprocessor) is a part of a computer system specially designed to carry out operations on floating-point numbers.[1] Typical operations are addition, subtraction, multiplication, division, and square root. Some FPUs can also perform various transcendental functions such as exponential or trigonometric calculations, but the accuracy can be low,[2] [3] so some systems prefer to compute these functions in software.

In general-purpose computer architectures, one or more FPUs may be integrated as execution units within the central processing unit; however, many embedded processors do not have hardware support for floating-point operations (while they increasingly have them as standard).

When a CPU is executing a program that calls for a floating-point operation, there are three ways to carry it out:

History

In 1954, the IBM 704 had floating-point arithmetic as a standard feature, one of its major improvements over its predecessor the IBM 701. This was carried forward to its successors the 709, 7090, and 7094.

In 1963, Digital announced the PDP-6, which had floating point as a standard feature.[4]

In 1963, the GE-235 featured an "Auxiliary Arithmetic Unit" for floating point and double-precision calculations.[5]

Historically, some systems implemented floating point with a coprocessor rather than as an integrated unit (but now in addition to the CPU, e.g. GPUsthat are coprocessors not always built into the CPUhave FPUs as a rule, while first generations of GPUs did not). This could be a single integrated circuit, an entire circuit board or a cabinet. Where floating-point calculation hardware has not been provided, floating-point calculations are done in software, which takes more processor time, but avoids the cost of the extra hardware. For a particular computer architecture, the floating-point unit instructions may be emulated by a library of software functions; this may permit the same object code to run on systems with or without floating-point hardware. Emulation can be implemented on any of several levels: in the CPU as microcode, as an operating system function, or in user-space code. When only integer functionality is available, the CORDIC methods are most commonly used for transcendental function evaluation.

In most modern computer architectures, there is some division of floating-point operations from integer operations. This division varies significantly by architecture; some have dedicated floating-point registers, while some, like Intel x86, go as far as independent clocking schemes.[6]

CORDIC routines have been implemented in Intel x87 coprocessors (8087,[7] [8] [9] [10] [11] 80287,[11] [12] 80387[11] [12]) up to the 80486[7] microprocessor series, as well as in the Motorola 68881[7] [8] and 68882 for some kinds of floating-point instructions, mainly as a way to reduce the gate counts (and complexity) of the FPU subsystem.

Floating-point operations are often pipelined. In earlier superscalar architectures without general out-of-order execution, floating-point operations were sometimes pipelined separately from integer operations.

The modular architecture of Bulldozer microarchitecture uses a special FPU named FlexFPU, which uses simultaneous multithreading. Each physical integer core, two per module, is single-threaded, in contrast with Intel's Hyperthreading, where two virtual simultaneous threads share the resources of a single physical core.[13] [14]

Floating-point library

Some floating-point hardware only supports the simplest operations: addition, subtraction, and multiplication. But even the most complex floating-point hardware has a finite number of operations it can supportfor example, no FPUs directly support arbitrary-precision arithmetic.

When a CPU is executing a program that calls for a floating-point operation that is not directly supported by the hardware, the CPU uses a series of simpler floating-point operations. In systems without any floating-point hardware, the CPU emulates it using a series of simpler fixed-point arithmetic operations that run on the integer arithmetic logic unit.

The software that lists the necessary series of operations to emulate floating-point operations is often packaged in a floating-point library.

Integrated FPUs

In some cases, FPUs may be specialized, and divided between simpler floating-point operations (mainly addition and multiplication) and more complicated operations, like division. In some cases, only the simple operations may be implemented in hardware or microcode, while the more complex operations are implemented as software.

In some current architectures, the FPU functionality is combined with SIMD units to perform SIMD computation; an example of this is the augmentation of the x87 instructions set with SSE instruction set in the x86-64 architecture used in newer Intel and AMD processors.

Add-on FPUs

See main article: Coprocessor. Several models of the PDP-11, such as the PDP-11/45,[15] PDP-11/34a,[16] PDP-11/44, and PDP-11/70, supported an add-on floating-point unit to support floating-point instructions. The PDP-11/60, MicroPDP-11/23[17] and several VAX models[18] [19] could execute floating-point instructions without an add-on FPU (the MicroPDP-11/23 required an add-on microcode option), and offered add-on accelerators to further speed the execution of those instructions.

In the 1980s, it was common in IBM PC/compatible microcomputers for the FPU to be entirely separate from the CPU, and typically sold as an optional add-on. It would only be purchased if needed to speed up or enable math-intensive programs.

The IBM PC, XT, and most compatibles based on the 8088 or 8086 had a socket for the optional 8087 coprocessor. The AT and 80286-based systems were generally socketed for the 80287, and 80386/80386SX-based machinesfor the 80387 and 80387SX respectively, although early ones were socketed for the 80287, since the 80387 did not exist yet. Other companies manufactured co-processors for the Intel x86 series. These included Cyrix and Weitek. Acorn Computers opted for the WE32206 to offer single, double and extended precision[20] to its ARM powered Archimedes range, introducing a gate array to interface the ARM2 processor with the WE32206 to support the additional ARM floating-point instructions.[21] Acorn later offered the FPA10 coprocessor, developed by ARM, for various machines fitted with the ARM3 processor.[22]

Coprocessors were available for the Motorola 68000 family, the 68881 and 68882. These were common in Motorola 68020/68030-based workstations, like the Sun-3 series. They were also commonly added to higher-end models of Apple Macintosh and Commodore Amiga series, but unlike IBM PC-compatible systems, sockets for adding the coprocessor were not as common in lower-end systems.

There are also add-on FPU coprocessor units for microcontroller units (MCUs/μCs)/single-board computer (SBCs), which serve to provide floating-point arithmetic capability. These add-on FPUs are host-processor-independent, possess their own programming requirements (operations, instruction sets, etc.) and are often provided with their own integrated development environments (IDEs).

See also

Further reading

Notes and References

  1. Anderson . Stanley F. . Earle . John G. . Goldschmidt . Robert Elliott . Powers . Don M. . January 1967 . The IBM System/360 Model 91: Floating-Point Execution Unit . . 11 . 1 . 34–53 . 10.1147/rd.111.0034 . 0018-8646.
  2. Web site: Dawson . Bruce . 2014-10-09 . Intel Underestimates Error Bounds by 1.3 quintillion . 2020-01-16 . randomascii.wordpress.com.
  3. Web site: FSIN Documentation Improvements in the "Intel® 64 and IA-32 Architectures Software Developer's Manual" . intel.com . 2014-10-09 . 2020-01-16 . https://web.archive.org/web/20200116083121/https://software.intel.com/en-us/blogs/2014/10/09/fsin-documentation-improvements-in-the-intel-64-and-ia-32-architectures-software . 2020-01-16 . dead.
  4. Web site: PDP-6 Handbook. https://ghostarchive.org/archive/20221009/http://bitsavers.org/pdf/dec/pdp6/F-65_PDP-6_Handbook_Aug64.pdf . 2022-10-09 . live. www.bitsavers.org.
  5. Web site: GE-2xx documents . www.bitsavers.org. CPB-267_GE-235-SystemManual_1963.pdf, p. IV-4.
  6. Web site: Intel 80287 family . www.cpu-world.com . 2019-01-15.
  7. Book: Muller . Jean-Michel . Elementary Functions: Algorithms and Implementation . 2006 . . 978-0-8176-4372-0 . 2nd . Boston, Massachusetts . 134 . en-us . 2005048094 . 2015-12-01.
  8. Rafi . Nave . Implementation of Transcendental Functions on a Numerics Processor . Microprocessing and Microprogramming . 11 . 3–4 . 221–225 . March 1983. 10.1016/0165-6074(83)90151-5 .
  9. Book: Palmer . John F. . The 8087 Primer . Morse . Stephen Paul . 1984 . . 0471875694 . 1st . en-us . 9780471875697 . Stephen Paul Morse . 2016-01-02 . registration.
  10. Math Coprocessors: A look at what they do, and how they do it . L. Brent . Glass . . 15 . 1 . January 1990 . 337–348 . 0360-5280.
  11. 1990-10-01 . Implementing CORDIC algorithms – A single compact routine for computing transcendental functions . . 152–156 . 2016-01-02 . Pitts . Jarvis.
  12. Intel's Floating-Point Processors . A. K. . Yuen . Electro/88 Conference Record . 48/5/1–7 . 1988.
  13. Web site: Archived copy . cdn3.wccftech.com . 14 March 2022 . https://web.archive.org/web/20150509204809/http://cdn3.wccftech.com/wp-content/uploads/2013/07/AMD-Steamroller-vs-Bulldozer.jpg . 9 May 2015 . dead.
  14. Web site: AMD unveils Flex FP . bit-tech.net . 29 March 2018.
  15. Book: PDP-11/45 Processor Handbook. Chapter 7 "Floating Point Processor". 1973. Digital Equipment Corporation.
  16. Book: PDP-11 Processor Handbook. 1979. Digital Equipment Corporation.
  17. Book: MICRO/PDP-11 Handbook. 33. 1983. Digital Equipment Corporation.
  18. Book: VAX – Hardware Handbook Volume I – 1986 . 1985 . . en-us.
  19. Book: VAX – Hardware Handbook Volume II – 1986 . 1986 . . en-us.
  20. Web site: Western Electric 32206 co-processor . www.cpu-world.com . 2021-11-06.
  21. Programming The ARM: The Floating Point Co-processor . A&B Computing . Fellows . Paul . March 1990 . 43–44 .
  22. Acorn Releases Floating Point Accelerator . Acorn Computers Limited . 5 July 1993 . 7 April 2021 .