# `fmadd.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/fmadd.d

**Fused multiply add (64 bit)**

Category: Floating point

Multiplies the second and third registers and adds the fourth, in double precision with a single rounding, and stores the result in the first.

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

## Forms

- `fmadd.d f1, f2, f3, f4, rm`

## Pseudo-instructions

The processor does not have these forms. The assembler replaces each of them with one or more real instructions. Open a row to see them.

- `fmadd.d f1, f2, f3, f4`
  - `fmadd.d f1, f2, f3, f4` → `fmadd.d f1, f2, f3, f4, dyn`

## 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`.
- `f4`: A floating-point register. It may be the same register as `f1`.
- `rm`: A rounding mode: `rne` (nearest, ties to even), `rtz` (toward zero), `rdn` (toward negative infinity), `rup` (toward positive infinity), `rmm` (nearest, ties away from zero) or `dyn` (use the rounding mode in `fcsr`).

## 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)
# Compute (6*6)+2 in one fused operation; f3 (ft3) is 38.0.
fmadd.d f3, f1, f1, f2
```
