aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2019-03-20 04:14:28 +0000
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2019-04-17 15:14:53 -0300
commit3a16dd780eeba60266d75e4a562536cc0785bc4e (patch)
tree57c7950840936d10e886dec25e25a329f0b4d183
parent1dac8bd6f23d574c841982a17e984111dc8366d7 (diff)
downloadglibc-3a16dd780eeba60266d75e4a562536cc0785bc4e.zip
glibc-3a16dd780eeba60266d75e4a562536cc0785bc4e.tar.gz
glibc-3a16dd780eeba60266d75e4a562536cc0785bc4e.tar.bz2
powerpc: fma using builtins
This patch just refactor the assembly implementation to use compiler builtins instead. Checked on powerpc-linux-gnu (built without --with-cpu, with --with-cpu=power4 and with --with-cpu=power5+ and --disable-multi-arch), powerpc64-linux-gnu (built without --with-cp and with --with-cpu=power5+ and --disable-multi-arch). * sysdeps/powerpc/fpu/s_fma.S: Remove file. * sysdeps/powerpc/fpu/s_fmaf.S: Likewise. * sysdeps/powerpc/fpu/s_fma.c: New file. * sysdeps/powerpc/fpu/s_fmaf.c: Likewise.
-rw-r--r--ChangeLog5
-rw-r--r--sysdeps/powerpc/fpu/s_fma.c (renamed from sysdeps/powerpc/fpu/s_fma.S)12
-rw-r--r--sysdeps/powerpc/fpu/s_fmaf.c (renamed from sysdeps/powerpc/fpu/s_fmaf.S)12
3 files changed, 15 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index a4eb322..8a852d9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2019-04-17 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+ * sysdeps/powerpc/fpu/s_fma.S: Remove file.
+ * sysdeps/powerpc/fpu/s_fmaf.S: Likewise.
+ * sysdeps/powerpc/fpu/s_fma.c: New file.
+ * sysdeps/powerpc/fpu/s_fmaf.c: Likewise.
+
* sysdeps/powerpc/fpu/s_fabs.S: Remove file.
* sysdeps/powerpc/fpu/s_fabsf.S: Likewise.
diff --git a/sysdeps/powerpc/fpu/s_fma.S b/sysdeps/powerpc/fpu/s_fma.c
index 92e08eb..688f9ba 100644
--- a/sysdeps/powerpc/fpu/s_fma.S
+++ b/sysdeps/powerpc/fpu/s_fma.c
@@ -1,5 +1,5 @@
/* Compute x * y + z as ternary operation. PowerPC version.
- Copyright (C) 2010-2019 Free Software Foundation, Inc.
+ Copyright (C) 2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,10 +19,8 @@
#include <sysdep.h>
#include <libm-alias-double.h>
-ENTRY_TOCLESS(__fma)
-/* double [f1] fma (double [f1] x, double [f2] y, double [f3] z); */
- fmadd fp1,fp1,fp2,fp3
- blr
-END(__fma)
-
+double __fma (double x, double y, double z)
+{
+ return __builtin_fma (x, y, z);
+}
libm_alias_double (__fma, fma)
diff --git a/sysdeps/powerpc/fpu/s_fmaf.S b/sysdeps/powerpc/fpu/s_fmaf.c
index 9579e94..38b59e1 100644
--- a/sysdeps/powerpc/fpu/s_fmaf.S
+++ b/sysdeps/powerpc/fpu/s_fmaf.c
@@ -1,5 +1,5 @@
/* Compute x * y + z as ternary operation. PowerPC version.
- Copyright (C) 2010-2019 Free Software Foundation, Inc.
+ Copyright (C) 2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,10 +19,8 @@
#include <sysdep.h>
#include <libm-alias-float.h>
-ENTRY_TOCLESS(__fmaf)
-/* float [f1] fmaf (float [f1] x, float [f2] y, float [f3] z); */
- fmadds fp1,fp1,fp2,fp3
- blr
-END(__fmaf)
-
+float __fmaf (float x, float y, float z)
+{
+ return __builtin_fmaf (x, y, z);
+}
libm_alias_float (__fma, fma)