fmv.x.h

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

This instruction is defined by:

  • anyOf:

    • Zfh, version >= 0

    • Zfhmin, version >= 0

This instruction is included in the following profiles:

  • RVA22U64 (Mandatory)

Encoding

svg

Assembly format

fmv.x.h rd, fs1

Synopsis

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

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.

Access

M HS U VS VU

Always

Always

Always

Always

Always

Decode Variables

Bits<5> fs1 = $encoding[19:15];
Bits<5> rd = $encoding[11:7];

Execution

  • IDL

  • Sail

check_f_ok($encoding);
X[rd] = sext(f[fs1][15:0], 16);
{
  let rs1_val_X            = X(rs1);
  let rd_val_H             = rs1_val_X [15..0];
  F(rd) = nan_box (rd_val_H);
  RETIRE_SUCCESS
}

Exceptions

This instruction may result in the following synchronous exceptions:

  • IllegalInstruction