]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
powerpc: fma using builtins
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 20 Mar 2019 04:14:28 +0000 (04:14 +0000)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 17 Apr 2019 18:14:53 +0000 (15:14 -0300)
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.

ChangeLog
sysdeps/powerpc/fpu/s_fma.c [moved from sysdeps/powerpc/fpu/s_fma.S with 82% similarity]
sysdeps/powerpc/fpu/s_fmaf.c [moved from sysdeps/powerpc/fpu/s_fmaf.S with 82% similarity]

index a4eb322b1d7d991bc3dc914a09c66ae7af3ae1e8..8a852d903d0a89b56eb879ff27fcda93e75b0b82 100644 (file)
--- 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.
 
similarity index 82%
rename from sysdeps/powerpc/fpu/s_fma.S
rename to sysdeps/powerpc/fpu/s_fma.c
index 92e08eb5835cad5f531445e2a17ad8c6d076692e..688f9badf51da488d9022573bf15134149339baa 100644 (file)
@@ -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
 #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)
similarity index 82%
rename from sysdeps/powerpc/fpu/s_fmaf.S
rename to sysdeps/powerpc/fpu/s_fmaf.c
index 9579e9492eff9ae1101da1348c620f77916550fd..38b59e1f2f674aed48d49fcc4d4e014e70fb971c 100644 (file)
@@ -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
 #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)