FCVT.H.S

Convert Single to Half

FCVT.H.S rd, rs1

Converts a 32-bit single-precision float to a 16-bit half-precision float.

Encoding

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

Operands

  • rd
    Dest (Half)
  • rs1
    Source (Single)

Example

FCVT.H.S f0, f1

// Demote Float to Half.

Related

More in Zfhmin

Description

Converts the single-precision value in rs1 to half precision and writes it to rd, rounded according to the rm field. Overflow, underflow and inexact results set the corresponding flags; a NaN input gives the canonical NaN. Requires Zfhmin or Zfh.

Operation

F[rd] = f32_to_f16(F[rs1]);