1
# DP: Proposed patch for PR libstdc++/39491.
3
2009-04-16 Benjamin Kosnik <bkoz@redhat.com>
5
* src/math_stubs_long_double.cc (__signbitl): Add for hppa linux only.
7
Index: a/src/libstdc++-v3/src/math_stubs_long_double.cc
8
===================================================================
9
--- a/src/libstdc++-v3/src/math_stubs_long_double.cc (revision 146216)
10
+++ b/src/libstdc++-v3/src/math_stubs_long_double.cc (working copy)
12
return tanh((double) x);
16
+ // From libmath/signbitl.c
17
+ // XXX ABI mistakenly exported
18
+#if defined (__hppa__) && defined (__linux__)
22
+typedef unsigned int U_int32_t __attribute ((mode (SI)));
23
+typedef int Int32_t __attribute ((mode (SI)));
24
+typedef unsigned int U_int64_t __attribute ((mode (DI)));
25
+typedef int Int64_t __attribute ((mode (DI)));
27
+#if BYTE_ORDER == BIG_ENDIAN
33
+ unsigned int sign_exponent:16;
34
+ unsigned int empty:16;
38
+} ieee_long_double_shape_type;
40
+#if BYTE_ORDER == LITTLE_ENDIAN
48
+ unsigned int sign_exponent:16;
49
+ unsigned int empty:16;
51
+} ieee_long_double_shape_type;
54
+/* Get int from the exponent of a long double. */
55
+#define GET_LDOUBLE_EXP(exp,d) \
57
+ ieee_long_double_shape_type ge_u; \
59
+ (exp) = ge_u.parts.sign_exponent; \
62
+#if BYTE_ORDER == BIG_ENDIAN
73
+ U_int32_t w0, w1, w2, w3;
75
+} ieee_quad_double_shape_type;
78
+#if BYTE_ORDER == LITTLE_ENDIAN
89
+ U_int32_t w3, w2, w1, w0;
91
+} ieee_quad_double_shape_type;
94
+/* Get most significant 64 bit int from a quad long double. */
95
+#define GET_LDOUBLE_MSW64(msw,d) \
97
+ ieee_quad_double_shape_type qw_u; \
99
+ (msw) = qw_u.parts64.msw; \
103
+__signbitl (long double x)
105
+#if LDBL_MANT_DIG == 113
108
+ GET_LDOUBLE_MSW64 (msw, x);
113
+ GET_LDOUBLE_EXP (e, x);
119
+#ifndef _GLIBCXX_HAVE___SIGNBITL
123
--- a/src/libstdc++-v3/config/abi/pre/gnu.ver~ 2009-04-10 01:23:07.000000000 +0200
124
+++ b/src/libstdc++-v3/config/abi/pre/gnu.ver 2009-04-21 16:24:24.000000000 +0200
131
# GLIBCXX_ABI compatibility only.