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 />

1. Overflow Exception is set<br />

FPSCR OX 1<br />

2. Inexact Exception is set<br />

FPSCR XX 1<br />

3. The result is determined by the rounding mode<br />

(FPSCR RN ) and the sign of the intermediate result<br />

as follows:<br />

- Round to Nearest<br />

Store ± Infinity, where the sign is the sign<br />

of the intermediate result<br />

- Round toward Zero<br />

Store the format’s largest finite number<br />

with the sign of the intermediate result<br />

- Round toward + Infinity<br />

For negative overflow, store the format’s<br />

most negative finite number; for positive<br />

overflow, store +Infinity<br />

- Round toward -Infinity<br />

For negative overflow, store -Infinity; for<br />

positive overflow, store the format’s largest<br />

finite number<br />

4. The result is placed into the target FPR<br />

5. FPSCR FR is undefined<br />

6. FPSCR FI is set to 1<br />

7. FPSCR FPRF is set to indicate the class and sign of<br />

the result (± Infinity or ± Normal Number)<br />

4.4.4 Underflow Exception<br />

4.4.4.1 Definition<br />

Underflow Exception is defined separately for the<br />

enabled and disabled states:<br />

<br />

<br />

Enabled:<br />

Underflow occurs when the intermediate result is<br />

“Tiny”.<br />

Disabled:<br />

Underflow occurs when the intermediate result is<br />

“Tiny” and there is “Loss of Accuracy”.<br />

4.4.4.2 Action<br />

The action to be taken depends on the setting of the<br />

Underflow Exception Enable bit of the FPSCR.<br />

When Underflow Exception is enabled (FPSCR UE =1)<br />

and an Underflow Exception occurs, the following<br />

actions are taken:<br />

1. Underflow Exception is set<br />

FPSCR UX 1<br />

2. For double-precision arithmetic instructions, the<br />

exponent of the normalized intermediate result is<br />

adjusted by adding 1536<br />

3. For single-precision arithmetic instructions and the<br />

Floating Round to Single-Precision instruction, the<br />

exponent of the normalized intermediate result is<br />

adjusted by adding 192<br />

4. The adjusted rounded result is placed into the target<br />

FPR<br />

5. FPSCR FPRF is set to indicate the class and sign of<br />

the result (± Normalized Number)<br />

Programming Note<br />

The FR and FI bits are provided to allow the system<br />

floating-point enabled exception error handler,<br />

when invoked because of an Underflow Exception,<br />

to simulate a “trap disabled” environment. That is,<br />

the FR and FI bits allow the system floating-point<br />

enabled exception error handler to unround the<br />

result, thus allowing the result to be denormalized.<br />

When Underflow Exception is disabled (FPSCR UE =0)<br />

and an Underflow Exception occurs, the following<br />

actions are taken:<br />

1. Underflow Exception is set<br />

FPSCR UX 1<br />

2. The rounded result is placed into the target FPR<br />

3. FPSCR FPRF is set to indicate the class and sign of<br />

the result (± Normalized Number, ± Denormalized<br />

Number, or ± Zero)<br />

A “Tiny” result is detected before rounding, when a nonzero<br />

intermediate result computed as though both the<br />

precision and the exponent range were unbounded<br />

would be less in magnitude than the smallest normalized<br />

number.<br />

If the intermediate result is “Tiny” and Underflow<br />

Exception is disabled (FPSCR UE =0) then the intermediate<br />

result is denormalized (see Section 4.3.4, “Normalization<br />

and Denormalization” on page 95) and<br />

rounded (see Section 4.3.6, “Rounding” on page 97)<br />

before being placed into the target FPR.<br />

“Loss of Accuracy” is detected when the delivered<br />

result value differs from what would have been computed<br />

were both the precision and the exponent range<br />

unbounded.<br />

102<br />

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

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

Saved successfully!

Ooh no, something went wrong!