FSGNJ.H

Float Sign Injection (Half)

FSGNJ.H rd, rs1, rs2

Injects the sign of rs2 into rs1 (16-bit).

Encoding

Binary Layout
0010010
31:25
rs2
24:20
rs1
19:15
000
14:12
rd
11:7
1010011
6:0
 
Format R-Type
Opcode 0x24000053
Extension Zfh

Operands

  • rd
    Destination floating-point register
  • rs1
    Floating-point register (magnitude source)
  • rs2
    Floating-point register (sign source)

Example

FSGNJ.H ft0, fa0, fa1

Related

More in Zfh

Description

FSGNJ.H writes to rd a half-precision value with the magnitude of rs1 and the sign bit of rs2 (copy sign). It does not modify the other bits and raises no exception flags, even for NaN inputs.

Operation

F[rd] = {F[rs2][15], F[rs1][14:0]};