xref: /haiku/src/system/libroot/posix/musl/math/riscv64/fma.c (revision f504f61099b010fbfa94b1cc63d2e9072c7f7185)
1*f504f610SAugustin Cavalier #include <math.h>
2*f504f610SAugustin Cavalier 
3*f504f610SAugustin Cavalier #if __riscv_flen >= 64
4*f504f610SAugustin Cavalier 
fma(double x,double y,double z)5*f504f610SAugustin Cavalier double fma(double x, double y, double z)
6*f504f610SAugustin Cavalier {
7*f504f610SAugustin Cavalier 	__asm__ ("fmadd.d %0, %1, %2, %3" : "=f"(x) : "f"(x), "f"(y), "f"(z));
8*f504f610SAugustin Cavalier 	return x;
9*f504f610SAugustin Cavalier }
10*f504f610SAugustin Cavalier 
11*f504f610SAugustin Cavalier #else
12*f504f610SAugustin Cavalier 
13*f504f610SAugustin Cavalier #include "../fma.c"
14*f504f610SAugustin Cavalier 
15*f504f610SAugustin Cavalier #endif
16