+2000-06-22 Bruno Haible <haible@clisp.cons.org>
+
+ * include/cl_object.h: Rename cl_word_size to cl_pointer_size.
+ * include/cl_types.h (HAVE_FAST_LONGLONG): Also define on Irix6
+ with N32 ABI.
+ (cl_word_size): New macro.
+ * src/float/sfloat/cl_SF.h: Use cl_pointer_size instead of
+ cl_word_size.
+
2000-06-05 Richard Kreckel <kreckel@ginac.de>
* doc/*, INSTALL: Mention that both shared and static library are
// Immediate data is a word, as wide as a pointer.
typedef sintP cl_sint;
typedef uintP cl_uint; // This ought to be called `cl_word'.
-#define cl_word_size intPsize
-// NB: (cl_word_size==64) implies defined(HAVE_FAST_LONGLONG)
-#if (cl_word_size==64)
+#define cl_pointer_size intPsize
+// NB: (cl_pointer_size==64) implies defined(HAVE_FAST_LONGLONG)
+#if (cl_pointer_size==64)
#define CL_WIDE_POINTERS
#endif
#define cl_tag_len 3
#endif
#define cl_tag_shift 0
-#if (cl_word_size == 64)
+#if (cl_pointer_size == 64)
#define cl_value_shift 32
#else
#define cl_value_shift (cl_tag_len+cl_tag_shift)
#endif
-#define cl_value_len (cl_word_size - cl_value_shift)
+#define cl_value_len (cl_pointer_size - cl_value_shift)
#define cl_tag_mask (((1UL << cl_tag_len) - 1) << cl_tag_shift)
#define cl_value_mask (((1UL << cl_value_len) - 1) << cl_value_shift)
// Return the value (unsigned) of a word.
inline cl_uint cl_value (cl_uint word)
{
- // This assumes cl_value_shift + cl_value_len == cl_word_size.
+ // This assumes cl_value_shift + cl_value_len == cl_pointer_size.
return word >> cl_value_shift;
}
}
inline cl_uint cl_combine (cl_uint tag, cl_sint value)
{
- // This assumes cl_value_shift + cl_value_len == cl_word_size.
+ // This assumes cl_value_shift + cl_value_len == cl_pointer_size.
return (value << cl_value_shift) + (tag << cl_tag_shift);
}
// Keep the compiler happy.
#undef HAVE_LONGLONG
#endif
#endif
- #if defined(HAVE_LONGLONG) && (defined(__alpha__) || defined(__mips64__) || defined(__sparc64__))
+ #if defined(HAVE_LONGLONG) && (defined(__alpha__) || defined(__mips64__) || (defined(__mips__) && defined(_ABIN32)) || defined(__sparc64__))
// 64 bit registers in hardware
#define HAVE_FAST_LONGLONG
#endif
typedef long sintP;
typedef unsigned long uintP;
+// Largest integer type which can be manipulated as efficiently as a pointer.
+// This is normally the same as the hardware register size.
+// Assumption: cl_word_size >= intPsize
+ #ifdef HAVE_FAST_LONGLONG
+ #define cl_word_size 64
+ #else
+ #define cl_word_size 32
+ #endif
+
// Numbers in the heap are stored as "digit" sequences.
// A digit is an unsigned int with intDsize bits.
// intDsize should be 8 or 16 or 32 or 64.
#define SF_exp_high (bit(SF_exp_len)-1) // maximum exponent
#define SF_exp_shift (SF_mant_len+SF_mant_shift) // lowest exponent bit
#define SF_mant_shift SF_value_shift // lowest mantissa bit
- #define SF_sign_shift (cl_word_size - 1)
+ #define SF_sign_shift (cl_pointer_size - 1)
// Builds a float from the immediate word.
inline cl_SF::cl_SF (struct cl_sfloat * null, cl_uint w)
}
inline cl_signean SF_sign (const cl_SF& x)
{
- return ((cl_sint)x.word << (cl_word_size-1 - SF_sign_shift)) >> (cl_word_size-1);
+ return ((cl_sint)x.word << (cl_pointer_size-1 - SF_sign_shift)) >> (cl_pointer_size-1);
}
inline uintL SF_mant (const cl_SF& x)
{
inline cl_boolean minusp (const cl_I& x)
{
if (fixnump(x))
- // This assumes cl_value_shift + cl_value_len == cl_word_size.
+ // This assumes cl_value_shift + cl_value_len == cl_pointer_size.
return (cl_boolean)((cl_sint) x.word < 0);
else
return (cl_boolean)((sintD)mspref(arrayMSDptr(TheBignum(x)->data,TheBignum(x)->length),0) < 0);
// < ergebnis: der Wert des Fixnum als 32-Bit-Zahl.
inline uint32 FN_to_UL (const cl_I& x)
{
- // This assumes cl_value_shift + cl_value_len == cl_word_size.
+ // This assumes cl_value_shift + cl_value_len == cl_pointer_size.
return (cl_uint)(x.word) >> cl_value_shift;
}
// < ergebnis: der Wert des Fixnum als 32-Bit-Zahl.
inline sint32 FN_to_L (const cl_I& x)
{
- // This assumes cl_value_shift + cl_value_len == cl_word_size.
+ // This assumes cl_value_shift + cl_value_len == cl_pointer_size.
return (cl_sint)(x.word) >> cl_value_shift;
}
// < ergebnis: der Wert des Fixnum als 64-Bit-Zahl.
inline sint64 FN_to_Q (const cl_I& x)
{
- // This assumes cl_value_shift + cl_value_len == cl_word_size.
+ // This assumes cl_value_shift + cl_value_len == cl_pointer_size.
return (cl_sint)(x.word) >> cl_value_shift;
}
inline sintD FN_MSD (cl_uint word)
{
- // This assumes cl_value_shift + cl_value_len == cl_word_size.
+ // This assumes cl_value_shift + cl_value_len == cl_pointer_size.
return (cl_sint)word >> (cl_value_shift + (FN_maxlength-1)*intDsize);
}
inline cl_boolean minusp (const cl_FN& x)
{
- // This assumes cl_value_shift + cl_value_len == cl_word_size.
+ // This assumes cl_value_shift + cl_value_len == cl_pointer_size.
return (cl_boolean)((cl_sint) x.word < 0);
}
// x Fixnum
if (fixnump(y))
// x Fixnum, y Fixnum
- { // This assumes cl_value_shift + cl_value_len == cl_word_size.
+ { // This assumes cl_value_shift + cl_value_len == cl_pointer_size.
if ((cl_sint)x.word == (cl_sint)y.word) return signean_null;
else if ((cl_sint)x.word > (cl_sint)y.word) return signean_plus;
else return signean_minus;
// x Fixnum
if (fixnump(y))
// x Fixnum, y Fixnum
- { // This assumes cl_value_shift + cl_value_len == cl_word_size.
+ { // This assumes cl_value_shift + cl_value_len == cl_pointer_size.
return (cl_boolean) ((cl_sint)x.word == (cl_sint)y.word);
}
else
{ // x ist Fixnum
if (x.word != cl_combine(cl_FN_tag,bit(cl_value_len-1)))
// bleibt Fixnum: direkt 1 subtrahieren
- // This assumes cl_value_shift + cl_value_len == cl_word_size.
+ // This assumes cl_value_shift + cl_value_len == cl_pointer_size.
{ return cl_I_from_word(x.word - cl_combine(0,1)); }
}
// die sichere Methode
{ // x ist Fixnum
if (x.word != cl_combine(cl_FN_tag,bit(cl_value_len-1)-1))
// bleibt Fixnum: direkt 1 addieren
- // This assumes cl_value_shift + cl_value_len == cl_word_size.
+ // This assumes cl_value_shift + cl_value_len == cl_pointer_size.
{ return cl_I_from_word(x.word + cl_combine(0,1)); }
}
// die sichere Methode