```
Instructions added
shadd - Shift and Add
- shadduw - Shift and Add Unsigned Word
+ shadduw - Shift and Add Unsigned Word
```
**Submitter**: Luke Leighton (Libre-SOC)
**Keywords**:
```
- GPR, Big-manip, Shift, Arithmetic
+ GPR, Bit-manipulation, Shift, Arithmetic
```
**Motivation**
Pseudocode:
```
- shift <- sm + 1 # Shift is between 1-4
+ shift <- sm + 1 # Shift is between 1-4
sum[0:63] <- ((RB) << shift) + (RA) # Shift RB, add RA
- RT <- sum # Result stored in RT
+ RT <- sum # Result stored in RT
```
When `sm` is zero, the contents of register RB are multiplied by 2,
added to the contents of register RA, and the result stored in RT.
-`sm` is a 2-bit bitfield, and allows multiplication of RB by 2, 4, 8, 16.
+`sm` is a 2-bit bit-field, and allows multiplication of RB by 2, 4, 8, 16.
Operands RA and RB, and the result RT are all 64-bit, unsigned integers.
-**NEED EXAMPLES (not sure how to embedd sm)!!!**
+**NEED EXAMPLES (not sure how to embed sm)!!!**
Examples:
```
# Shift-and-Add Unsigned Word
-`shadd RT, RA, RB`
+`shadduw RT, RA, RB`
| 0-5 | 6-10 | 11-15 | 16-20 | 21-22 | 23-30 | 31 | Form |
|-------|------|-------|-------|-------|-------|----|----------|
Pseudocode:
```
- shift <- sm + 1 # Shift is between 1-4
- n <- (RB)[32:63] # Only use lower 32-bits of RB
- sum[0:63] <- (n << shift) + (RA) # Shift n, add RA
- RT <- sum # Result stored in RT
+ shift <- sm + 1 # Shift is between 1-4
+ n <- (RB)[32:63] # Only use lower 32-bits of RB
+ sum[0:63] <- (n << shift) + (RA) # Shift n, add RA
+ RT <- sum # Result stored in RT
```
When `sm` is zero, the lower word contents of register RB are multiplied by 2,
added to the contents of register RA, and the result stored in RT.
-`sm` is a 2-bit bitfield, and allows multiplication of RB by 2, 4, 8, 16.
+`sm` is a 2-bit bit-field, and allows multiplication of RB by 2, 4, 8, 16.
Operands RA and RB, and the result RT are all 64-bit, unsigned integers.
Examples:
```
-#
+#
shadduw r4, r1, r2
```
-
[[!tag opf_rfc]]
# Appendices
|------|------|------|---------|----------|-------------|
| Z23 | I | # | 3.0B | shadd | Shift-and-Add |
| Z23 | I | # | 3.0B | shadduw | Shift-and-Add Unsigned Word |
-