FCLASS.H

RISC-V FCLASS.H Instruction Details

Instruction ManualR-type

Examine half FP value; return 10-bit class mask. R-type, fmt=H(10).

Instruction Syntax

fclass.h rd, rs1
Operand Breakdown
Destination rd: register receiving the operation result.
Source rs1: register holding the first operand.
Source rs2: register holding the second operand.
ZfhFloating-Point Compare

Instruction Behavior

fclass.h classifies the half-precision value in f[rs1] and writes a 10-bit class mask to integer register rd.

Quick Understanding & Search Notes

fclass.h classifies the half-precision value in f[rs1] and writes a 10-bit class mask to integer register rd.

FCLASS does not round and does not compare numeric magnitude; it returns a class bit mask.
Classes include negative/positive infinity, normal, subnormal, zero, signaling NaN, and quiet NaN categories.

Common Usage Scenarios

Floating Point Basic

Understand this scenario with real code like «fclass.h x10, f0 # x10 = class of f0».

Numerical Computing

Understand this scenario with real code like «fclass.h x10, f0 # x10 = class of f0».

Pre-Use Checklist

Syntax Check
  • Confirm the current instruction format is R-type.
  • Confirm the operand order matches the example.
Semantic Check
  • Ensure the destination register usage is compatible with the calling convention.
  • Confirm this is not the lower-level form of a pseudo-instruction expansion.

Pitfalls / Common Confusions

FCLASS does not round and does not compare numeric magnitude; it returns a class bit mask.
Classes include negative/positive infinity, normal, subnormal, zero, signaling NaN, and quiet NaN categories.

FAQ

Does fclass.h modify the floating-point value?

No. It reads the floating-point source and writes the class mask to an integer register.

Is fclass.h affected by rm?

No. FCLASS has no rounded result.