~ubuntu-branches/debian/sid/gcc-4.8/sid

« back to all changes in this revision

Viewing changes to .svn/pristine/58/589ecbf1db8783ff3ed2bd73893d898f0d6e5b17.svn-base

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-12-19 19:48:34 UTC
  • Revision ID: package-import@ubuntu.com-20141219194834-4dz1q7rrn5pad823
Tags: 4.8.4-1
* GCC 4.8.4 release.
  - Fix PR target/61407 (darwin), PR middle-end/58624 (ice),
    PR sanitizer/64265 (wrong code).
* Require recent binutils to pass go test failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# DP: Proposed patch for PR libstdc++/39491.
 
2
 
 
3
2009-04-16  Benjamin Kosnik  <bkoz@redhat.com>
 
4
 
 
5
        * src/math_stubs_long_double.cc (__signbitl): Add for hppa linux only.
 
6
 
 
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)
 
11
@@ -213,4 +221,111 @@
 
12
     return tanh((double) x);
 
13
   }
 
14
 #endif
 
15
+
 
16
+  // From libmath/signbitl.c
 
17
+  // XXX ABI mistakenly exported
 
18
+#if defined (__hppa__) && defined (__linux__)
 
19
+# include <endian.h>
 
20
+# include <float.h>
 
21
+
 
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)));
 
26
+
 
27
+#if BYTE_ORDER == BIG_ENDIAN
 
28
+typedef union
 
29
+{
 
30
+  long double value;
 
31
+  struct
 
32
+  {
 
33
+    unsigned int sign_exponent:16;
 
34
+    unsigned int empty:16;
 
35
+    U_int32_t msw;
 
36
+    U_int32_t lsw;
 
37
+  } parts;
 
38
+} ieee_long_double_shape_type;
 
39
+#endif
 
40
+#if BYTE_ORDER == LITTLE_ENDIAN
 
41
+typedef union
 
42
+{
 
43
+  long double value;
 
44
+  struct
 
45
+  {
 
46
+    U_int32_t lsw;
 
47
+    U_int32_t msw;
 
48
+    unsigned int sign_exponent:16;
 
49
+    unsigned int empty:16;
 
50
+  } parts;
 
51
+} ieee_long_double_shape_type;
 
52
+#endif
 
53
+
 
54
+/* Get int from the exponent of a long double.  */
 
55
+#define GET_LDOUBLE_EXP(exp,d)                                  \
 
56
+do {                                                            \
 
57
+  ieee_long_double_shape_type ge_u;                             \
 
58
+  ge_u.value = (d);                                             \
 
59
+  (exp) = ge_u.parts.sign_exponent;                             \
 
60
+} while (0)
 
61
+
 
62
+#if BYTE_ORDER == BIG_ENDIAN
 
63
+typedef union
 
64
+{
 
65
+  long double value;
 
66
+  struct
 
67
+  {
 
68
+    U_int64_t msw;
 
69
+    U_int64_t lsw;
 
70
+  } parts64;
 
71
+  struct
 
72
+  {
 
73
+    U_int32_t w0, w1, w2, w3;
 
74
+  } parts32;
 
75
+} ieee_quad_double_shape_type;
 
76
+#endif
 
77
+
 
78
+#if BYTE_ORDER == LITTLE_ENDIAN
 
79
+typedef union
 
80
+{
 
81
+  long double value;
 
82
+  struct
 
83
+  {
 
84
+    U_int64_t lsw;
 
85
+    U_int64_t msw;
 
86
+  } parts64;
 
87
+  struct
 
88
+  {
 
89
+    U_int32_t w3, w2, w1, w0;
 
90
+  } parts32;
 
91
+} ieee_quad_double_shape_type;
 
92
+#endif
 
93
+
 
94
+/* Get most significant 64 bit int from a quad long double.  */
 
95
+#define GET_LDOUBLE_MSW64(msw,d)                               \
 
96
+do {                                                           \
 
97
+  ieee_quad_double_shape_type qw_u;                            \
 
98
+  qw_u.value = (d);                                            \
 
99
+  (msw) = qw_u.parts64.msw;                                    \
 
100
+} while (0)
 
101
+
 
102
+int
 
103
+__signbitl (long double x)
 
104
+{
 
105
+#if LDBL_MANT_DIG == 113
 
106
+  Int64_t msw;
 
107
+
 
108
+  GET_LDOUBLE_MSW64 (msw, x);
 
109
+  return msw < 0;
 
110
+#else
 
111
+  Int32_t e;
 
112
+
 
113
+  GET_LDOUBLE_EXP (e, x);
 
114
+  return e & 0x8000;
 
115
+#endif
 
116
+}
 
117
+#endif
 
118
+
 
119
+#ifndef _GLIBCXX_HAVE___SIGNBITL
 
120
+
 
121
+#endif
 
122
 } // extern "C"
 
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
 
125
@@ -635,6 +635,7 @@
 
126
     sqrtf;
 
127
     sqrtl;
 
128
     copysignf;
 
129
+    __signbitl;
 
130
 
 
131
    # GLIBCXX_ABI compatibility only.
 
132
     # std::string