Home/Instructions/Double Bits to Integer Register
FMV.X.D

RISC-V FMV.X.D Instruction Details

Instruction ManualR-type

RV64 double-precision bit-pattern move from FP to integer register, with no numeric conversion.

Instruction Syntax

fmv.x.d rd, rs1

rd: integer x0–x31; rs1: FP f0–f31. x0 discards writes, while f0 is an ordinary FP source; there is no immediate or rm operand.

OP-FP fixes funct7=1110001, rs2=00000, funct3=000 and opcode=1010011; only rd and rs1 vary.

D depends on F and requires XLEN≥64, FLEN≥64 and enabled FP state. Read the low 64 bits of f[rs1], ignoring higher bits.

Copy the double-precision encoding bit for bit to x[rd], preserving non-canonical NaN payloads without rounding or setting fflags; this is not FCVT.L.D numeric conversion.

DFloating-Point Bit Move

Instruction Behavior

FMV.X.D moves the IEEE 754 double-precision 64-bit encoding between integer and floating-point registers. It does not modify transferred bits and preserves non-canonical NaN payloads; this form is defined only when XLEN>=64. It writes the double-precision encoding from f[rs1] to x[rd] and sets no FP exception flags.

FMV.X.D Decode And Execute Animation

Shows the D-extension FMV.X.D bit-pattern move: decode OP-FP fields, read the source bit pattern, then write the destination without numeric conversion.

rd
rs1
fmv.x.d
,
Execution Context
fmt=D (01)
FLEN>=64

Assumes required extensions and enabled FP state. Integer input covers XLEN bits; FP input supplies only the selected format's bit slice, ignoring upper NaN-box bits.

31..27
26..25
24..20
19..15
14..12
11..7
6..0
11100
funct5=to-x
01
fmt=D
00000
rs2=00000
01011
rs1
000
funct3=000
01010
rd
1010011
OP-FP
Execution Data Path
instruction
0xE2058553
opcode
1010011 -> OP-FP
funct5/fmt
11100 + 01 -> funct7 1110001
rs2
00000 fixed for FMV.X.D
rd/rs1
a0(x10) / fa1(f11)
read bits
fa1(f11) = 0x400921FB54442D18
bit move
copy 64-visible bits -> 0x400921FB54442D18
write
Not written yet
Current Step

Fetch: show the 32-bit OP-FP encoding

The word is split as an R-type OP-FP instruction; FMV bit moves use opcode 1010011.

encoding: 0xE2058553
syntax : fmv.x.d x10, f11
result : Not written yet
Bit-Pattern Move View
FP source bits
0x400921FB54442D18
unchanged payload
0x400921FB54442D18
writeback
Not written yet

FMV.X.D is defined only when XLEN>=64 and writes the 64-bit double-precision encoding unchanged to the integer register without setting fflags.

This animation shows only D-extension FMV ISA-visible encoding and bit-pattern movement; it does not model FPU pipelines, numeric FP interpretation, exception handling, or microarchitecture.

Quick Understanding & Search Notes

FMV.X.D is defined only when XLEN>=64 and moves the 64-bit double-precision encoding unchanged into an integer register. It does not convert a double to an integer value and does not canonicalize NaN payloads.

In the D extension, this 64-bit move form requires XLEN>=64.
Transferred bits are unchanged, including non-canonical NaN payloads.
rm is not used; no rounding occurs and FP exception flags are not set.

Common Usage Scenarios

double bit inspection

With RV64, D and FP state enabled, initialize the low 64 bits of f0 to 0x7FF8000000000042 and execute fmv.x.d x10, f0 # x10 = bits of f0 (RV64). x10 receives the same 64-bit encoding, preserving the NaN payload and leaving fflags unchanged.

NaN payload preservation

With RV64, D and FP state enabled, initialize the low 64 bits of f0 to 0x7FF8000000000042 and execute fmv.x.d x10, f0 # x10 = bits of f0 (RV64). x10 receives the same 64-bit encoding, preserving the NaN payload and leaving fflags unchanged.

RV64 raw encoding debug

With RV64, D and FP state enabled, initialize the low 64 bits of f0 to 0x7FF8000000000042 and execute fmv.x.d x10, f0 # x10 = bits of f0 (RV64). x10 receives the same 64-bit encoding, preserving the NaN payload and leaving fflags unchanged.

Pre-Use Checklist

Syntax Check
  • rd: integer x0–x31; rs1: FP f0–f31. x0 discards writes, while f0 is an ordinary FP source; there is no immediate or rm operand.
  • OP-FP fixes funct7=1110001, rs2=00000, funct3=000 and opcode=1010011; only rd and rs1 vary.
Semantic Check
  • D depends on F and requires XLEN≥64, FLEN≥64 and enabled FP state. Read the low 64 bits of f[rs1], ignoring higher bits.
  • Copy the double-precision encoding bit for bit to x[rd], preserving non-canonical NaN payloads without rounding or setting fflags; this is not FCVT.L.D numeric conversion.

Pitfalls / Common Confusions

This is a bit-pattern move, not an integer/FP numeric conversion; use FCVT for conversion.
Defined only for XLEN>=64; RV32 has no FMV.D.X/FMV.X.D.
It sets no FP exception flags and does not canonicalize NaN payloads.

FAQ

Can FMV.X.D be used on RV32?

No. The official D extension defines FMV.X.D / FMV.D.X 64-bit integer/FP register moves only when XLEN>=64.

How is FMV.X.D different from FCVT.L.D?

FMV.X.D preserves the 64-bit encoding bits; FCVT.L.D performs double-to-64-bit-integer numeric conversion, which can round and set fflags.