Subtract word
Subtract the 32-bit values in xs2 from xd, and store the result in xd. The xd and xs2 register indexes should be used as xd+8 and xs2+8 (registers x8-x15). C.SUBW expands into `subw xd, xd, xs2`.
This instruction has data-independent execution timing.
c.subw xd, xs2
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 00 | 111 | xd | 00 | xs2 | 0 | 1 | ||||||||
| Variable | Bits | Width |
|---|---|---|
xs2 | [4:2] | 3 |
xd | [9:7] | 3 |
Bits<32> t0 = X[creg2reg(xd)][31:0]; Bits<32> t1 = X[creg2reg(xs2)][31:0]; X[creg2reg(xd)] = sext(t0 - t1, 32);
RV64 and Zca
| S | U | VS | VU |
|---|---|---|---|
| Always | Always | Always | Always |
Version af3eaf9+cheriot.f635218
Data from the RISC-V Unified Database, copyright RISC-V International and contributors.
CHERIoT extensions from the CHERIoT specification and Sail model, copyright Microsoft and the CHERIoT Platform contributors.
This site is provided as a community resource and is NOT affiliated with nor endorsed by RISC-V International.