ZEXT.H

Zero Extend Halfword

ZEXT.H rd, rs1

Zero-extends the lowest halfword (16 bits) to XLEN bits.

Encoding

Binary Layout
000010000000
31:20
rs1
19:15
100
14:12
rd
11:7
0111011
6:0
 
Format I-Type
Opcode 0x0800403B
Extension Zbb

Operands

  • rd
    Destination register (integer)
  • rs1
    Source

Example

ZEXT.H x10, x11

// Zero extend 16-bit value.

Related

More in Zbb

Description

ZEXT.H zero-extends the least-significant halfword of rs1 to XLEN bits and writes it to rd. The stored encoding is the RV64 one (it is PACKW rd, rs1, x0); on RV32 it is PACK rd, rs1, x0, opcode 0x33.

Operation

R[rd] = zext(R[rs1][15:0]);