xref: /haiku/src/system/libroot/posix/musl/math/x86_64/fma.c (revision a127b88ecbfab58f64944c98aa47722a18e363b2)
1 #include <math.h>
2 
3 #if __FMA__
4 
5 double fma(double x, double y, double z)
6 {
7 	__asm__ ("vfmadd132sd %1, %2, %0" : "+x" (x) : "x" (y), "x" (z));
8 	return x;
9 }
10 
11 #elif __FMA4__
12 
13 double fma(double x, double y, double z)
14 {
15 	__asm__ ("vfmaddsd %3, %2, %1, %0" : "=x" (x) : "x" (x), "x" (y), "x" (z));
16 	return x;
17 }
18 
19 #else
20 
21 #include "../fma.c"
22 
23 #endif
24