From 7c5f3bb955123ba65bbdedee0e4499ef78a5747c Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Thu, 20 Sep 2018 23:14:11 +0000 Subject: powerpc: add single instruction fabs, fabsf, fma, fmaf, sqrt, sqrtf These are only available on hard float target and sqrt is not available in the base ISA, so further check is used. --- src/math/powerpc/fmaf.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/math/powerpc/fmaf.c (limited to 'src/math/powerpc/fmaf.c') diff --git a/src/math/powerpc/fmaf.c b/src/math/powerpc/fmaf.c new file mode 100644 index 00000000..a99a2a3b --- /dev/null +++ b/src/math/powerpc/fmaf.c @@ -0,0 +1,15 @@ +#include + +#ifdef _SOFT_FLOAT + +#include "../fmaf.c" + +#else + +float fmaf(float x, float y, float z) +{ + __asm__("fmadds %0, %1, %2, %3" : "=f"(x) : "f"(x), "f"(y), "f"(z)); + return x; +} + +#endif -- cgit 1.4.1