14.06.2015 Views

Power ISA™ Version 2.03 - Power.org

Power ISA™ Version 2.03 - Power.org

Power ISA™ Version 2.03 - Power.org

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Version</strong> <strong>2.03</strong><br />

IEEE-conforming significand arithmetic is considered to<br />

be performed with a floating-point accumulator having<br />

the following format, where bits 0:55 comprise the significand<br />

of the intermediate result.<br />

S C L FRACTION G R X<br />

0 1 53 54 55<br />

Figure 51. IEEE 64-bit execution model<br />

The S bit is the sign bit.<br />

The C bit is the carry bit, which captures the carry out<br />

of the significand.<br />

The L bit is the leading unit bit of the significand, which<br />

receives the implicit bit from the operand.<br />

The FRACTION is a 52-bit field that accepts the fraction<br />

of the operand.<br />

The Guard (G), Round (R), and Sticky (X) bits are<br />

extensions to the low-order bits of the accumulator. The<br />

G and R bits are required for postnormalization of the<br />

result. The G, R, and X bits are required during rounding<br />

to determine if the intermediate result is equally<br />

near the two nearest representable values. The X bit<br />

serves as an extension to the G and R bits by representing<br />

the logical OR of all bits that may appear to the<br />

low-order side of the R bit, due either to shifting the<br />

accumulator right or to other generation of low-order<br />

result bits. The G and R bits participate in the left shifts<br />

with zeros being shifted into the R bit. Figure 52 shows<br />

the significance of the G, R, and X bits with respect to<br />

the intermediate result (IR), the representable number<br />

next lower in magnitude (NL), and the representable<br />

number next higher in magnitude (NH).<br />

G R X Interpretation<br />

0 0 0 IR is exact<br />

0 0 1<br />

0 1 0 IR closer to NL<br />

0 1 1<br />

1 0 0 IR midway between NL and NH<br />

1 0 1<br />

1 1 0 IR closer to NH<br />

1 1 1<br />

Figure 52. Interpretation of G, R, and X bits<br />

Figure 53 shows the positions of the Guard, Round,<br />

and Sticky bits for double-precision and single-precision<br />

floating-point numbers relative to the accumulator<br />

illustrated in Figure 51.<br />

The significand of the intermediate result is prepared<br />

for rounding by shifting its contents right, if required,<br />

until the least significant bit to be retained is in the<br />

low-order bit position of the fraction. Four user-selectable<br />

rounding modes are provided through FPSCR RN<br />

as described in Section 4.3.6, “Rounding” on page 97.<br />

Using Z1 and Z2 as defined on page 97, the rules for<br />

rounding in each mode are as follows.<br />

Round to Nearest<br />

Guard bit = 0<br />

The result is truncated. (Result exact (GRX=000)<br />

or closest to next lower value in magnitude<br />

(GRX=001, 010, or 011))<br />

<br />

<br />

Guard bit = 1<br />

Depends on Round and Sticky bits:<br />

Case a<br />

If the Round or Sticky bit is 1 (inclusive), the<br />

result is incremented. (Result closest to<br />

next higher value in magnitude (GRX=101,<br />

110, or 111))<br />

Case b<br />

If the Round and Sticky bits are 0 (result<br />

midway between closest representable values),<br />

then if the low-order bit of the result is<br />

1 the result is incremented. Otherwise (the<br />

low-order bit of the result is 0) the result is<br />

truncated (this is the case of a tie rounded<br />

to even).<br />

Round toward Zero<br />

Choose the smaller in magnitude of Z1 or Z2. If the<br />

Guard, Round, or Sticky bit is nonzero, the result is<br />

inexact.<br />

Round toward + Infinity<br />

Choose Z1.<br />

Round toward - Infinity<br />

Choose Z2.<br />

If rounding results in a carry into C, the significand is<br />

shifted right one position and the exponent is incremented<br />

by one. This yields an inexact result, and possibly<br />

also exponent overflow. If any of the Guard, Round,<br />

or Sticky bits is nonzero, then the result is also inexact.<br />

Fraction bits are stored to the target FPR. For Floating<br />

Round to Integer, Floating Round to Single-Precision,<br />

and single-precision arithmetic instructions, low-order<br />

zeros must be appended as appropriate to fill out the<br />

double-precision fraction.<br />

Format Guard Round Sticky<br />

Double G bit R bit X bit<br />

Single 24 25 OR of 26:52, G, R, X<br />

Figure 53. Location of the Guard, Round, and<br />

Sticky bits in the IEEE execution model<br />

104<br />

<strong>Power</strong> ISA -- Book I

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!