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

sext.h

T1 riscv alu insn
Sign-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

Sign-extends the least-significant halfword in the source to XLEN by copying the most-significant bit in the halfword (i.e., bit 15) to all of the more-significant bits.

Syntax / Encoding

sext.h xd, xs1 | 011000000101xxxxx001xxxxx0010011 (mask=0xfff0707f match=0x60501013)

Binary Encodings (1)

WidthFormatBit PatternMask / Match
32RV011000000101xxxxx001xxxxx00100110xfff0707f / 0x60501013

Operands

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