11

Before the formats of floating point numbers have been standardized in IEEE 754 in 1985, different vendors had used many different floating point formats, some of them listed on the Data Format and Conversion Information for Heritage Data at the National Space Science Data Center page.

Most — but not all — of those formats define a "double precision" format, initially for the sake of the FORTRAN DOUBLE PRECISION type. It is my understanding that in most configurations, a computer either didn't have a FPU at all, and all floating point operations were emulated using integer instructions in the CPU, or the FPU had hardware support for both formats; in both cases the performance ratio between single and double precision computations being in the low single digits.

My questions are:

  • on the platforms for which the double precision format is not defined (e.g. CDC), was FORTRAN lacking the DOUBLE PRECISION type?
  • was there a Western1) computer for which the double precision format was defined, but whose FPU only implemented single precision, necessitating software emulation of the double precision f. p. arithmetic (thanks to lvd), using single precision f. p. instructions whenever possible, of course, but still resulting in a substantial performance degradation for double precision computations?

1) BESM-6 suffered from exactly that; its software-emulated double precision was at least 10x slower than the native floating point.

11
  • 1
    CDC used its own version of Fortran (COS Fortran) which didn't bother too much about "standards". IIRC the later CDC machines did implement double precision in software, with the second word extending the mantissa of the first word in the obvious way, but since single precision was 60 bits, there wasn't much practical demand for it. Fun fact - the CDC 1604 Fortran compiler was written by some guy called Cray, but I don't know what happened to him after that ;)
    – alephzero
    Dec 4, 2018 at 21:59
  • 1
    Not strictly relevant to your question, but the early Cray Fortran compilers had a non-standard flag (on by default, IIRC) which treated all double precision declarations as single. As for CDC, with 64 bit single precision there wasn't much practical demand for double.
    – alephzero
    Dec 4, 2018 at 22:03
  • 1
    "was there a Western computer for which the double precision format was defined, but whose FPU only implemented single precision" Yes, the Cray 1 and XMP did that. The speed factor was about x10, from memory. The double precision operations did vectorize, otherwise the degradation would have been much worse.
    – alephzero
    Dec 4, 2018 at 22:09
  • 1
    There is a method, called 'double-word arithmetic', that achieves roughly double the precision of the single hardware floating point number by using two different numbers and special rules to operate them (see, for example, here: hal.archives-ouvertes.fr/hal-01351529v3/document). If similar methods were known in the time of CDCs, they could readily be used giving roughly abovementioned x10 overhead and twice the precision of single floating point number.
    – lvd
    Dec 5, 2018 at 12:34
  • 1
    @lvd Thanks! Indeed, just extending precision is relatively easy. The ill-fated BESM-6 f. p. format suffered from a narrow exponent range (representable values were approx. 10^-19 to 10^19), so its double precision format extended not only mantissa but the exponent as well. That would be substantially more expensive.
    – Leo B.
    Dec 5, 2018 at 18:25

1 Answer 1

7

The compilers I produced or helped produce (40-50 years ago) produced code that kept all floating point numbers as simple 2's complement mantissa/exponent form. It converted them to hardware FP representation and invoked the FP unit to process the arithmetic, then on return converted them back. You have to remember, back in those days FP hardware had a very complex interface with highly limited functionality in how you could use it and the FP processing time was fantastically different to linear flow of your program. Fortran, as you state, was king because back then you would have multiple FP units at your disposal at a hardware level so mathematics had to be done in a special way to try to utilize them together (the first step to parallel processing). You had no idea of how long each FP operation was going to take, so the compiler had to produce some really clever code. Fortran's grammar allowed this. Years later with local storage, the grammar of the language was not important because we could do one parse and the door opened on many aspects of computing. If this subject interests you, research transcendental processing - this was the birthplace of FP representation and discussion.

1
  • 6
    What was the computer where the f. p. format of the code produced by a compiler didn't match the hardware representation?
    – Leo B.
    Dec 6, 2018 at 22:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .