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

fclass.h

T1 riscv fp insn
Floating-Point Classify 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 fclass.h instruction examines the half-precision value in floating-point register _fs1_ and writes to integer register _xd_ a 10-bit mask that indicates the class of the floating-point number.

Syntax / Encoding

fclass.h xd, fs1 | 111001000000xxxxx001xxxxx1010011 (mask=0xfff0707f match=0xe4001053)

Binary Encodings (1)

WidthFormatBit PatternMask / Match
32RV111001000000xxxxx001xxxxx10100110xfff0707f / 0xe4001053

Operands

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

Reference Notes

The `fclass.h` instruction examines the half-precision value in floating-point register _fs1_ and writes to integer register _xd_
a 10-bit mask that indicates the class of the floating-point number.

The format of the mask is described in the table below. The corresponding bit in _xd_ will be set if the property
is true and clear otherwise. All other bits in _xd_ are cleared. Note that exactly one bit in _xd_ will be set.
`fclass.h` does not set the floating-point exception flags.

.Format of result of `fclass` instruction.
[%autowidth,float="center",align="center",cols="^,<",options="header",]
|===
|_xd_ bit |Meaning
|0 |_fs1_ is latexmath:[$-\infty$].
|1 |_fs1_ is a negative normal number.
|2 |_fs1_ is a negative subnormal number.
|3 |_fs1_ is latexmath:[$-0$].
|4 |_fs1_ is latexmath:[$+0$].
|5 |_fs1_ is a positive subnormal number.
|6 |_fs1_ is a positive normal number.
|7 |_fs1_ is latexmath:[$+\infty$].
|8 |_fs1_ is a signaling NaN.
|9 |_fs1_ is a quiet NaN.
|===