FCVT.H.W

Convert Word to Half

FCVT.H.W rd, rs1

Converts a 32-bit signed integer to a 16-bit floating-point number.

Encoding

Binary Layout
110101000000
31:20
rs1
19:15
rm
14:12
rd
11:7
1010011
6:0
 
Format I-Type (Float)
Opcode 0xD4000053
Extension Zfh

Operands

  • rd
    Destination floating-point register
  • rs1
    Source integer register

Example

FCVT.H.W ft0, a0

Related

More in Zfh

Description

Converts the signed 32-bit integer in rs1 to a half-precision value in rd. The result is rounded according to the rm field and inexact is set if it differs from the integer (values above 65504 overflow to infinity or the largest finite value depending on rm).

Operation

F[rd] = i32_to_f16(R[rs1]);