* configure.in: ...used here.
* include/cln/config.h.in: Put in macros defined by CL_GMP_SET_UINTD...
* include/cln/types.h: ...used here.
* autoconf/acgeneral.m4, autoconf/aclocal.m4: Adhere to FHS.
+2000-11-16 Richard Kreckel <kreckel@ginac.de>
+
+ * autoconf/aclocal.m4 (CL_GMP_SET_UINTD): New macro...
+ * configure.in: ...used here.
+ * include/cln/config.h.in: Put in macros defined by CL_GMP_SET_UINTD...
+ * include/cln/types.h: ...used here.
+ * autoconf/acgeneral.m4, autoconf/aclocal.m4: Adhere to FHS.
+
2000-11-13 Richard Kreckel <kreckel@ginac.de>
* src/base/digitseq/cl_asm.h: Test if (intDsize==32) for MIPS and HPPA,
-2000-06-xx, version 1.1.0
+2000-11-xx, version 1.1.0
=========================
Functional changes
* Adjusted several break-even points to make better use of a faster libgmp and
better match present-day CPUs.
-* Fix compilation errors with gcc-2.96.
+* Fix several errors for architectures with 64-bit wide words.
+ (Others than Alpha.)
+
+* Fix compilation errors with current GCC3.0 snapshots.
2000-01-13, version 1.0.3
dnl Roland McGrath, Noah Friedman, david d zuhn, and many others.
dnl
dnl Changed by Bruno Haible, 18 January 1999
+dnl Changed more by Richard Kreckel, 16 November 2000
dnl
divert(-1)dnl Throw away output until AC_INIT is called.
changequote([, ])
libdir='${exec_prefix}/lib'
includedir='${prefix}/include'
oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
+infodir='${datadir}/info'
+mandir='${datadir}/man'
# Initialize some other variables.
subdirs=
AC_TRY_LINK([#include <gmp.h>],[mpn_divexact_by3(0,0,0)],
cl_cv_new_libgmp="yes", cl_cv_new_libgmp="no"; LIBS=$SAVELIBS)
])])
+
+# What is sizeof(mp_limb_t)? (It has to match sizeof(uintD) later.)
+AC_DEFUN(CL_GMP_SET_UINTD,
+[AC_CACHE_CHECK([how large gmp demands uintD to be], cl_cv_gmp_set_uintd, [
+ AC_TRY_RUN([#include <stdio.h>
+#include <gmp.h>
+int main() {
+ FILE *f=fopen("conftestval", "w");
+ if (!f) return(1);
+ if (sizeof(mp_limb_t) > sizeof(long))
+ fprintf(f, "long long");
+ else if (sizeof(mp_limb_t) == sizeof(long))
+ fprintf(f, "long");
+ else if (sizeof(mp_limb_t) == sizeof(int))
+ fprintf(f, "int");
+ else return(1);
+ return(0);
+}], cl_cv_gmp_set_uintd=`cat conftestval`; \
+ cl_gmp_demands="GMP_DEMANDS_UINTD_`echo ${cl_cv_gmp_set_uintd} | sed -e 'y/ gilnot/_GILNOT/'`";
+ AC_DEFINE_UNQUOTED($cl_gmp_demands),
+ AC_MSG_ERROR([CLN can't handle the result]),dnl
+ AC_MSG_ERROR([cross-compiling - cannot determine]))
+])])
AC_DEFINE_UNQUOTED(CL_VERSION_MAJOR, $CL_VERSION_MAJOR)
AC_DEFINE_UNQUOTED(CL_VERSION_MINOR, $CL_VERSION_MINOR)
AC_DEFINE_UNQUOTED(CL_VERSION_PATCHLEVEL, $CL_VERSION_PATCHLEVEL)
-dnl concateneted release version
+dnl concatenated release version
CL_VERSION=$CL_VERSION_MAJOR.$CL_VERSION_MINOR.$CL_VERSION_PATCHLEVEL
AC_DEFINE_UNQUOTED(CL_VERSION, $CL_VERSION)
AC_SUBST(CL_VERSION)
dnl
CL_CHAR_UNSIGNED
dnl DEFS __CHAR_UNSIGNED__ if char is unsigned
-test -d 'include' || mkdir 'include'
CL_MACHINE([integer types and behaviour],${srcdir}/autoconf/intparam.c,include/cln/intparam.h,cl_cv_file_intparam_h)
dnl builds include/cln/intparam.h
CL_MACHINE([floating-point types and behaviour],${srcdir}/autoconf/floatparam.c,include/cln/floatparam.h,cl_cv_file_floatparam_h)
fi
fi
if test "$with_gmp" = yes; then
+ CL_GMP_SET_UINTD
AC_DEFINE(CL_USE_GMP)
else
AC_MSG_WARN([disabling external GNU MP library])
install : all force
+ if [ ! -d $(datadir) ] ; then mkdir $(datadir) ; fi
if [ ! -d $(infodir) ] ; then mkdir $(infodir) ; fi
$(INSTALL_DATA) $(srcdir)/$(PACKAGE).info $(infodir)/$(PACKAGE).info
- if [ ! -d $(datadir) ] ; then mkdir $(datadir) ; fi
if [ ! -d $(htmldir) ] ; then mkdir $(htmldir) ; fi
$(INSTALL_DATA) $(srcdir)/$(PACKAGE)_*.html $(htmldir)
if [ ! -d $(dvidir) ] ; then mkdir $(dvidir) ; fi
$(INSTALL_DATA) $(srcdir)/$(PACKAGE).dvi $(dvidir)/$(PACKAGE).dvi
installdirs : force
- if [ ! -d $(infodir) ] ; then mkdir $(infodir) ; fi
if [ ! -d $(datadir) ] ; then mkdir $(datadir) ; fi
+ if [ ! -d $(infodir) ] ; then mkdir $(infodir) ; fi
if [ ! -d $(htmldir) ] ; then mkdir $(htmldir) ; fi
if [ ! -d $(dvidir) ] ; then mkdir $(dvidir) ; fi
/* Define if you have <unistd.h>. */
#undef HAVE_UNISTD_H
+/* CL_GMP_SET_UINTD */
+/* Define one of the following so sizeof(uintD) matches sizeof(mp_limb_t). */
+#undef GMP_DEMANDS_UINTD_LONG_LONG
+#undef GMP_DEMANDS_UINTD_LONG
+#undef GMP_DEMANDS_UINTD_INT
+
/* functions and declarations */
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.
- #if (defined(HAVE_FAST_LONGLONG) && (defined(__alpha__) || defined(__ia64__)))
- #define intDsize 64
- #define intDDsize 128 // = 2*intDsize
- #define log2_intDsize 6 // = log2(intDsize)
- #else
- #define intDsize 32
- #define intDDsize 64 // = 2*intDsize
- #define log2_intDsize 5 // = log2(intDsize)
- #endif
- #if (intDsize==8)
- typedef sint8 sintD;
- typedef uint8 uintD;
- #endif
- #if (intDsize==16)
- typedef sint16 sintD;
- typedef uint16 uintD;
- #endif
- #if (intDsize==32)
- typedef sint32 sintD;
- typedef uint32 uintD;
+// intDsize should be 8 or 16 or 32 or 64 and it should match mp_limb_t,
+// if CLN is sitting on top of GMP.
+ #if defined(GMP_DEMANDS_UINTD_LONG_LONG)
+ #define HAVE_FAST_LONGLONG
+ #define intDsize long_long_bitsize
+ typedef long long sintD;
+ typedef unsigned long long uintD;
+ #elif defined(GMP_DEMANDS_UINTD_LONG)
+ #define intDsize long_bitsize
+ typedef long sintD;
+ typedef unsigned long uintD;
+ #elif defined(GMP_DEMANDS_UINTD_INT)
+ #define intDsize int_bitsize
+ 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__)))
+ #define intDsize 64
+ typedef sint64 sintD;
+ typedef uint64 uintD;
+ #else
+ #define intDsize 32
+ typedef sint32 sintD;
+ typedef uint32 uintD;
+ #endif
#endif
#if (intDsize==64)
- typedef sint64 sintD;
- typedef uint64 uintD;
+ #define intDDsize 128 // = 2*intDsize
+ #define log2_intDsize 6 // = log2(intDsize)
+ #elif (intDsize==32)
+ #define intDDsize 64 // = 2*intDsize
+ #define log2_intDsize 5 // = log2(intDsize)
+ #elif (intDsize==16)
+ #define intDDsize 32 // = 2*intDsize
+ #define log2_intDsize 4 // = log2(intDsize)
+ #elif (intDsize==8)
+ #define intDDsize 16 // = 2*intDsize
+ #define log2_intDsize 3 // = log2(intDsize)
+ #else
+ #error "What is intDsize again?"
#endif
// HAVE_DD means that there are unsigned ints with 2*intDsize bits.
#if (intDDsize <= (defined(HAVE_FAST_LONGLONG) ? 64 : 32))
#define HAVE_DD 0
#endif
+// 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
+
#endif /* _CL_TYPES_H */