Skip to content
This repository has been archived by the owner on Sep 2, 2023. It is now read-only.

Add fused multiply-accumulate (FMA) #107

Open
mbitsnbites opened this issue Aug 25, 2020 · 0 comments
Open

Add fused multiply-accumulate (FMA) #107

mbitsnbites opened this issue Aug 25, 2020 · 0 comments

Comments

@mbitsnbites
Copy link
Member

mbitsnbites commented Aug 25, 2020

Any good, modern ISA should have a fused multiply-accumulate instruction.

We could add four 3-operand instructions:

Name Operands Operation
FMA a, b, c a ← a + b * c
FMS a, b, c a ← a - b * c
FNMA a, b, c a ← -a - b * c
FNMS a, b, c a ← -a + b * c

Some ISA:s have more flexibility in selecting the output register:

  • RISC-V has a special four-operand instruction encoding for FMADD, to freely select the output register.
  • Likewise, early AMD x86 AVX had FMA4 with four operands. That instruction is no longer supported in newer CPU:s though.
  • The Intel/AMD x86 AVX ISA has FMA3 with three operands, but three variants that effectively allow the selection of which of the three registers to use as an output register.
  • ARM (VFPv4/NEONv2) has a three-operand FMA.
@mbitsnbites mbitsnbites changed the title ISA: Add FMA? Add fused multiply-accumulate (FMA)? Aug 28, 2020
@mbitsnbites mbitsnbites changed the title Add fused multiply-accumulate (FMA)? Add fused multiply-accumulate (FMA) May 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant