FLEQ.S
FLEQ.S is a single-precision floating-point comparison instruction defined as part of the RISC-V Zfa extension. It compares two single-precision floating-point register values, writing a boolean result that indicates whether the first operand is less than or equal to the second.
Semantics
FLEQ.S is defined analogously to the existing FLE.S instruction, with the distinguishing behavior that quiet NaN inputs do not cause the invalid operation exception flag to be set. This makes the FLEQ/FLTQ family suitable for use cases such as min/max implementations where NaN inputs are expected to propagate through comparisons silently rather than trap.
Extension membership
- FLEQ.S belongs to the Zfa extension.
- Zfa is a small floating-point extension derived from the base F and D extensions; it adds additional floating-point instructions including
FLI,FMINM/FMAXM,FROUND/FROUNDNX,FMVH.X.D,FMVP.D.X,FLEQ/FLTQ, andFCVTMOD.W.D. - The full Zfa instruction set covers the
.H(half-precision),.S(single-precision), and.D(double-precision) floating-point variants where applicable; FLEQ itself is defined for[HSD].
Implementation
FLEQ.S (along with the rest of the Zfa instructions) was added to the sail-riscv formal specification in commit f2d8e1b9, which introduced both the Zfa existence macro and the concrete instruction encodings for the new operations. The commit notes that FLEQ and FLTQ are defined like FLE and FLT respectively, except that quiet NaN inputs do not cause the invalid operation exception flag to be set.
See also
- Zfa — the parent extension to which FLEQ.S belongs.
- FLE — the base floating-point less-than-or-equal-to instruction that FLEQ.S mirrors.
- sail-riscv — the RISC-V Sail specification artifact in which FLEQ.S was implemented.
Citations
The summary, semantics, and historical implementation details above are drawn from the sail-riscv commit message that introduced Zfa support (commit f2d8e1b9, part of the 9b4778120 commits history).