FCVT.Q.L

RISC-V FCVT.Q.L Instruction Details

Instruction ManualR-type

Convert signed 64-bit int to quad FP [RV64]. R-type, fmt=Q(11), rs2=source L(10).

Instruction Syntax

fcvt.q.l rd, rs1
Operand Breakdown
Destination rd: register receiving the operation result.
Source rs1: register holding the first operand.
Source rs2: register holding the second operand.
QFloating-Point Convert

Instruction Behavior

fcvt.q.l converts a signed 64-bit integer source to a quad-precision floating-point result. The conversion is exact; software should encode rm as RNE (000), while implementations still process legal and reserved rm encodings as usual.

FCVT.Q.L Decode And Execute Animation

Shows the Q-extension FCVT flow: decode OP-FP fields, fmt/rs2 conversion selection, an rm=000 encoding example, read the integer source, then write the floating-point destination.

rd
rs1
fcvt.q.l
,
Execution Context
fmt=Q (11)
rs2=L
rounding: example rm=000; conversion never rounds
fflags: 0
RV64-only
31..27
26..25
24..20
19..15
14..12
11..7
6..0
11010
FCVT.Q
11
fmt=Q
00010
rs2=L
01011
rs1
000
rm=000 example
01010
rd
1010011
OP-FP
Execution Data Path
instruction
0xD6258553
opcode
1010011 -> OP-FP
funct5/fmt
11010 + 11 -> FCVT.Q.L
rs2
00010 -> L source
rm
000 -> example encoding; conversion never rounds
rd/rs1
fa0(f10) / a1(x11)
read
a1(x11) = -2049
convert
int64 -2049 -> Q -2049.0
write
fa0(f10) = -2049.0; 0
Current Step

Fetch: show the 32-bit OP-FP encoding

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

encoding: 0xD6258553
syntax : fcvt.q.l fa0(f10), a1(x11)
result : fa0(f10) = -2049.0; 0

The current 64-bit integer example is exactly representable as Q format, so example fflags remains 0.

FCVT Conversion View
L source
-2049
conversion
int64 -2049 -> Q -2049.0
writeback
fa0(f10) = -2049.0

The current 64-bit integer example is exactly representable as Q format, so example fflags remains 0.

This animation shows only Q-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.q.l converts a signed 64-bit integer source to a quad-precision floating-point result. The conversion is exact; software should encode rm as RNE (000), while implementations still process legal and reserved rm encodings as usual.

The rs2/fmt encoding selects source and destination formats; the mnemonic suffixes carry the main semantic distinction.
This integer-to-floating-point conversion is exact; rm is encoded but does not change the numeric result.
L/LU 64-bit integer source forms are RV64-only.
The integer source operand comes from x[rs1], not a floating-point register, so there is no source NaN-boxing requirement.
The Q extension sets FLEN to 128 bits, so the quad-precision result is written directly to the destination FP register.

Common Usage Scenarios

Floating Point Basic

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

Numerical Computing

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

Pre-Use Checklist

Syntax Check
  • Verify rd, rs1, rs2 (and rs3) are valid GPRs.
  • Confirm funct3 and funct7 encoding is correct.
Semantic Check
  • Check if the result affects subsequent branches or address calculations.
  • Ensure the rd register is not overwritten by another instruction.

Pitfalls / Common Confusions

L/LU 64-bit integer source forms are RV64-only.
The integer source operand comes from x[rs1], not a floating-point register, so there is no source NaN-boxing requirement.
The Q extension sets FLEN to 128 bits, so the quad-precision result is written directly to the destination FP register.

FAQ

When does rm matter for fcvt.q.l?

It does not matter for the numeric result. The source integer is exactly representable in the destination floating-point format, so rm does not cause rounding.

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

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