I tested this patch. It fixes more.
__mips64 defines for both N32 and N64, so we should use __LP64__ to determine.
Both big- and little- endian define __mips__,so
__mips__ || __mipsel__ is not needed.
On Thu, Sep 25, 2014 at 1:15 AM, Richard B. Kreckel <[email protected]> wrote:
> On 09/24/2014 11:57 AM, YunQiang Su wrote:
>> On Thu, May 22, 2014 at 9:14 AM, Yunqiang Su <[email protected]> wrote:
>>> On Mon, May 19, 2014 at 2:00 PM, Richard B. Kreckel <[email protected]>
>>> wrote:
>>>> On 05/16/2014 10:20 AM, Yunqiang Su wrote:
>>>>> Package: cln
>>>>> Version: 1.3.3-1
>>>>>
>>>>> This patch fix cln build on mips64 and mips64el.
>>>>
>>>> Thanks very much for your patch!
>>>>
>>>> I've just one question: Why switch from __mips64__ to __mips64?
>>>> I remember (a long time back, admittedly), that I had to switch the
>>>> other way, from __mips64 to __mips64__ to make things work.
>>>
>>> Ohhh, both of them work now.
>>> Keep __mips64__ should be OK.
>>
>> Sorry for it.
>>
>> There do be no __mips64__, so we should change it to __mips64.
>
> Can you, please, prepare a patch, test if it works, and send it to me? I
> won't hesitate applying it.
>
> -richard.
> --
> Richard B. Kreckel
> <http://in.terlu.de/~kreckel/>
>
--
YunQiang Su
diff --git a/include/cln/object.h b/include/cln/object.h
index 50517b9..b54b93a 100644
--- a/include/cln/object.h
+++ b/include/cln/object.h
@@ -22,10 +22,10 @@ namespace cln {
#if defined(__m68k__)
#define cl_word_alignment 2
#endif
-#if defined(__i386__) || defined(__mips__) || defined(__mipsel__) ||
(defined(__sparc__) && !defined(__arch64__)) || defined(__hppa__) ||
defined(__arm__) || defined(__rs6000__) || defined(__m88k__) ||
defined(__convex__) || (defined(__s390__) && !defined(__s390x__)) ||
defined(__sh__) || (defined(__x86_64__) && defined(__ILP32__))
+#if defined(__i386__) || (defined(__mips__) && !defined(__LP64__) ) ||
(defined(__sparc__) && !defined(__arch64__)) || defined(__hppa__) ||
defined(__arm__) || defined(__rs6000__) || defined(__m88k__) ||
defined(__convex__) || (defined(__s390__) && !defined(__s390x__)) ||
defined(__sh__) || (defined(__x86_64__) && defined(__ILP32__))
#define cl_word_alignment 4
#endif
-#if defined(__alpha__) || defined(__ia64__) || defined(__mips64__) ||
defined(__powerpc64__) || (defined(__sparc__) && defined(__arch64__)) ||
(defined(__x86_64__) && !defined(__ILP32__)) || defined(__s390x__) ||
defined(__aarch64__)
+#if defined(__alpha__) || defined(__ia64__) || (defined(__mips64) &&
defined(__LP64__))|| defined(__powerpc64__) || (defined(__sparc__) &&
defined(__arch64__)) || (defined(__x86_64__) && !defined(__ILP32__)) ||
defined(__s390x__) || defined(__aarch64__)
#define cl_word_alignment 8
#endif
#if !defined(cl_word_alignment)
diff --git a/include/cln/types.h b/include/cln/types.h
index 30d040e..bc16496 100644
--- a/include/cln/types.h
+++ b/include/cln/types.h
@@ -48,7 +48,7 @@
#undef HAVE_LONGLONG
#endif
#endif
- #if defined(HAVE_LONGLONG) && (defined(__alpha__) || defined(__ia64__) ||
defined(__mips64__) || defined(__powerpc64__) || defined(__s390x__) ||
(defined(__sparc__) && defined(__arch64__)) || defined(__x86_64__)) ||
defined(__aarch64__)
+ #if defined(HAVE_LONGLONG) && (defined(__alpha__) || defined(__ia64__) ||
defined(__mips64) || defined(__powerpc64__) || defined(__s390x__) ||
(defined(__sparc__) && defined(__arch64__)) || defined(__x86_64__)) ||
defined(__aarch64__)
// 64 bit registers in hardware
#define HAVE_FAST_LONGLONG
#endif
@@ -76,7 +76,7 @@
// Integer type used for counters.
// Constraint: sizeof(uintC) >= sizeof(uintL)
- #if (defined(HAVE_FAST_LONGLONG) && (defined(__alpha__) || defined(__ia64__)
|| defined(__powerpc64__) || defined(__s390x__) || (defined(__sparc__) &&
defined(__arch64__)) || defined(__x86_64__) || defined(__aarch64__)))
+ #if (defined(HAVE_FAST_LONGLONG) && (defined(__alpha__) || defined(__ia64__)
|| defined(__powerpc64__) || defined(__s390x__) || (defined(__sparc__) &&
defined(__arch64__)) || defined(__x86_64__) || defined(__aarch64__) ||
(defined(__mips64) && defined(__LP64__))))
#define intCsize long_bitsize
typedef long sintC;
typedef unsigned long uintC;
@@ -127,7 +127,7 @@
typedef int sintD;
typedef unsigned int uintD;
#else // we are not using GMP, so just guess something reasonable
- #if (defined(HAVE_FAST_LONGLONG) && (defined(__alpha__) ||
defined(__ia64__) || defined(__powerpc64__) || (defined(__sparc__) &&
defined(__arch64__)) || defined(__s390x__) || defined(__x86_64__) ||
defined(__aarch64__)))
+ #if (defined(HAVE_FAST_LONGLONG) && (defined(__alpha__) ||
defined(__ia64__) || defined(__powerpc64__) || (defined(__sparc__) &&
defined(__arch64__)) || defined(__s390x__) || defined(__x86_64__) ||
defined(__aarch64__) || (defined(__mips64) && defined(__LP64__))))
#define intDsize 64
typedef sint64 sintD;
typedef uint64 uintD;
diff --git a/src/base/cl_low.h b/src/base/cl_low.h
index c4c25ab..acf84f5 100644
--- a/src/base/cl_low.h
+++ b/src/base/cl_low.h
@@ -826,14 +826,14 @@ inline uint32 mulu32_unchecked (uint32 arg1, uint32 arg2)
q_zuweisung (uint32)__q; \
r_zuweisung (uint32)__r; \
})
-#elif defined(__GNUC__) && (defined(__alpha__) || defined(__ia64__) ||
defined(__mips64__) || defined(__sparc64__))
+#elif defined(__GNUC__) && (defined(__alpha__) || defined(__ia64__) ||
defined(__mips64) || defined(__sparc64__))
// On __alpha__, computing the remainder by multiplication is just two
// instructions, compared to the __remqu (libc) function call for the %
// operator.
// On __ia64__, computing the remainder by multiplication is just four
// instructions, compared to the __umoddi3 (libgcc) function call for the %
// operator.
- // On __mips64__, computing the remainder by multiplication is just two
+ // On __mips64, computing the remainder by multiplication is just two
// instructions, compared to the __umoddi3 (libgcc) function call for the %
// operator.
// On __sparc64__, computing the remainder by multiplication uses a 32-bit
@@ -870,14 +870,14 @@ inline uint32 mulu32_unchecked (uint32 arg1, uint32 arg2)
// < uint64 q: floor(x/y)
// < uint32 r: x mod y
// < x = q*y+r
-#if defined(__GNUC__) && (defined(__alpha__) || defined(__ia64__) ||
defined(__mips64__) || defined(__sparc64__))
+#if defined(__GNUC__) && (defined(__alpha__) || defined(__ia64__) ||
defined(__mips64) || defined(__sparc64__))
// On __alpha__, computing the remainder by multiplication is just two
// instructions, compared to the __remqu (libc) function call for the %
// operator.
// On __ia64__, computing the remainder by multiplication is just four
// instructions, compared to the __umoddi3 (libgcc) function call for the %
// operator.
- // On __mips64__, computing the remainder by multiplication is just two
+ // On __mips64, computing the remainder by multiplication is just two
// instructions, compared to the __umoddi3 (libgcc) function call for the %
// operator.
// On __sparc64__, computing the remainder by multiplication uses a 32-bit
@@ -942,14 +942,14 @@ inline uint32 mulu32_unchecked (uint32 arg1, uint32 arg2)
// < uint64 q: floor(x/y)
// < uint64 r: x mod y
// < x = q*y+r
-#if defined(__GNUC__) && (defined(__alpha__) || defined(__ia64__) ||
defined(__mips64__) || defined(__sparc64__))
+#if defined(__GNUC__) && (defined(__alpha__) || defined(__ia64__) ||
defined(__mips64) || defined(__sparc64__))
// On __alpha__, computing the remainder by multiplication is just two
// instructions, compared to the __remqu (libc) function call for the %
// operator.
// On __ia64__, computing the remainder by multiplication is just four
// instructions, compared to the __umoddi3 (libgcc) function call for the %
// operator.
- // On __mips64__, computing the remainder by multiplication is just two
+ // On __mips64, computing the remainder by multiplication is just two
// instructions, compared to the __umoddi3 (libgcc) function call for the %
// operator.
// On __sparc64__, it doesn't matter.
diff --git a/src/base/digitseq/cl_asm.h b/src/base/digitseq/cl_asm.h
index 01ab9c5..1998d4d 100644
--- a/src/base/digitseq/cl_asm.h
+++ b/src/base/digitseq/cl_asm.h
@@ -21,7 +21,7 @@
#include "cl_asm_i386.h"
#endif
-#if (defined(__mips__) || defined(__mipsel__)) && !defined(__mips64__) &&
(intDsize==32)
+#if defined(__mips__) && !defined(__mips64) && (intDsize==32)
#include "cl_asm_mips.h"
#endif