# `fsgnj.d`

[RISC-V Documentation](https://asm-editor.specy.app/documentation/risc-v.md) › [Instructions](https://asm-editor.specy.app/documentation/risc-v/instruction.md)

Web page: https://asm-editor.specy.app/documentation/risc-v/instruction/fsgnj.d

**Floating point sign injection (64 bit)**

Category: Floating point

Copies the second register into the first with the sign bit taken from the third, in double precision.

[RISC-V manual: fsgnj.d](https://docs.riscv.org/reference/isa/v20260120/unpriv/d-st-ext.html#norm:fsgnj-d_fsgnjn-d_fsgnjx-d_op)

## Forms

- `fsgnj.d f1, f2, f3`

## Operands

- `f1`: Any floating-point register, `f0` to `f31`, or its named alias, such as `ft0`, `fa0` or `ft11`.
- `f2`: A floating-point register. It may be the same register as `f1`.
- `f3`: A floating-point register. It may be the same register as `f1`.

## Example

```riscv
.data
a: .double 6.0
b: .double 2.0
.text
la t0, a
fld f1, 0(t0)
la t1, b
fld f2, 0(t1)
# Copy magnitude 6.0 and combine its sign with -2.0; f3 (ft3) becomes -6.0.
fneg.d f2, f2
fsgnj.d f3, f1, f2
```
