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

the FPRs with no conversion. Load Single instructions<br />

are provided to transfer and convert floating-point values<br />

in floating-point single format from storage to the<br />

same value in floating-point double format in the FPRs.<br />

Store Single instructions are provided to transfer and<br />

convert floating-point values in floating-point double<br />

format from the FPRs to the same value in floating-point<br />

single format in storage.<br />

Instructions are provided that manipulate the Floating-Point<br />

Status and Control Register and the Condition<br />

Register explicitly. Some of these instructions copy<br />

data from an FPR to the Floating-Point Status and Control<br />

Register or vice versa.<br />

The computational instructions and the Select instruction<br />

accept values from the FPRs in double format. For<br />

single-precision arithmetic instructions, all input values<br />

must be representable in single format; if they are not,<br />

the result placed into the target FPR, and the setting of<br />

status bits in the FPSCR and in the Condition Register<br />

(if Rc=1), are undefined.<br />

FPR 0<br />

FPR 1<br />

. . .<br />

. . .<br />

FPR 30<br />

FPR 31<br />

0 63<br />

Figure 43. Floating-Point Registers<br />

4.2.2 Floating-Point Status and<br />

Control Register<br />

The Floating-Point Status and Control Register<br />

(FPSCR) controls the handling of floating-point exceptions<br />

and records status resulting from the floating-point<br />

operations. Bits 32:55 are status bits. Bits<br />

56:63 are control bits.<br />

The exception bits in the FPSCR (bits 35:44, 53:55) are<br />

sticky; that is, once set to 1 they remain set to 1 until<br />

they are set to 0 by an mcrfs, mtfsfi, mtfsf, or mtfsb0<br />

instruction. The exception summary bits in the FPSCR<br />

(FX, FEX, and VX, which are bits 32:34) are not considered<br />

to be “exception bits”, and only FX is sticky.<br />

FEX and VX are simply the ORs of other FPSCR bits.<br />

Therefore these two bits are not listed among the<br />

FPSCR bits affected by the various instructions.<br />

FPSCR<br />

32 63<br />

Figure 44. Floating-Point Status and Control<br />

Register<br />

The bit definitions for the FPSCR are as follows.<br />

Bit(s) Description<br />

32 Floating-Point Exception Summary (FX)<br />

Every floating-point instruction, except mtfsfi<br />

and mtfsf, implicitly sets FPSCR FX to 1 if that<br />

instruction causes any of the floating-point<br />

exception bits in the FPSCR to change from 0<br />

to 1. mcrfs, mtfsfi, mtfsf, mtfsb0, and<br />

mtfsb1 can alter FPSCR FX explicitly.<br />

Programming Note<br />

FPSCR FX is defined not to be altered<br />

implicitly by mtfsfi and mtfsf because<br />

permitting these instructions to alter<br />

FPSCR FX implicitly could cause a paradox.<br />

An example is an mtfsfi or mtfsf<br />

instruction that supplies 0 for FPSCR FX<br />

and 1 for FPSCR OX , and is executed<br />

when FPSCR OX =0. See also the Programming<br />

Notes with the definition of<br />

these two instructions.<br />

33 Floating-Point Enabled Exception Summary<br />

(FEX)<br />

This bit is the OR of all the floating-point<br />

exception bits masked by their respective<br />

enable bits. mcrfs, mtfsfi, mtfsf, mtfsb0, and<br />

mtfsb1 cannot alter FPSCR FEX explicitly.<br />

34 Floating-Point Invalid Operation Exception<br />

Summary (VX)<br />

This bit is the OR of all the Invalid Operation<br />

exception bits. mcrfs, mtfsfi, mtfsf, mtfsb0,<br />

and mtfsb1 cannot alter FPSCR VX explicitly.<br />

35 Floating-Point Overflow Exception (OX)<br />

See Section 4.4.3, “Overflow Exception” on<br />

page 101.<br />

36 Floating-Point Underflow Exception (UX)<br />

See Section 4.4.4, “Underflow Exception” on<br />

page 102.<br />

37 Floating-Point Zero Divide Exception (ZX)<br />

See Section 4.4.2, “Zero Divide Exception” on<br />

page 101.<br />

38 Floating-Point Inexact Exception (XX)<br />

See Section 4.4.5, “Inexact Exception” on<br />

page 103.<br />

FPSCR XX is a sticky version of FPSCR FI (see<br />

below). Thus the following rules completely<br />

describe how FPSCR XX is set by a given<br />

instruction.<br />

<br />

<br />

If the instruction affects FPSCR FI , the<br />

new value of FPSCR XX is obtained by<br />

ORing the old value of FPSCR XX with<br />

the new value of FPSCR FI .<br />

If the instruction does not affect<br />

FPSCR FI , the value of FPSCR XX is<br />

unchanged.<br />

Chapter 4. Floating-Point Processor [Category: Floating-Point]<br />

91

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

Saved successfully!

Ooh no, something went wrong!