Webcentive RISC-V Reference

fmv.x.h

Move half-precision value from floating-point to integer register

Extension
Zfhmin
XLEN
RV32 and RV64
Assembly (riscv-unified-db)
fmv.x.h xd, fs1
Length
32-bit

Encoding

312726252420191514121176210
111001000000rs1000rd1010011

Match 0xe4000053, mask 0xfff0707f. Source: fmv.x.h rd rs1 24..20=0 31..27=0x1C 14..12=0 26..25=2 6..2=0x14 1..0=3 in riscv-opcodes/extensions/rv_zfhmin.

FieldBitsriscv-opcodes name
rs119:15rs1
rd11:7rd

Description

Moves the half-precision value in floating-point register fs1 represented in IEEE 754-2008 encoding to the lower 16 bits of integer register xd.

The bits are not modified in the transfer, and in particular, the payloads of non-canonical NaNs are preserved.

The highest XLEN-16 bits of the destination register are filled with copies of the floating-point number's sign bit.

Description from riscv-unified-db, reformatted.

Operation

check_f_ok($encoding);

X[xd] = sext(F[fs1][15:0], 16);

Pseudocode in riscv-unified-db’s IDL, quoted unchanged.

Specification and related pages