ISARef Multi-ISA & Silicon Reference
45,419 ISA items · 105,907 timings · 913 microarchs · 15,555 chips · 105 sources
Arch:
Tier:

fsgnj.h

T1 riscv fp insn
Floating-Point Sign-Inject Half-Precision
SourceRISC-V Official Unified Database (riscv-unified-db) (riscv_unified_db)
Reliability TierT1 — Official Specification
ISA / Silicon ScopeRV32/RV64 Zfh, Zhinx
RV32 / RV64 (Ratified & Standard Extensions)
License & VersionApache-2.0 / CC-BY-4.0
main
Upstreamhttps://github.com/riscv/riscv-unified-db
Privilegeuser
ExtensionsZfh, Zhinx

Summary

The fsgnj.h instruction produces a half-precision result that takes all bits except the sign bit from _fs1_. The result's sign bit is taken from _fs2_'s sign bit, and the result is written to the destination register _fd_. Sign-injection instructions do not set floating-point exception flags, nor do they canonicalize NaNs.

Syntax / Encoding

fsgnj.h fd, fs1, fs2 | 0010010xxxxxxxxxx000xxxxx1010011 (mask=0xfe00707f match=0x24000053)

Binary Encodings (1)

WidthFormatBit PatternMask / Match
32RV0010010xxxxxxxxxx000xxxxx10100110xfe00707f / 0x24000053

Operands

NameDescription
fs2bits [24:20]
fs1bits [19:15]
fdbits [11:7]

Reference Notes

The `fsgnj.h` instruction produces a half-precision result that takes all bits except the sign bit from _fs1_.
The result's sign bit is taken from _fs2_'s sign bit, and the result is written to the destination
register _fd_. Sign-injection instructions do not set floating-point exception flags, nor do they
canonicalize NaNs.