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

Divide Doubleword<br />

XO-form<br />

Divide Doubleword Unsigned XO-form<br />

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

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

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

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

31 RT RA RB OE 489 Rc<br />

0 6 11 16 21 22 31<br />

dividend 0:63 (RA)<br />

divisor 0:63 (RB)<br />

RT dividend × divisor<br />

The 64-bit dividend is (RA). The 64-bit divisor is (RB).<br />

The 64-bit quotient of the dividend and divisor is placed<br />

into register RT. The remainder is not supplied as a<br />

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_0000_0000 ÷ -1<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 these cases, if OE=1 then OV is set to 1.<br />

Special Registers Altered:<br />

CR0<br />

(if Rc=1)<br />

SO OV<br />

(if OE=1)<br />

Programming Note<br />

The 64-bit signed remainder of dividing (RA) by<br />

(RB) can be computed as follows, except in the<br />

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

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

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

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

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

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

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

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

31 RT RA RB OE 457 Rc<br />

0 6 11 16 21 22 31<br />

dividend 0:63 (RA)<br />

divisor 0:63 (RB)<br />

RT dividend ÷ divisor<br />

The 64-bit dividend is (RA). The 64-bit divisor is (RB).<br />

The 64-bit quotient of the dividend and divisor is placed<br />

into register RT. The remainder is not supplied as a<br />

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

(if Rc=1)<br />

SO OV<br />

(if OE=1)<br />

Programming Note<br />

The 64-bit unsigned remainder of dividing (RA) by<br />

(RB) can be computed as follows.<br />

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

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

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

Chapter 3. Fixed-Point Processor<br />

63

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

Saved successfully!

Ooh no, something went wrong!