about summary refs log tree commit diff
path: root/sysdeps/powerpc/fpu/s_fma.c
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 /sysdeps/powerpc/fpu/s_fma.c
parent1dac8bd6f23d574c841982a17e984111dc8366d7 (diff)
downloadglibc-3a16dd780eeba60266d75e4a562536cc0785bc4e.tar.gz
glibc-3a16dd780eeba60266d75e4a562536cc0785bc4e.tar.xz
glibc-3a16dd780eeba60266d75e4a562536cc0785bc4e.zip
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.
Diffstat (limited to 'sysdeps/powerpc/fpu/s_fma.c')
-rw-r--r--sysdeps/powerpc/fpu/s_fma.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/sysdeps/powerpc/fpu/s_fma.c b/sysdeps/powerpc/fpu/s_fma.c
new file mode 100644
index 0000000000..688f9badf5
--- /dev/null
+++ b/sysdeps/powerpc/fpu/s_fma.c
@@ -0,0 +1,26 @@
+/* Compute x * y + z as ternary operation.  PowerPC version.
+   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
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+#include <libm-alias-double.h>
+
+double __fma (double x, double y, double z)
+{
+  return __builtin_fma (x, y, z);
+}
+libm_alias_double (__fma, fma)