m <- sm + 1
RT <- (n[m:XLEN-1] || [0]*m) + (RA)
+Pseudo-code (shaddw):
+
+ shift <- sm + 1 # Shift is between 1-4
+ n <- EXTS((RB)[XLEN/2:XLEN-1]) # Only use lower XLEN/2-bits of RB
+ RT <- (n << shift) + (RA) # Shift n, add RA
+
Pseudo-code (shadduw):
n <- ([0]*(XLEN/2)) || (RB)[XLEN/2:XLEN-1]
return (RB << (sm+1)) + RA;
}
+uint_xlen_t shaddw(uint_xlen_t RA, uint_xlen_t RB, uint8_t sm) {
+ uint_xlen_t n = (int_xlen_t)(RB << XLEN / 2) >> XLEN / 2;
+ sm = sm & 0x3;
+ return (n << (sm+1)) + RA;
+}
+
uint_xlen_t shadduw(uint_xlen_t RA, uint_xlen_t RB, uint8_t sm) {
uint_xlen_t n = RB & 0xFFFFFFFF;
sm = sm & 0x3;
| NN | | | | | 00 | 0101 110 |0 | crfbinlog | {TODO} |
| NN | | | | | 00 | 0101 110 |1 | rsvd | |
| NN | | | | | 10 | 0101 110 |Rc| rsvd | |
-| NN | | | | | -1 | 0101 110 |Rc| rsvd | |
+| NN | RT | RA | RB | sm0| sm1 1 | 0101 110 |Rc| shaddw | X-Form |
| NN | RT | RA | RB | 0 | itype | 1001 110 |Rc| av minmax | X-Form |
| NN | RT | RA | RB | 1 | 00 | 1001 110 |Rc| av abss | X-Form |
| NN | RT | RA | RB | 1 | 01 | 1001 110 |Rc| av absu | X-Form |