FMV.W.X

RISC-V FMV.W.X Instruction Details

Instruction ManualR-type

Bit-copy low integer-register bits into a single-precision floating-point register.

Instruction Syntax

fmv.w.x rd, rs1
Operand Breakdown
rd/rs fields denote integer or floating-point registers depending on the direction of this instruction.
FMV forms copy bit patterns; they are not FCVT numeric conversions and do not use rm.
FFloating-Point Convert

Instruction Behavior

FMV.W.X bit-copies the low 32 bits of x[rs1] into f[rd] as a single-precision floating-point encoding; in a wider FLEN register the result is NaN-boxed. This is a bit move, not a numeric conversion.

Quick Understanding & Search Notes

FMV.W.X's core idea is bit-pattern movement. Use FCVT for numeric conversion and rounding; use FMV forms when preserving NaN payloads or inspecting raw encodings.

FMV instructions do not use an rm field.
A bit move does not canonicalize NaNs or change the input according to numeric value.

Common Usage Scenarios

Floating-Point Bit Move

Understand this scenario with real code like «fmv.w.x f0, x10 # f0 gets bits from x10[31:0], NaN-boxed if FLEN>32».

Debugging Bit Patterns

Understand this scenario with real code like «fmv.w.x f0, x10 # f0 gets bits from x10[31:0], NaN-boxed if FLEN>32».

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

This is a bit copy, not an FCVT numeric conversion.
It does not use rm and does not set fflags.
The integer source provides only the low bits needed by the destination format.

FAQ

How is FMV.W.X different from FCVT?

FMV copies the bit pattern; FCVT performs numeric conversion, can round, and can set exception flags.

Does FMV.W.X set fflags?

No. It is neither arithmetic nor numeric conversion.