public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-3172] rs6000: inline ldouble __gcc_qsub
@ 2021-08-26 23:11 David Edelsohn
  0 siblings, 0 replies; only message in thread
From: David Edelsohn @ 2021-08-26 23:11 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:5889e842ae4df48ac471c47d6ed72e05041a1db8

commit r12-3172-g5889e842ae4df48ac471c47d6ed72e05041a1db8
Author: David Edelsohn <dje.gcc@gmail.com>
Date:   Wed Aug 25 17:41:50 2021 -0400

    rs6000: inline ldouble __gcc_qsub
    
    While performing some tests of IEEE 128 float for PPC64LE, Michael
    Meissner noticed that __gcc_qsub is substantially slower than
    __gcc_qadd.  __gcc_qsub calls __gcc_add with the second operand
    negated.  Because the functions normally are invoked through
    libgcc shared object, the extra PLT overhead has a large impact
    on the overall time of the function.  This patch converts
    __gcc_qadd to a static inline function invoked by __gcc_qadd
    and __gcc_qsub.
    
    libgcc/ChangeLog:
    
            * config/rs6000/ibm-ldouble.c (ldouble_qadd_internal): Rename from
            __gcc_qadd.
            (__gcc_qadd): Call ldouble_qadd_internal.
            (__gcc_qsub): Call ldouble_qadd_internal with second long double
            argument negated.

Diff:
---
 libgcc/config/rs6000/ibm-ldouble.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/libgcc/config/rs6000/ibm-ldouble.c b/libgcc/config/rs6000/ibm-ldouble.c
index 4c13453f975..0b385aa940b 100644
--- a/libgcc/config/rs6000/ibm-ldouble.c
+++ b/libgcc/config/rs6000/ibm-ldouble.c
@@ -118,8 +118,8 @@ pack_ldouble (double dh, double dl)
 }
 
 /* Add two 'IBM128_TYPE' values and return the result.	*/
-IBM128_TYPE
-__gcc_qadd (double a, double aa, double c, double cc)
+static inline IBM128_TYPE
+ldouble_qadd_internal (double a, double aa, double c, double cc)
 {
   double xh, xl, z, q, zz;
 
@@ -158,9 +158,15 @@ __gcc_qadd (double a, double aa, double c, double cc)
 }
 
 IBM128_TYPE
-__gcc_qsub (double a, double b, double c, double d)
+__gcc_qadd (double a, double aa, double c, double cc)
+{
+  return ldouble_qadd_internal (a, aa, c, cc);
+}
+
+IBM128_TYPE
+__gcc_qsub (double a, double aa, double c, double cc)
 {
-  return __gcc_qadd (a, b, -c, -d);
+  return ldouble_qadd_internal (a, aa, -c, -cc);
 }
 
 #ifdef __NO_FPRS__


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-26 23:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-26 23:11 [gcc r12-3172] rs6000: inline ldouble __gcc_qsub David Edelsohn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).