prod[0:127] <- (RA) * (RB) # Multiply RA and RB, result 128-bit
sum[0:127] <- EXTZ(RC) + prod # Zero extend RC, add product
RT <- sum[64:127] # Store low half in RT
- RS <- sum[0:63] # RS implicit register, see below
+ RS <- sum[0:63] # RS implicit register, equal to RC
```
Special registers altered:
modulo 2^64 and sign/zero extension from 64 to 128 bits produces identical
results modulo 2^64. This is why there is no maddldu instruction.
-RS is implictly defined as the register following RT (RS=RT+1).
+RS is implictly defined as the same register as RC.
*Programmer's Note:
As a Scalar Power ISA operation, like `lq` and `stq`, RS=RT+1.
Examples:
```
- maddedu r4, r0, r1, r2 # ((r0)*(r1))+(r2), store lower in r4, upper in r5
+# (r0 * r1) + r2, store lower in r4, upper in r2
+maddedu r4, r0, r1, r2
```
# Divide/Modulo Quad-Double Unsigned
needed as part of implementing Knuth's
Algorithm D*
-For Scalar usage, just as for `maddedu`, `RS=RT+1` (similar to `lq` and `stq`).
-
+For Scalar usage, just as for `maddedu`, `RS=RC`
Examples:
```
- divmod2du r4, r0, r1, r2 # ((r0)||(r2)) / (r1), store in r4
- # ((r0)||(r2)) % (r1), store in r5
+# ((r0 << 64) + r2) / r1, store in r4
+# ((r0 << 64) + r2) % r1, store in r2
+divmod2du r4, r0, r1, r2
```
[[!tag opf_rfc]]