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
Operands
-
rd
Destination floating-point register -
rs1
Source integer register
Example
FCVT.H.W ft0, a0
Related
More in Zfh
Reference
View in RISC-V Unprivileged ISA Specification ↗
RISC-V ISA Manual
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]);