Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 681 Bytes

_signextend.adoc

File metadata and controls

29 lines (22 loc) · 681 Bytes

Sign- and zero-extension

These instructions perform the sign-extension or zero-extension of the least significant 8 bits, 16 bits or 32 bits of the source register.

These instructions replace the generalized idioms slli rD,rS,(XLEN-<size>) + srli (for zero-extension) or slli + srai (for sign-extension) for the sign-extension of 8-bit and 16-bit quantities, and for the zero-extension of 16-bit and 32-bit quantities.

RV32 RV64 Mnemonic Instruction

sext.b rd, rs

[insns-sext_b]

sext.h rd, rs

[insns-sext_h]

zext.h rd, rs

[insns-zext_h]