FMV.X.H

RISC-V FMV.X.H Instruction Details

Instruction ManualR-type

Bit-copy a half-precision floating-point encoding to an integer register.

Instruction Syntax

fmv.x.h 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.
ZfhZfhminFloating-Point Convert

Instruction Behavior

FMV.X.H bit-copies the half-precision floating-point encoding in f[rs1] into x[rd]; bit 15 is copied into the upper bits of the integer register. This is a bit move, not a floating-point-to-integer numeric conversion; it does not round and sets no floating-point exception flags.

Quick Understanding & Search Notes

FMV.X.H'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; FMV.X.H copies bit 15 into the upper integer-register bits.

Common Usage Scenarios

Floating-Point Bit Move

Understand this scenario with real code like «fmv.x.h x10, f0 # x10[15:0] = bits of f0».

Debugging Bit Patterns

Understand this scenario with real code like «fmv.x.h x10, f0 # x10[15:0] = bits of f0».

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 destination holds the encoding bit pattern; the upper bits are sign-extended from bit 15, not a rounded integer value.

FAQ

How is FMV.X.H different from FCVT?

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

Does FMV.X.H set fflags?

No. It is neither arithmetic nor numeric conversion.