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/fabsf.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/math/powerpc/fabsf.c (limited to 'src/math/powerpc/fabsf.c') diff --git a/src/math/powerpc/fabsf.c b/src/math/powerpc/fabsf.c new file mode 100644 index 00000000..d88b5911 --- /dev/null +++ b/src/math/powerpc/fabsf.c @@ -0,0 +1,15 @@ +#include + +#ifdef _SOFT_FLOAT + +#include "../fabsf.c" + +#else + +float fabsf(float x) +{ + __asm__ ("fabs %0, %1" : "=f"(x) : "f"(x)); + return x; +} + +#endif -- cgit v1.2.1