FCVT.L.H

RISC-V FCVT.L.H Instruction Details

Instruction ManualR-type

Convert half FP to signed 64-bit int [RV64]. R-type, fmt=L(10), rs2=H(10).

Instruction Syntax

fcvt.l.h rd, rs1, rm
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 Convert

Instruction Behavior

fcvt.l.h converts a half-precision source operand to a signed 64-bit integer result. Floating-point-to-integer conversion rounds according to rm and writes integer register rd.

Quick Understanding & Search Notes

fcvt.l.h converts a half-precision source operand to a signed 64-bit integer result. Floating-point-to-integer conversion rounds according to rm and writes integer register rd.

The rs2/fmt encoding selects source and destination formats; the mnemonic suffixes carry the main semantic distinction.
L/LU 64-bit integer result forms are RV64-only.
Out-of-range integer targets or NaN inputs follow the official invalid floating-point-to-integer conversion rules and set NV.
Floating-point source operands in wider FLEN registers must satisfy NaN-boxing rules.

Common Usage Scenarios

Floating Point Basic

Understand this scenario with real code like «fcvt.l.h x10, f0, rtz # x10 = (long)f0 (RV64)».

Numerical Computing

Understand this scenario with real code like «fcvt.l.h x10, f0, rtz # x10 = (long)f0 (RV64)».

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

L/LU 64-bit integer result forms are RV64-only.
Out-of-range integer targets or NaN inputs follow the official invalid floating-point-to-integer conversion rules and set NV.
Floating-point source operands in wider FLEN registers must satisfy NaN-boxing rules.

FAQ

When does rm matter for fcvt.l.h?

When conversion requires rounding, rm or dynamic frm selects the rounding direction; out-of-range or NaN inputs follow the official invalid-conversion rule.

How does fcvt.l.h differ from related FCVT instructions?

It differs by source/destination format, integer signedness, RV64 restrictions, and whether rounding or invalid conversion can occur.