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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

interrupt is then taken and the destination register is not<br />

updated.<br />

7.2.3.6 Default Results<br />

Default results are generated when an Embedded<br />

Floating-Point Invalid Operation/Input Error, Embedded<br />

Floating-Point Overflow, Embedded Floating-Point<br />

Underflow, or Embedded Floating-Point Divide by Zero<br />

occurs on an Embedded Floating-Point operation.<br />

Default results provide a normalized value as a result of<br />

the operation. In general, Denorm results and underflows<br />

are set to 0 and overflows are saturated to the<br />

maximum representable number.<br />

Default results produced for each operation are<br />

described in Section 7.4, “Embedded Floating-Point<br />

Results Summary”.<br />

7.2.4 IEEE 754 Compliance<br />

The Embedded Floating-Point categories require a<br />

floating-point system as defined in the ANSI/IEEE Standard<br />

754-1985 but may rely on software support in<br />

order to conform fully with the standard. Thus, whenever<br />

an input operand of the Embedded Floating-Point<br />

instruction has data values that are +Infinity, -Infinity,<br />

Denormalized, NaN, or when the result of an operation<br />

produces an overflow or an underflow, an Embedded<br />

Floating-Point Data interrupt may be taken and the<br />

interrupt handler is responsible for delivering IEEE 754<br />

compliant behavior if desired.<br />

When Embedded Floating-Point Invalid Operation/<br />

Input Error exceptions are disabled (SPEFSCR FINVE =<br />

0), default results are provided by the hardware when<br />

an Infinity, Denormalized, or NaN input is received, or<br />

for the operation 0/0. When Embedded Floating-Point<br />

Underflow exceptions are disabled (SPEFSCR FUNFE =<br />

0) and the result of a floating-point operation underflows,<br />

a signed zero result is produced. The Embedded<br />

Floating-Point Round (Inexact) exception is also signaled<br />

for this condition. When Embedded Floating-Point<br />

Overflow exceptions are disabled<br />

(SPEFSCR FOVFE = 0) and the result of a floating-point<br />

operation overflows, a pmax or nmax result is produced.<br />

The Embedded Floating-Point Round (Inexact)<br />

exception is also signaled for this condition. An exception<br />

enable flag (SPEFSCR FINXE ) is also provided for<br />

generating an Embedded Floating-Point Round interrupt<br />

when an inexact result is produced, to allow a software<br />

handler to conform to the IEEE 754 standard. An<br />

Embedded Floating-Point Divide By Zero exception<br />

enable flag (SPEFSCR FDBZE ) is provided for generating<br />

an Embedded Floating-Point Data interrupt when a<br />

divide by zero operation is attempted to allow a software<br />

handler to conform to the IEEE 754 standard. All<br />

of these exceptions may be disabled, and the hardware<br />

will then deliver an appropriate default result.<br />

The sign of the result of an addition operation is the<br />

sign of the source operand having the larger absolute<br />

value. If both operands have the same sign, the sign of<br />

the result is the same as the sign of the operands. This<br />

includes subtraction which is addition with the negation<br />

of the sign of the second operand. The sign of the<br />

result of an addition operation with operands of differing<br />

signs for which the result is zero is positive except<br />

when rounding to negative infinity. Thus -0 + -0 = -0,<br />

and all other cases which result in a zero value give +0<br />

unless the rounding mode is round to negative infinity.<br />

Programming Note<br />

Note that when exceptions are disabled and default<br />

results computed, operations having input values<br />

that are denormalized may provide different results<br />

on different implementations. An implementation<br />

may choose to use the denormalized value or a<br />

zero value for any computation. Thus a computational<br />

operation involving a denormalized value and<br />

a normal value may return different results depending<br />

on the implementation.<br />

7.2.4.1 Sticky Bit Handling For Exception<br />

Conditions<br />

The SPEFSCR register defines sticky bits for retaining<br />

information about exception conditions that are<br />

detected. There are 5 sticky bits (FINXS, FINVS,<br />

FDBZS, FUNFS and FOVFS) that can be used to help<br />

provide IEEE 754 compliance. The sticky bits represent<br />

the combined ‘or’ of all the previous status bits produced<br />

from any Embedded Floating-Point operation<br />

since the last time software zeroed the sticky bit. The<br />

hardware will never set a sticky bit to 0.<br />

252<br />

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

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

Saved successfully!

Ooh no, something went wrong!