1
From f7d8435e8a3923eb783a404a9db6187ee8ce40ff Mon Sep 17 00:00:00 2001
2
From: asac <asac@hector.personalfree.com>
3
Date: Wed, 21 Feb 2007 03:34:16 +0100
4
Subject: [PATCH] bz289394-align-double-on-ia64-deb-bug-303518
6
+ align double on ia64 ... deb bug 303518
8
extensions/transformiix/source/base/Double.cpp | 35 ++++++++++++-------------
9
1 file changed, 17 insertions(+), 18 deletions(-)
11
Index: mozilla/extensions/transformiix/source/base/Double.cpp
12
===================================================================
13
--- mozilla.orig/extensions/transformiix/source/base/Double.cpp 2006-06-22 21:13:00.000000000 +0200
14
+++ mozilla/extensions/transformiix/source/base/Double.cpp 2007-04-04 18:49:14.000000000 +0200
16
* differently: the 32 bit words are in little endian byte order, the two words
17
* are stored in big endian`s way.
20
#if defined(__arm) || defined(__arm32__) || defined(_arm26__) || defined(__arm__)
24
-#if (__GNUC__ == 2 && __GNUC_MINOR__ > 95) || __GNUC__ > 2
26
- * This version of the macros is safe for the alias optimizations
27
- * that gcc does, but uses gcc-specific extensions.
30
typedef union txdpun {
33
#if defined(IS_LITTLE_ENDIAN) && !defined(CPU_IS_ARM)
42
+#if (__GNUC__ == 2 && __GNUC_MINOR__ > 95) || __GNUC__ > 2
44
+ * This version of the macros is safe for the alias optimizations
45
+ * that gcc does, but uses gcc-specific extensions.
47
#define TX_DOUBLE_HI32(x) (__extension__ ({ txdpun u; u.d = (x); u.s.hi; }))
48
#define TX_DOUBLE_LO32(x) (__extension__ ({ txdpun u; u.d = (x); u.s.lo; }))
52
/* We don't know of any non-gcc compilers that perform alias optimization,
53
* so this code should work.
58
#define TX_DOUBLE_HI32_SIGNBIT 0x80000000
59
#define TX_DOUBLE_HI32_EXPMASK 0x7ff00000
60
#define TX_DOUBLE_HI32_MANTMASK 0x000fffff
62
//-- Initialize Double related constants
64
-const PRUint32 nanMask[2] = {TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_MANTMASK,
66
-const PRUint32 infMask[2] = {TX_DOUBLE_HI32_EXPMASK, 0};
67
-const PRUint32 negInfMask[2] = {TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_SIGNBIT, 0};
68
+const txdpun nanMask = {TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_MANTMASK,
70
+const txdpun infMask = {TX_DOUBLE_HI32_EXPMASK, 0};
71
+const txdpun negInfMask = {TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_SIGNBIT, 0};
73
-const PRUint32 nanMask[2] = {0xffffffff,
74
- TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_MANTMASK};
75
-const PRUint32 infMask[2] = {0, TX_DOUBLE_HI32_EXPMASK};
76
-const PRUint32 negInfMask[2] = {0, TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_SIGNBIT};
77
+const txdpun nanMask = {0xffffffff,
78
+ TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_MANTMASK};
79
+const txdpun infMask = {0, TX_DOUBLE_HI32_EXPMASK};
80
+const txdpun negInfMask = {0, TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_SIGNBIT};
83
-const double Double::NaN = *((double*)nanMask);
84
-const double Double::POSITIVE_INFINITY = *((double*)infMask);
85
-const double Double::NEGATIVE_INFINITY = *((double*)negInfMask);
86
+const double Double::NaN = nanMask.d;
87
+const double Double::POSITIVE_INFINITY = infMask.d;
88
+const double Double::NEGATIVE_INFINITY = negInfMask.d;
91
* Determines whether the given double represents positive or negative
94
MBool Double::isInfinite(double aDbl)
96
return ((TX_DOUBLE_HI32(aDbl) & ~TX_DOUBLE_HI32_SIGNBIT) == TX_DOUBLE_HI32_EXPMASK &&