FCVT.W.H

Convert Half to Word

FCVT.W.H rd, rs1

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

Encoding

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

Operands

  • rd
    Destination integer register
  • rs1
    Floating-point register

Example

FCVT.W.H t0, fa0

Related

More in Zfh

Description

Converts the half-precision value in rs1 to a signed 32-bit integer in rd. RV64 sign-extends the 32-bit result. If the rounded value is out of range it is clipped to the nearest representable value and the invalid-operation flag is set; NaN and +infinity give the largest value (2^31-1), -infinity the smallest (-2^31). Rounding follows the rm field; inexact is set if the result differs and invalid is not set.

Operation

R[rd] = sext(f16_to_i32(F[rs1]));