FCVT.S.L

RISC-V FCVT.S.L Instruction Details

Instruction ManualR-type

RV64 signed 64-bit integer-to-single precision conversion, rounded by rm/frm and written to FP rd.

Instruction Syntax

fcvt.s.l 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.L is an RV64-only integer-to-floating-point conversion. It converts the signed 64-bit integer in x[rs1] according to rm to single precision and writes f[rd]; NX is set when the target FP format cannot represent the value exactly.

FCVT.S.L Decode And Execute Animation

Shows the F-extension FCVT flow: decode OP-FP fields, fmt/rs2 conversion selection, rm rounding, read the integer source, then write the floating-point destination.

rd
rs1
rm
fcvt.s.l
,
,
Execution Context
fmt=S (00)
rs2=L
rounding: RNE nearest-even
fflags: NX
31..27
26..25
24..20
19..15
14..12
11..7
6..0
11010
FCVT.S
00
fmt=S
00010
rs2=L
01011
rs1
000
rm
01010
rd
1010011
OP-FP
Execution Data Path
instruction
0xD0258553
opcode
1010011 -> OP-FP
funct5/fmt
11010 + 00 -> FCVT.S.L
rs2
00010 -> L source
rm
000 -> RNE nearest-even
rd/rs1
fa0(f10) / a1(x11)
read
a1(x11) = -2147483649
convert
int64 -2147483649 -> S -2147483648.0
write
fa0(f10) = -2147483648.0; NX
Current Step

Fetch: show the 32-bit OP-FP encoding

The word is split as an R-type OP-FP instruction; FCVT conversion instructions use opcode 1010011.

encoding: 0xD0258553
syntax : fcvt.s.l fa0(f10), a1(x11), rne
result : fa0(f10) = -2147483648.0; NX

The current 64-bit integer example is not exactly representable as S format, so the rounded example shows NX.

FCVT Conversion View
L source
-2147483649
conversion
int64 -2147483649 -> S -2147483648.0
writeback
fa0(f10) = -2147483648.0

The current 64-bit integer example is not exactly representable as S format, so the rounded example shows NX.

This animation shows only F-extension FCVT ISA-visible encoding, source/destination register direction, rounding field, and example fflags; it does not model FPU pipelines, exception handling, NaN payloads, or microarchitecture.

Quick Understanding & Search Notes

fcvt.s.l is an RV64-only FCVT.S.L form: it reads a signed 64-bit integer from integer rs1, converts according to rm/frm to single precision, and writes FP rd.

OP-FP opcode is 1010011; funct5=11010 denotes integer-to-FP FCVT.
fmt=00 denotes the single precision destination format; rs2=00010 selects L as the integer source, not a normal second source register.
rd is an FP register and rs1 is an integer register; large 64-bit integers may set NX when the target FP format cannot represent them exactly.
This L/LU form is RV64-only; RV32 pages should not present it as an available instruction.

Common Usage Scenarios

Type Conversion

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

L/LU forms are RV64-only; do not use them on RV32.
rd is an FP register and rs1 is an integer register; the rs2 field only selects the L/LU format.
Single precision cannot represent every 64-bit integer; inexact results are rounded by rm and set NX.
The rm field may encode a static rounding mode; DYN uses fcsr.frm.

FAQ

Is FCVT.S.L available on RV32?

No. The official F/D conversion rules define the L/LU 64-bit integer forms as RV64-only.

Which register classes do rd and rs1 use in FCVT.S.L?

This is an integer-to-FP conversion: rd is an FP register and rs1 is an integer register.

What does the rs2 field mean in FCVT.S.L?

The rs2 field selects the L signed 64-bit integer format; it is not a second source operand in assembly syntax.