Webcentive RISC-V Reference

c.zext.w

Zero-extend word, 16-bit encoding

Extension
Zcb
XLEN
RV64 only
Assembly (riscv-unified-db)
c.zext.w xd
Length
16-bit (compressed)

Encoding

1513121097654210
100111rs1′/rs2′1110001

Match 0x9c71, mask 0xfc7f. Source: c.zext.w rd_rs1_p 1..0=1 15..13=4 12..10=7 6..5=3 4..2=4 in riscv-opcodes/extensions/rv64_zcb.

FieldBitsriscv-opcodes name
rs1′/rs2′9:7rd_rs1_p

Description

Takes a single source/destination operand. It zero-extends the least-significant word of the operand to XLEN bits by inserting zeros into all of the bits more significant than 31.

Description from riscv-unified-db, reformatted.

Operation

if (implemented?(ExtensionName::C) && MISA_CSR_IMPLEMENTED && (CSR[misa].C == 1'b0)) {
  reserved_instruction($encoding);
}

X[creg2reg(xd)] = X[creg2reg(xd)][31:0];

Pseudocode in riscv-unified-db’s IDL, quoted unchanged.

Specification and related pages