ISARef Multi-ISA & Silicon Reference
45,419 ISA items · 105,907 timings · 1,823 microarchs · 16,083 chips · 105 sources
Arch:
Tier:

zext.h

T1 riscv alu insn
Zero-extend halfword
SourceRISC-V Official Unified Database (riscv-unified-db) (riscv_unified_db)
Reliability TierT1 — Official Specification
ISA / Silicon ScopeRV32/RV64 Zbb
RV32 / RV64 (Ratified & Standard Extensions)
License & VersionApache-2.0 / CC-BY-4.0
main
Upstreamhttps://github.com/riscv/riscv-unified-db
Privilegeuser
ExtensionsZbb

Summary

Zero-extends the least-significant halfword of the source to XLEN by inserting 0's into all of the bits more significant than 15.

Syntax / Encoding

zext.h xd, xs1 | 000010000000xxxxx100xxxxx0110011 (mask=0xfff0707f match=0x08004033)

Binary Encodings (2)

WidthFormatBit PatternMask / Match
32RV32000010000000xxxxx100xxxxx01100110xfff0707f / 0x08004033
32RV64000010000000xxxxx100xxxxx01110110xfff0707f / 0x0800403b

Operands

NameDescription
xs1bits [19:15]
xdbits [11:7]

Reference Notes

Zero-extends the least-significant halfword of the source to XLEN by inserting
0's into all of the bits more significant than 15.

[NOTE]
The *zext.h* instruction is a pseudo-op for `pack` when `Zbkb` is implemented and XLEN == 32.

[NOTE]
The *zext.h* instruction is a pseudo-op for `packw` when `Zbkb` is implemented and XLEN == 64.