HAVE_LONGLONG is defined, in order to keep the compiler happy.
* src/base/cl_macros.h: include "cln/types.h", since we need HAVE_DD...
* src/base/cl_macros.h (bit): ...for this macro...
* src/base/cl_macros.h (minus_bit): ...and this one.
* src/base/cl_low.h: include "cln/types.h", since we need HAVE_DD...
* src/base/cl_low.h (logcount_64): ...for this macro.
* src/base/random/cl_UL_random.cc (random32): if HAVE_DD a is an ULL.
* src/integer/gcd/cl_I_gcd_aux2.cc (floorDD): fixed algorithmic bug
that turned up when intDsize==32 and cl_word_size==64.
* src/float/dfloat/elem/cl_DF_div.cc (operator/): fixed a missing cast
to uint64 that turned up when intDsize==32 and cl_word_size==64.
+2000-11-01 Richard Kreckel <kreckel@ginac.de>
+
+ * include/cln/object.h (cl_combine): define additional signatures, if
+ HAVE_LONGLONG is defined, in order to keep the compiler happy.
+ * src/base/cl_macros.h: include "cln/types.h", since we need HAVE_DD...
+ * src/base/cl_macros.h (bit): ...for this macro...
+ * src/base/cl_macros.h (minus_bit): ...and this one.
+ * src/base/cl_low.h: include "cln/types.h", since we need HAVE_DD...
+ * src/base/cl_low.h (logcount_64): ...for this macro.
+ * src/base/random/cl_UL_random.cc (random32): if HAVE_DD a is an ULL.
+ * src/integer/gcd/cl_I_gcd_aux2.cc (floorDD): fixed algorithmic bug
+ that turned up when intDsize==32 and cl_word_size==64.
+ * src/float/dfloat/elem/cl_DF_div.cc (operator/): fixed a missing cast
+ to uint64 that turned up when intDsize==32 and cl_word_size==64.
+
2000-10-29 Richard Kreckel <kreckel@ginac.de>
* src/real/input/cl_R_read.cc, src/complex/input/cl_N_read.cc:
#ifndef _CL_LOW_H
#define _CL_LOW_H
+#include "cln/types.h"
+
namespace cln {
// Determines the sign of a 16-bit number.
/* x32 besteht aus 1 16-Bit-Zähler (0,...,32). */\
)
// Bits von x64 zählen: (Input x64, Output x64)
+#if HAVE_DD
+ #define logcount_64() \
+ ( /* x64 besteht aus 64 1-Bit-Zählern (0,1). */\
+ x64 = (x64 & 0x5555555555555555ULL) + ((x64 & 0xAAAAAAAAAAAAAAAAULL) >> 1),\
+ /* x64 besteht aus 32 2-Bit-Zählern (0,1,2). */\
+ x64 = (x64 & 0x3333333333333333ULL) + ((x64 & 0xCCCCCCCCCCCCCCCCULL) >> 2),\
+ /* x64 besteht aus 16 4-Bit-Zählern (0,1,2,3,4). */\
+ x64 = (uint32)(x64 + (x64 >> 32)), \
+ /* x64 besteht aus 8 4-Bit-Zählern (0,...,8). */\
+ x64 = (x64 & 0x0F0F0F0FUL) + ((x64 & 0xF0F0F0F0UL) >> 4), \
+ /* x64 besteht aus 4 8-Bit-Zählern (0,...,16). */\
+ x64 = (x64 & 0x00FF00FFU) + ((x64 & 0xFF00FF00U) >> 8), \
+ /* x64 besteht aus 2 16-Bit-Zählern (0,...,32). */\
+ x64 = (x64 & 0x0000FFFFU) + (x64 >> 16) \
+ /* x64 besteht aus 1 16-Bit-Zähler (0,...,64). */\
+ )
+#else
#define logcount_64() \
( /* x64 besteht aus 64 1-Bit-Zählern (0,1). */\
x64 = (x64 & 0x5555555555555555UL) + ((x64 & 0xAAAAAAAAAAAAAAAAUL) >> 1),\
x64 = (x64 & 0x0000FFFFU) + (x64 >> 16) \
/* x64 besteht aus 1 16-Bit-Zähler (0,...,64). */\
)
+#endif
} // namespace cln
#ifndef _CL_MACROS_H
#define _CL_MACROS_H
+#include "cln/types.h"
+
// Concatenation of macroexpanded tokens.
// Example:
// #undef x
#undef NULL
#define NULL 0
-// Bit number n (0<=n<32)
+// Bit number n (0<=n<32 or 0<=n<64)
+#if HAVE_DD
+ #define bit(n) (1LL<<(n))
+#else
#define bit(n) (1L<<(n))
+#endif
// Bit number n (0<n<=32) mod 2^32
#define bitm(n) (2L<<((n)-1))
// Test bit n in x, n constant, x a cl_uint:
)
#endif
#endif
-// minus bit number n (0<=n<32)
+// minus bit number n (0<=n<32 or 0<=n<64)
+#if HAVE_DD
+ #define minus_bit(n) (-1LL<<(n))
+#else
#define minus_bit(n) (-1L<<(n))
+#endif
// minus bit number n (0<n<=32) mod 2^32
#define minus_bitm(n) (-2L<<((n)-1))
#ifdef HAVE_FAST_LONGLONG
// Multiplikator a=6364136223846793005 = 0x5851F42D4C957F2D :
var uint64 seed = highlow64(randomstate.seed.hi,randomstate.seed.lo);
+#if HAVE_DD
+ var const uint64 a = 0x5851F42D4C957F2DULL;
+#else
var const uint64 a = 0x5851F42D4C957F2DUL;
+#endif
var uint64 newseed;
// multiplizieren, brauche nur letzte 64 Bit:
mulu64(seed,a, , newseed =);
// q = 2^32*manthi+mantlo.
#if (cl_word_size==64)
#if (intDsize<=32)
- mantx = (manthi<<32) | (uint64)mantlo;
+ mantx = ((uint64)manthi<<32) | (uint64)mantlo;
#endif
if (mantx >= bit(DF_mant_len+2))
// Quotient >=2^54 -> 2 Bits wegrunden
if (y_shifted == 0)
q = highD(x) >> shift;
else
- divuD(x,y_shifted, q =, );
+ divuD(highD(x) >> shift, y_shifted, q =, );
}
// May need to increment q at most twice.
{