diff options
author | Szabolcs Nagy <nsz@port70.net> | 2018-09-20 23:14:11 +0000 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2018-10-15 14:41:59 -0400 |
commit | 7c5f3bb955123ba65bbdedee0e4499ef78a5747c (patch) | |
tree | cb05a4518e85d56141d0e2e0ebb03ba312dfe470 /src/math/powerpc/fmaf.c | |
parent | 1da534ada8a66424e0d23e94ab6750b689be6d64 (diff) | |
download | musl-7c5f3bb955123ba65bbdedee0e4499ef78a5747c.tar.gz musl-7c5f3bb955123ba65bbdedee0e4499ef78a5747c.tar.bz2 musl-7c5f3bb955123ba65bbdedee0e4499ef78a5747c.tar.xz musl-7c5f3bb955123ba65bbdedee0e4499ef78a5747c.zip |
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.
Diffstat (limited to 'src/math/powerpc/fmaf.c')
-rw-r--r-- | src/math/powerpc/fmaf.c | 15 |
1 files changed, 15 insertions, 0 deletions
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 <math.h> + +#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 |