Home/Instructions/FCVT-S-LU
FCVT.S.LU

RISC-V FCVT.S.LU Instruction Details

Instruction ManualR-type

RV64 integer-to-floating-point conversion between unsigned 64-bit integer and single precision, using rm/frm conversion rules.

Instruction Syntax

fcvt.s.lu 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.
FFloating-Point Convert

Instruction Behavior

FCVT.S.LU is an RV64 integer-to-floating-point conversion instruction. It converts the unsigned 64-bit integer in x[rs1] to a single precision value in f[rd]. Inexact results set NX; floating-to-integer out-of-range inputs or NaNs follow the official FCVT.int clipped-result rule and set NV.

Quick Understanding & Search Notes

FCVT.S.LU is an RV64 L/LU FCVT form; the key points are 64-bit integer width, the rm rounding field, and exception-flag behavior.

D-extension double conversions follow the analogous F-extension single rules with a different FP format.
NX indicates the rounded result differs from the operand; NV is for invalid floating-to-integer conversion.

Common Usage Scenarios

Type Conversion

Understand this scenario with real code like «fcvt.s.lu f0, x10, rne # f0 = (float)(ulong)x10 (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

These L/LU forms are RV64 instructions; RV32 has no 64-bit integer source/destination form.
All FCVT integer/FP conversions use the rm field, with DYN selecting frm.
Large 64-bit integers may be inexact when converted to floating point and set NX.

FAQ

Is FCVT.S.LU available on RV32?

No. L/LU are 64-bit integer conversion forms and are defined as RV64-only.

Does FCVT.S.LU ignore rm?

No. The official rule says integer/FP conversions round according to the rm field, with DYN using frm.