aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>2005-02-15 23:16:49 +0000
committerdje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>2005-02-15 23:16:49 +0000
commita606f1d66ed166d39f547f06331f7e027abfc504 (patch)
treea2b39d283a20de2dc6811714be5e809b36682898
parent3984decc064af54faa30b1964ad1617090f32129 (diff)
PR target/19019
* config/rs6000/darwin-ldouble.c (_xlqadd): Rename to __gcc_qadd. (_xlqsub): Rename to __gcc_qsub. (_xlqmul): Rename to __gcc_qmul. (_xlqdiv): Rename to __gcc_qdiv. Provide versioned symbol aliases with old names. * config/rs6000/libgcc-ppc64.ver: Rename symbols. * config/rs6000/rs6000.c (rs6000_init_libfuncs): Rename symbols. * config/rs6000/t-aix43 (LIB2FUNCS_EXTRA): New. * config/rs6000/t-aix52 (LIB2FUNCS_EXTRA): New. * config/rs6000/t-newas (LIB2FUNCS_EXTRA): New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95079 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog14
-rw-r--r--gcc/config/rs6000/darwin-ldouble.c51
-rw-r--r--gcc/config/rs6000/libgcc-ppc64.ver10
-rw-r--r--gcc/config/rs6000/rs6000.c8
-rw-r--r--gcc/config/rs6000/t-aix433
-rw-r--r--gcc/config/rs6000/t-aix523
-rw-r--r--gcc/config/rs6000/t-newas3
7 files changed, 66 insertions, 26 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a3b955e363e..f8eb873beaf 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,17 @@
+2005-02-15 David Edelsohn <edelsohn@gnu.org>
+
+ PR target/19019
+ * config/rs6000/darwin-ldouble.c (_xlqadd): Rename to __gcc_qadd.
+ (_xlqsub): Rename to __gcc_qsub.
+ (_xlqmul): Rename to __gcc_qmul.
+ (_xlqdiv): Rename to __gcc_qdiv.
+ Provide versioned symbol aliases with old names.
+ * config/rs6000/libgcc-ppc64.ver: Rename symbols.
+ * config/rs6000/rs6000.c (rs6000_init_libfuncs): Rename symbols.
+ * config/rs6000/t-aix43 (LIB2FUNCS_EXTRA): New.
+ * config/rs6000/t-aix52 (LIB2FUNCS_EXTRA): New.
+ * config/rs6000/t-newas (LIB2FUNCS_EXTRA): New.
+
2005-02-15 James A. Morrison <phython@gcc.gnu.org>
* fold-const.c (fold): Fold -(~A) to A + 1. Fold ~(-A) to A - 1.
diff --git a/gcc/config/rs6000/darwin-ldouble.c b/gcc/config/rs6000/darwin-ldouble.c
index 91c00281585..86893c961cd 100644
--- a/gcc/config/rs6000/darwin-ldouble.c
+++ b/gcc/config/rs6000/darwin-ldouble.c
@@ -1,5 +1,5 @@
/* 128-bit long double support routines for Darwin.
- Copyright (C) 1993, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1993, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
@@ -30,12 +30,12 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* Implementations of floating-point long double basic arithmetic
functions called by the IBM C compiler when generating code for
PowerPC platforms. In particular, the following functions are
- implemented: _xlqadd, _xlqsub, _xlqmul, and _xlqdiv. Double-double
- algorithms are based on the paper "Doubled-Precision IEEE Standard
- 754 Floating-Point Arithmetic" by W. Kahan, February 26, 1987. An
- alternative published reference is "Software for Doubled-Precision
- Floating-Point Computations", by Seppo Linnainmaa, ACM TOMS vol 7
- no 3, September 1981, pages 272-283. */
+ implemented: __gcc_qadd, __gcc_qsub, __gcc_qmul, and __gcc_qdiv.
+ Double-double algorithms are based on the paper "Doubled-Precision
+ IEEE Standard 754 Floating-Point Arithmetic" by W. Kahan, February 26,
+ 1987. An alternative published reference is "Software for
+ Doubled-Precision Floating-Point Computations", by Seppo Linnainmaa,
+ ACM TOMS vol 7 no 3, September 1981, pages 272-283. */
/* Each long double is made up of two IEEE doubles. The value of the
long double is the sum of the values of the two parts. The most
@@ -48,7 +48,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
This code currently assumes big-endian. */
-#if !_SOFT_FLOAT && (defined (__MACH__) || defined (__powerpc64__))
+#if !_SOFT_FLOAT && (defined (__MACH__) || defined (__powerpc64__) || defined (_AIX))
#define fabs(x) __builtin_fabs(x)
#define isless(x, y) __builtin_isless (x, y)
@@ -62,10 +62,27 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
but GCC currently generates poor code when a union is used to turn
a long double into a pair of doubles. */
-extern long double _xlqadd (double, double, double, double);
-extern long double _xlqsub (double, double, double, double);
-extern long double _xlqmul (double, double, double, double);
-extern long double _xlqdiv (double, double, double, double);
+extern long double __gcc_qadd (double, double, double, double);
+extern long double __gcc_qsub (double, double, double, double);
+extern long double __gcc_qmul (double, double, double, double);
+extern long double __gcc_qdiv (double, double, double, double);
+
+#ifdef __ELF__
+/* Provide definitions of the old symbol names to statisfy apps and
+ shared libs built against an older libgcc. To access the _xlq
+ symbols an explicit version reference is needed, so these won't
+ satisfy an unadorned reference like _xlqadd. If dot symbols are
+ not needed, the assembler will remove the aliases from the symbol
+ table. */
+__asm__ (".symver __gcc_qadd,_xlqadd@GCC_3.4\n\t"
+ ".symver __gcc_qsub,_xlqsub@GCC_3.4\n\t"
+ ".symver __gcc_qmul,_xlqmul@GCC_3.4\n\t"
+ ".symver __gcc_qdiv,_xlqdiv@GCC_3.4\n\t"
+ ".symver .__gcc_qadd,._xlqadd@GCC_3.4\n\t"
+ ".symver .__gcc_qsub,._xlqsub@GCC_3.4\n\t"
+ ".symver .__gcc_qmul,._xlqmul@GCC_3.4\n\t"
+ ".symver .__gcc_qdiv,._xlqdiv@GCC_3.4");
+#endif
typedef union
{
@@ -75,7 +92,7 @@ typedef union
/* Add two 'long double' values and return the result. */
long double
-_xlqadd (double a, double aa, double c, double cc)
+__gcc_qadd (double a, double aa, double c, double cc)
{
longDblUnion x;
double z, q, zz, xh;
@@ -110,13 +127,13 @@ _xlqadd (double a, double aa, double c, double cc)
}
long double
-_xlqsub (double a, double b, double c, double d)
+__gcc_qsub (double a, double b, double c, double d)
{
- return _xlqadd (a, b, -c, -d);
+ return __gcc_qadd (a, b, -c, -d);
}
long double
-_xlqmul (double a, double b, double c, double d)
+__gcc_qmul (double a, double b, double c, double d)
{
longDblUnion z;
double t, tau, u, v, w;
@@ -145,7 +162,7 @@ _xlqmul (double a, double b, double c, double d)
}
long double
-_xlqdiv (double a, double b, double c, double d)
+__gcc_qdiv (double a, double b, double c, double d)
{
longDblUnion z;
double s, sigma, t, tau, u, v, w;
diff --git a/gcc/config/rs6000/libgcc-ppc64.ver b/gcc/config/rs6000/libgcc-ppc64.ver
index 116d5e73fa0..b27b4b49249 100644
--- a/gcc/config/rs6000/libgcc-ppc64.ver
+++ b/gcc/config/rs6000/libgcc-ppc64.ver
@@ -1,7 +1,7 @@
-GCC_3.4 {
+GCC_3.4.4 {
# long double support
- _xlqadd
- _xlqsub
- _xlqmul
- _xlqdiv
+ __gcc_qadd
+ __gcc_qsub
+ __gcc_qmul
+ __gcc_qdiv
}
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 4d327fd71b1..267a16131d1 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -8871,10 +8871,10 @@ rs6000_init_libfuncs (void)
}
/* Standard AIX/Darwin/64-bit SVR4 quad floating point routines. */
- set_optab_libfunc (add_optab, TFmode, "_xlqadd");
- set_optab_libfunc (sub_optab, TFmode, "_xlqsub");
- set_optab_libfunc (smul_optab, TFmode, "_xlqmul");
- set_optab_libfunc (sdiv_optab, TFmode, "_xlqdiv");
+ set_optab_libfunc (add_optab, TFmode, "__gcc_qadd");
+ set_optab_libfunc (sub_optab, TFmode, "__gcc_qsub");
+ set_optab_libfunc (smul_optab, TFmode, "__gcc_qmul");
+ set_optab_libfunc (sdiv_optab, TFmode, "__gcc_qdiv");
}
else
{
diff --git a/gcc/config/rs6000/t-aix43 b/gcc/config/rs6000/t-aix43
index ba6ead8113a..4c03269bc83 100644
--- a/gcc/config/rs6000/t-aix43
+++ b/gcc/config/rs6000/t-aix43
@@ -61,6 +61,9 @@ SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver
SHLIB_NM_FLAGS = -Bpg -X32_64
+# GCC 128-bit long double support routines.
+LIB2FUNCS_EXTRA = $(srcdir)/config/rs6000/darwin-ldouble.c
+
# Either 32-bit and 64-bit objects in archives.
AR_FLAGS_FOR_TARGET = -X32_64
diff --git a/gcc/config/rs6000/t-aix52 b/gcc/config/rs6000/t-aix52
index b3017c38ac3..10e26401475 100644
--- a/gcc/config/rs6000/t-aix52
+++ b/gcc/config/rs6000/t-aix52
@@ -42,6 +42,9 @@ SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver
SHLIB_NM_FLAGS = -Bpg -X32_64
+# GCC 128-bit long double support routines.
+LIB2FUNCS_EXTRA = $(srcdir)/config/rs6000/darwin-ldouble.c
+
# Either 32-bit and 64-bit objects in archives.
AR_FLAGS_FOR_TARGET = -X32_64
diff --git a/gcc/config/rs6000/t-newas b/gcc/config/rs6000/t-newas
index a26ce39402c..d5d03a1c66f 100644
--- a/gcc/config/rs6000/t-newas
+++ b/gcc/config/rs6000/t-newas
@@ -27,6 +27,9 @@ MULTILIB_MATCHES = $(MULTILIB_MATCHES_FLOAT) \
mcpu?powerpc=mpowerpc-gpopt \
mcpu?powerpc=mpowerpc-gfxopt
+# GCC 128-bit long double support routines.
+LIB2FUNCS_EXTRA = $(srcdir)/config/rs6000/darwin-ldouble.c
+
# Aix 3.2.x needs milli.exp for -mcpu=common
EXTRA_PARTS = milli.exp
milli.exp: $(srcdir)/config/rs6000/milli.exp