divwu
Divide Word Unsigned
PPC440x5 CPU Core User’s Manual
Preliminary
Page 308 of 589
instrset.fm.
September 12, 2002
divwu
Divide Word Unsigned
(RT)
←
(RA)
÷
(RB)
The contents of register RA are divided by the contents of register RB. The quotient is placed into register RT.
The dividend and the divisor are interpreted as unsigned integers. The quotient is the unique unsigned
integer that satisfies:
dividend = (quotient
×
divisor) + remainder
If an attempt is made to perform (
n
÷
0), the contents of register RT are undefined; if the Rc also contains 1,
the contents of CR[CR0]
0:2
are also undefined. The invalid division operation also sets XER[OV, SO] (and
CR[CR0]
3
if Rc contains 1) to 1 if the OE field contains 1.
Registers Altered
• RT
• CR[CR0] if Rc contains 1
• XER[OV, SO] if OE contains 1
Programming Note
The 32-bit remainder can be calculated using the following sequence of instructions
divwu
RT,RA,RB
# RT = quotient
mullw
RT,RT,RB
# RT = quotient
×
divisor
subf
RT,RT,RA
# RT = remainder
This sequence does not calculate the correct result if the divisor is 0.
divwu
RT, RA, RB
OE=0, Rc=0
divwu.
RT, RA, RB
OE=0, Rc=1
divwuo
RT, RA, RB
OE=1, Rc=0
divwuo.
RT, RA, RB
OE=1, Rc=1
31
RT
RA
RB
OE
459
Rc
0
6
11
16
21 22
31
Summary of Contents for PPC440X5 CPU Core
Page 1: ...PPC440x5 CPU Core User s Manual Preliminary SA14 2613 02 September 12 2002 Title Page...
Page 22: ...User s Manual PPC440x5 CPU Core Preliminary Page 22 of 583 ppc440x5LOT fm September 12 2002...
Page 26: ...User s Manual PPC440x5 CPU Core Preliminary Page 26 of 589 preface fm September 12 2002...
Page 38: ...User s Manual PPC440x5 CPU Core Preliminary Page 38 of 589 overview fm September 12 2002...
Page 94: ...User s Manual PPC440x5 CPU Core Preliminary Page 94 of 589 init fm September 12 2002...
Page 132: ...User s Manual PPC440x5 CPU Core Preliminary Page 132 of 589 cache fm September 12 2002...
Page 158: ...User s Manual PPC440x5 CPU Core Preliminary Page 158 of 589 mmu fm September 12 2002...
Page 218: ...User s Manual PPC440x5 CPU Core Preliminary Page 218 of 589 timers fm September 12 2002...
Page 248: ...User s Manual PPC440x5 CPU Core Preliminary Page 248 of 589 debug fm September 12 2002...
Page 458: ...User s Manual PPC440x5 CPU Core Preliminary Page 458 of 589 regsummIntro fm September 12 2002...
Page 568: ...User s Manual PPC440x5 CPU Core Preliminary Page 568 of 589 instalfa fm September 12 2002...
Page 588: ...User s Manual PPC440x5 CPU Core Preliminary Page 588 of 583 ppc440x5IX fm September 12 2002...
Page 590: ......