← Home

c.subw

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.

Assembly format

c.subw xd, xs2

Encoding

1514131211109876543210
100111xd00xs201

Decode variables

VariableBitsWidth
xs2[4:2]3
xd[9:7]3

Execution

Bits<32> t0 = X[creg2reg(xd)][31:0];
Bits<32> t1 = X[creg2reg(xs2)][31:0];
X[creg2reg(xd)] = sext(t0 - t1, 32);

Defined by

RV64 and Zca

Access

SUVSVU
AlwaysAlwaysAlwaysAlways

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.