FMINM.Q

RISC-V FMINM.Q Instruction Details

Instruction ManualR-type

Return the minimum of two quad-precision floating-point operands.

Instruction Syntax

fminm.q rd, rs1, rs2
Operand Breakdown
rd: destination floating-point register receiving the formatted result.
rs1/rs2: source floating-point registers; arithmetic/rounding forms with rm use rm or dynamic frm for rounding mode.
ZfaQFloating-Point Arithmetic

Instruction Behavior

FMINM.Q is the Zfa quad-precision IEEE 754-2019 minimum operation: if either input is NaN, the result is canonical NaN; otherwise it returns the numerically smaller operand and handles -0.0 versus +0.0 as specified.

Quick Understanding & Search Notes

FMINM.Q's key search point is NaN handling. The M form is the Zfa version and returns canonical NaN if either input is NaN.

-0.0 and +0.0 are ordered: -0.0 is less than +0.0.
The instruction does not use rm; it is a selection operation, not rounded arithmetic.

Common Usage Scenarios

Floating-Point Compare

Understand this scenario with real code like «fminm.q f0, f1, f2 # f0 = IEEE 754-2019 min(f1,f2)».

Numerical Computing

Understand this scenario with real code like «fminm.q f0, f1, f2 # f0 = IEEE 754-2019 min(f1,f2)».

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

Unlike ordinary FMIN/FMAX, FMINM/FMAXM returns canonical NaN if either input is NaN.
A signaling NaN sets NV; quiet-NaN handling differs between ordinary and M forms.
-0.0 is considered less than +0.0.

FAQ

What is the main difference from the ordinary form?

The M form returns canonical NaN if either input is NaN; the ordinary form returns the other non-NaN operand when exactly one input is NaN.

Does FMINM.Q round?

No. It selects between two operands and has no rm rounding field.