FSGNJ.H

Float Sign Injection (Half)

FSGNJ.H rd, rs1, rs2

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

Details

Produces a result with the magnitude of rs1 and the sign bit taken from the source rs2. Used to implement floating-point absolute value, negate, and copy-sign.

Pseudocode Operation

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

Example

FSGNJ.H t0, a0, a1

Encoding

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

Operands

  • rd
    Destination register (integer)
  • rs1
    Source register 1 (integer)
  • rs2
    Sign Src