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

RISC-V FCVT.LU.S Instruction Details

Instruction ManualR-type

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

Instruction Syntax

fcvt.lu.s 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.LU.S is an RV64 floating-point-to-integer conversion instruction. It rounds the single precision value in f[rs1] to a unsigned 64-bit integer in x[rd] according to rm. 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.LU.S 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.lu.s x10, f0, rtz # x10 = (ulong)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

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.
Floating-to-integer overflow, infinities, or NaNs do not wrap like integer arithmetic; they follow the official clipped/invalid conversion rule.

FAQ

Is FCVT.LU.S available on RV32?

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

Does FCVT.LU.S ignore rm?

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