# `fmax.s`

[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/fmax.s

**Floating maximum**

Category: Floating point

Stores the larger of the single-precision values in the second and third registers in the first.

[RISC-V manual: fmax.s](https://docs.riscv.org/reference/isa/v20260120/unpriv/f-st-ext.html#norm:fmin-s_fmax-s_op)

## Forms

- `fmax.s 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: .float 6.0
b: .float 2.0
.text
la t0, a
flw f1, 0(t0)
la t1, b
flw f2, 0(t1)
# Choose between 6.0 and 2.0; f3 (ft3) holds 6.0.
fmax.s f3, f1, f2
```
