IEEE floating point arithmetic

IEEE Floating-point formats

The Alpha processor supports two different floating-point formats; S- and T- floating formats.

S-Floating

An IEEE single precision, or S-Floating, is a 32-bit floating point value. In memory, it's layout is as follows:
     31 30      23 22                      0
   +---+----------+-------------------------+
   | S | Exponent |         Fraction        |
   +---+----------+-------------------------+

In the floating point registers, the S-Floating is left-justified to occupy 64 bits:

     63 62          52 51                     29 28                   0
   +---+--------------+-------------------------+----------------------+
   | S |    Exponent  |         Fraction        |            0         |
   +---+--------------+-------------------------+----------------------+

The exponent is mapped from the 8-bit memory-format exponent to the 11-bit register-format as follows:

  +----------------+------------------+--------------------------------+
  | Memory <30:23> | Register <62:52> | Meaning                        |
  +----------------+------------------+--------------------------------+
  |      1 1111111 |    1 111 1111111 | frac <> 0: NaN (not-a-number)  |
  |                |                  | frac == 0: +/- Infinity        |
  +----------------+------------------+--------------------------------+
  |      1 xxxxxxx |    1 000 xxxxxxx | Finite number                  |
  |      0 xxxxxxx |    0 111 xxxxxxx | Finite number                  |
  +----------------+------------------+--------------------------------+
  |      0 0000000 |    0 000 0000000 | frac <> 0: Subnormal finite    |
  |                |                  | frac == 0: +/- Zero            |
  +----------------+------------------+--------------------------------+

T-Floating

An IEEE double precision, or T-Floating, is a 64-bit floating point value. Both in memory, and in the flowting point registers it's layout is as follows:
     63 62          52 51                                             0
   +---+--------------+------------------------------------------------+
   | S |    Exponent  |                   Fraction                     |
   +---+--------------+------------------------------------------------+

The value (V) of a T-Floating value can be determined from the Sign (S), Exponent (E) and Fraction (F) as follows:

  +--------------+--------+--------+--------------------------+
  | E == 2047    | F <> 0 |        | V = NaN                  |
  +--------------+--------+--------+--------------------------+
  | E == 2047    | F == 0 | S == 0 | V = + Infinity           |
  +--------------+--------+--------+--------------------------+
  | E == 2047    | F == 0 | S == 1 | V = - Infinity           |
  +--------------+--------+--------+--------------------------+
  | 0 < E < 2047 |        | S == 0 | V = + (1.F) * 2^(E-1023) |
  +--------------+--------+--------+--------------------------+
  | 0 < E < 2047 |        | S == 1 | V = - (1.F) * 2^(E-1023) |
  +--------------+--------+--------+--------------------------+
  | E == 0       | F <> 0 | S == 0 | V = + (0.F) * 2^(-1022)  |
  +--------------+--------+--------+--------------------------+
  | E == 0       | F <> 0 | S == 1 | V = - (0.F) * 2^(-1022)  |
  +--------------+--------+--------+--------------------------+
  | E == 0       | F == 0 | S == 0 | V = + 0                  |
  +--------------+--------+--------+--------------------------+
  | E == 0       | F == 0 | S == 1 | V = - 0                  |
  +--------------+--------+--------+--------------------------+

SourceForge.net Logo
Project space on SourceForge.net