Home/Instructions/FCVT-Q-WU
FCVT.Q.WU

RISC-V FCVT.Q.WU Instruction Details

Instruction ManualR-type

Convert unsigned 32-bit int to quad FP. Always exact. R-type, fmt=Q(11), rs2=source WU(01).

Instruction Syntax

fcvt.q.wu 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.wu converts an unsigned 32-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.WU 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.wu
,
Execution Context
fmt=Q (11)
rs2=WU
rounding: example rm=000; conversion never rounds
fflags: 0
31..27
26..25
24..20
19..15
14..12
11..7
6..0
11010
FCVT.Q
11
fmt=Q
00001
rs2=WU
01011
rs1
000
rm=000 example
01010
rd
1010011
OP-FP
Execution Data Path
instruction
0xD6158553
opcode
1010011 -> OP-FP
funct5/fmt
11010 + 11 -> FCVT.Q.WU
rs2
00001 -> WU source
rm
000 -> example encoding; conversion never rounds
rd/rs1
fa0(f10) / a1(x11)
read
a1(x11) = 0xFFFFFFFF (4294967295)
convert
uint32 0xFFFFFFFF (4294967295) -> Q 4294967295.0
write
fa0(f10) = 4294967295.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: 0xD6158553
syntax : fcvt.q.wu fa0(f10), a1(x11)
result : fa0(f10) = 4294967295.0; 0

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

FCVT Conversion View
WU source
0xFFFFFFFF (4294967295)
conversion
uint32 0xFFFFFFFF (4294967295) -> Q 4294967295.0
writeback
fa0(f10) = 4294967295.0

The current 32-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.wu converts an unsigned 32-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.
W/WU forms read a 32-bit signed or unsigned integer source value.
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.wu f0, x10 # f0 = (quad)(unsigned)x10».

Numerical Computing

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

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

W/WU forms read a 32-bit signed or unsigned integer source value.
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.wu?

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.wu differ from related FCVT instructions?

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