Webcentive RISC-V Reference

Zfh instructions

Half-precision floating point

16-bit half-precision binary floating-point instructions compliant with the IEEE 754-2008 arithmetic standard. The Zfh extension depends on the single-precision floating-point extension, F. The NaN-boxing scheme is extended to allow a half-precision value to be NaN-boxed inside a single-precision value (which may be recursively NaN-boxed inside a double- or quad-precision value when the D or Q extension is present).

Extension description from riscv-unified-db, reformatted.

Specification chapter: The RISC-V Instruction Set Manual, src/unpriv/zfh.adoc.

Instructions (36)

MnemonicName (riscv-unified-db)XLEN
fabs.h (pseudo-op)RV32 and RV64
fadd.hFloating-Point Add Half-PrecisionRV32 and RV64
fclass.hFloating-Point Classify Half-PrecisionRV32 and RV64
fcvt.h.lFloating-point Convert Long to Half-precisionRV64 only
fcvt.h.luFloating-point Convert Unsigned Long to Half-precisionRV64 only
fcvt.h.wFloating-point Convert Word to Half-precisionRV32 and RV64
fcvt.h.wuFloating-point Convert Unsigned Word to Half-precisionRV32 and RV64
fcvt.l.hFloating-point Convert Half-precision to LongRV64 only
fcvt.lu.hFloating-point Convert Half-precision to Unsigned LongRV64 only
fcvt.w.hFloating-point Convert Half-precision to WordRV32 and RV64
fcvt.wu.hFloating-point Convert Half-precision to Unsigned WordRV32 and RV64
fdiv.hFloating-Point Divide Half-PrecisionRV32 and RV64
feq.hFloating-Point Equal Half-PrecisionRV32 and RV64
fle.hFloating-Point Less Than or Equal Half-PrecisionRV32 and RV64
fleq.hNo synopsis availableRV32 and RV64
fli.hFloating-point Load Immediate Half-precisionRV32 and RV64
flt.hFloating-Point Less Than Half-PrecisionRV32 and RV64
fltq.hNo synopsis availableRV32 and RV64
fmadd.hFloating-Point Multiply-Add Half-PrecisionRV32 and RV64
fmax.hFloating-Point Maximum-Number Half-PrecisionRV32 and RV64
fmaxm.hNo synopsis availableRV32 and RV64
fmin.hFloating-Point Minimum-Number Half-PrecisionRV32 and RV64
fminm.hNo synopsis availableRV32 and RV64
fmsub.hFloating-Point Multiply-Subtract Half-PrecisionRV32 and RV64
fmul.hFloating-Point Multiply Half-PrecisionRV32 and RV64
fmv.h (pseudo-op)RV32 and RV64
fneg.h (pseudo-op)RV32 and RV64
fnmadd.hFloating-Point Negate-Multiply-Add Half-PrecisionRV32 and RV64
fnmsub.hFloating-Point Negate-Multiply-Subtract Half-PrecisionRV32 and RV64
fround.hNo synopsis availableRV32 and RV64
froundnx.hNo synopsis availableRV32 and RV64
fsgnj.hFloating-Point Sign-Inject Half-PrecisionRV32 and RV64
fsgnjn.hFloating-Point Sign-Inject Negate Half-PrecisionRV32 and RV64
fsgnjx.hFloating-Point Sign-Inject XOR Half-PrecisionRV32 and RV64
fsqrt.hFloating-Point Square Root Half-PrecisionRV32 and RV64
fsub.hFloating-Point Subtract Half-PrecisionRV32 and RV64