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

Divide Word XO-form<br />

divw RT,RA,RB (OE=0 Rc=0)<br />

divw. RT,RA,RB (OE=0 Rc=1)<br />

divwo RT,RA,RB (OE=1 Rc=0)<br />

divwo. RT,RA,RB (OE=1 Rc=1)<br />

31 RT RA RB OE 491 Rc<br />

0 6 11 16 21 22 31<br />

Divide Word Unsigned XO-form<br />

divwu RT,RA,RB (OE=0 Rc=0)<br />

divwu. RT,RA,RB (OE=0 Rc=1)<br />

divwuo RT,RA,RB (OE=1 Rc=0)<br />

divwuo. RT,RA,RB (OE=1 Rc=1)<br />

31 RT RA RB OE 459 Rc<br />

0 6 11 16 21 22 31<br />

dividend 0:63 EXTS((RA) 32:63 )<br />

divisor 0:63 EXTS((RB) 32:63 )<br />

RT 32:63 dividend ÷ divisor<br />

RT 0:31 undefined<br />

The 64-bit dividend is the sign-extended value of<br />

(RA) 32:63 . The 64-bit divisor is the sign-extended value<br />

of (RB) 32:63 . The 64-bit quotient is formed. The<br />

low-order 32 bits of the 64-bit quotient are placed into<br />

RT 32:63 . The contents of RT 0:31 are undefined. The<br />

remainder is not supplied as a result.<br />

Both operands and the quotient are interpreted as<br />

signed integers. The quotient is the unique signed integer<br />

that satisfies<br />

dividend = (quotient × divisor) + r<br />

where 0 ≤ r < |divisor| if the dividend is nonnegative,<br />

and -|divisor| < r ≤ 0 if the dividend is negative.<br />

If an attempt is made to perform any of the divisions<br />

0x8000_0000 ÷ -1<br />

÷ 0<br />

then the contents of register RT are undefined as are<br />

(if Rc=1) the contents of the LT, GT, and EQ bits of CR<br />

Field 0. In these cases, if OE=1 then OV is set to 1.<br />

Special Registers Altered:<br />

CR0 (bits 0:2 undefined in 64-bit mode) (if Rc=1)<br />

SO OV<br />

(if OE=1)<br />

Programming Note<br />

The 32-bit signed remainder of dividing (RA) 32:63<br />

by (RB) 32:63 can be computed as follows, except in<br />

the case that (RA) 32:63 = -2 31 and (RB) 32:63 = -1.<br />

divw RT,RA,RB # RT = quotient<br />

mullw RT,RT,RB # RT = quotient×divisor<br />

subf RT,RT,RA # RT = remainder<br />

dividend 0:63 32 0 || (RA) 32:63<br />

divisor 0:63 32 0 || (RB) 32:63<br />

RT 32:63 dividend ÷ divisor<br />

RT 0:31 undefined<br />

The 64-bit dividend is the zero-extended value of<br />

(RA) 32:63 . The 64-bit divisor is the zero-extended value<br />

of (RB) 32:63 . The 64-bit quotient is formed. The<br />

low-order 32 bits of the 64-bit quotient are placed into<br />

RT 32:63 . The contents of RT 0:31 are undefined. The<br />

remainder is not supplied as a result.<br />

Both operands and the quotient are interpreted as<br />

unsigned integers, except that if Rc=1 the first three<br />

bits of CR Field 0 are set by signed comparison of the<br />

result to zero. The quotient is the unique unsigned<br />

integer that satisfies<br />

dividend = (quotient × divisor) + r<br />

where 0 ≤ r < divisor.<br />

If an attempt is made to perform the division<br />

÷ 0<br />

then the contents of register RT are undefined as are (if<br />

Rc=1) the contents of the LT, GT, and EQ bits of CR<br />

Field 0. In this case, if OE=1 then OV is set to 1.<br />

Special Registers Altered:<br />

CR0 (bits 0:2 undefined in 64-bit mode) (if Rc=1)<br />

SO OV<br />

(if OE=1)<br />

Programming Note<br />

The 32-bit unsigned remainder of dividing (RA) 32:63<br />

by (RB) 32:63 can be computed as follows.<br />

divwu RT,RA,RB # RT = quotient<br />

mullw RT,RT,RB # RT = quotient×divisor<br />

subf RT,RT,RA # RT = remainder<br />

Chapter 3. Fixed-Point Processor<br />

61

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

Saved successfully!

Ooh no, something went wrong!