fclass.h
Floating-Point Classify Half-Precision
- Extension
- Zfh
- XLEN
- RV32 and RV64
- Assembly (riscv-unified-db)
fclass.h xd, fs1- Length
- 32-bit
Encoding
| 3127 | 2625 | 2420 | 1915 | 1412 | 117 | 62 | 10 | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 11100 | 10 | 00000 | rs1 | 001 | rd | 10100 | 11 | ||||||||||||||||||||||||
Match 0xe4001053, mask 0xfff0707f. Source: fclass.h rd rs1 24..20=0 31..27=0x1C 14..12=1 26..25=2 6..2=0x14 1..0=3 in riscv-opcodes/extensions/rv_zfh.
| Field | Bits | riscv-opcodes name |
|---|---|---|
| rs1 | 19:15 | rs1 |
| rd | 11:7 | rd |
Description
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.
| xd bit | Meaning |
|---|---|
| 0 | fs1 is $-\infty$. |
| 1 | fs1 is a negative normal number. |
| 2 | fs1 is a negative subnormal number. |
| 3 | fs1 is $-0$. |
| 4 | fs1 is $+0$. |
| 5 | fs1 is a positive subnormal number. |
| 6 | fs1 is a positive normal number. |
| 7 | fs1 is $+\infty$. |
| 8 | fs1 is a signaling NaN. |
| 9 | fs1 is a quiet NaN. |
Description from riscv-unified-db, reformatted.