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

4.6.5.2 Floating-Point Multiply-Add Instructions<br />

These instructions combine a multiply and an add operation<br />

without an intermediate rounding operation. The<br />

fraction part of the intermediate product is 106 bits wide<br />

(L bit, FRACTION), and all 106 bits take part in the add/<br />

subtract portion of the instruction.<br />

Status bits are set as follows.<br />

<br />

Overflow, Underflow, and Inexact Exception bits,<br />

the FR and FI bits, and the FPRF field are set<br />

<br />

based on the final result of the operation, and not<br />

on the result of the multiplication.<br />

Invalid Operation Exception bits are set as if the<br />

multiplication and the addition were performed<br />

using two separate instructions (fmul[s], followed<br />

by fadd[s] or fsub[s]). That is, multiplication of<br />

infinity by 0 or of anything by an SNaN, and/or<br />

addition of an SNaN, cause the corresponding<br />

exception bits to be set.<br />

Floating Multiply-Add [Single]<br />

A-form<br />

Floating Multiply-Subtract [Single] A-form<br />

fmadd FRT,FRA,FRC,FRB (Rc=0)<br />

fmadd. FRT,FRA,FRC,FRB (Rc=1)<br />

63 FRT FRA FRB FRC 29 Rc<br />

0 6 11 16 21 26 31<br />

fmsub FRT,FRA,FRC,FRB (Rc=0)<br />

fmsub. FRT,FRA,FRC,FRB (Rc=1)<br />

63 FRT FRA FRB FRC 28 Rc<br />

0 6 11 16 21 26 31<br />

fmadds FRT,FRA,FRC,FRB (Rc=0)<br />

fmadds. FRT,FRA,FRC,FRB (Rc=1)<br />

59 FRT FRA FRB FRC 29 Rc<br />

0 6 11 16 21 26 31<br />

fmsubs FRT,FRA,FRC,FRB (Rc=0)<br />

fmsubs. FRT,FRA,FRC,FRB (Rc=1)<br />

59 FRT FRA FRB FRC 28 Rc<br />

0 6 11 16 21 26 31<br />

The operation<br />

FRT [(FRA)×(FRC)] + (FRB)<br />

is performed.<br />

The floating-point operand in register FRA is multiplied<br />

by the floating-point operand in register FRC. The<br />

floating-point operand in register FRB is added to this<br />

intermediate result.<br />

If the most significant bit of the resultant significand is<br />

not 1, the result is normalized. The result is rounded to<br />

the target precision under control of the Floating-Point<br />

Rounding Control field RN of the FPSCR and placed<br />

into register FRT.<br />

FPSCR FPRF is set to the class and sign of the result,<br />

except for Invalid Operation Exceptions when<br />

FPSCR VE =1.<br />

The operation<br />

FRT [(FRA)×(FRC)] - (FRB)<br />

is performed.<br />

The floating-point operand in register FRA is multiplied<br />

by the floating-point operand in register FRC. The<br />

floating-point operand in register FRB is subtracted<br />

from this intermediate result.<br />

If the most significant bit of the resultant significand is<br />

not 1, the result is normalized. The result is rounded to<br />

the target precision under control of the Floating-Point<br />

Rounding Control field RN of the FPSCR and placed<br />

into register FRT.<br />

FPSCR FPRF is set to the class and sign of the result,<br />

except for Invalid Operation Exceptions when<br />

FPSCR VE =1.<br />

Special Registers Altered:<br />

FPRF FR FI<br />

FX OX UX XX<br />

VXSNAN VXISI VXIMZ<br />

CR1<br />

(if Rc=1)<br />

Special Registers Altered:<br />

FPRF FR FI<br />

FX OX UX XX<br />

VXSNAN VXISI VXIMZ<br />

CR1<br />

(if Rc=1)<br />

118<br />

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

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

Saved successfully!

Ooh no, something went wrong!