Richard Kreckel
94dc10d4d9
Remove workarounds for obsolete compilers.
10 years ago
Richard Kreckel
512af84798
Fix support for Mips*.
Patch by YunQiang Su <wzssyqa@gmail.com> (cf. Debian bug#748325).
10 years ago
Richard Kreckel
f5926253a1
Use 8-byte word alignment on arm64.
The previous patch cb76b5eb
used 4-byte word alignment.
Thanks to Peter Green and Hector Oron for pointing out that
8-byte alignment should be used (cf. Debian bug #757623 ).
10 years ago
Marcin Juszkiewicz
cb76b5ebc6
Add AArch64 support.
While building Fedora 21 for AArch64 we found out that your software is
not building for us. Attached is a fix which adds this architecture in
all required places.
11 years ago
Daniel Schepler
7c34799dc2
Support x32 ABI.
Fix autoconf test checking whether mp_limb_t needs to be long long,
which is needed on x32.
12 years ago
Richard Kreckel
b86458e11f
Detect s390x and sparc64 as 32-bit architectures.
CLN fails to build on s390x and sparc64 as it detects them as 32-bit
architectures, due to __s390__ and __sparc__ matching respectively both
s390 and s390x, and both sparc and sparc64. The patch below fixes the
issue. (Reported as Debian bug#639494.)
Thanks to Aurelien Jarno <aurel32@debian.org>.
13 years ago
Richard Kreckel
8aeac846c1
Add support for Renesas SH CPU (sh4).
This defines cl_word_alignment for sh4.
Thanks to Nobuhiro Iwamatsu <iwamatsu@nigauri.org>.
15 years ago
Richard Kreckel
b62e4af28f
* include/cln/object.h: Don't redefine cl_word_alignment on sparc64.
* src/base/digitseq/cl_asm_sparc64_.cc: Declare use of global
register %g2 as scratch register within this file.
Reported by Paul Irofti <bulibuta@gmail.com> and Sven Verdoolaege
<skimo@kotnet.org>.
17 years ago
Richard Kreckel
5370ad8054
* */*: Remove cl_boolean, cl_true, and cl_false in favor of built-in
C++ bool, true, and false.
18 years ago
Richard Kreckel
c486b78a1a
Remove exception hooks in favor of real C++ exceptions:
* include/cln/exception.h: New file...
* include/cln/cln.h: ...included here...
* include/cln/rational.h: ...and here.
* include/cln/abort.h: Removed.
* include/cln/integer.h (ash_exception, exquo_exception): Add exception
types.
* include/cln/float.h (floating_point_exception,
floating_point_nan_exception, floating_point_overflow_exception,
floating_point_underflow_exception): Likewise.
* include/cln/number_io.h (read_number_exception,
read_number_bad_syntax_exception, read_number_junk_exception,
read_number_eof_exception): Likewise.
* include/cln/object.h (CL_DEFINE_CONVERTER): Replace dynamic assertion
with a compile-time assertion.
* include/cln/GV.h: Replace nonreturning functions with exceptions.
* include/cln/modinteger.h: Likewise.
* include/cln/SV.h: Likewise.
* include/cln/ring.h: Likewise.
* include/cln/string.h: Likewise.
* include/cln/univpoly.h: Likewise.
* src/base/cl_abort.cc: Removed.
* src/base/cl_N_err_d0.cc: Removed.
* src/base/cl_d0_exception.cc: New file.
* src/base/cl_as_err.cc: Removed.
* src/base/cl_as_exception.cc: New file.
* src/base/cl_notreached.cc: Removed.
* src/base/cl_notreached_exception.cc: New file.
* src/base/input/cl_read_err_bad.cc: Removed.
* src/base/input/cl_read_bad_syntax_exception.cc: New file.
* src/base/input/cl_read_err_junk.cc: Removed.
* src/base/input/cl_read_junk_exception.cc: New file.
* src/base/input/cl_read_err_eof.cc: Removed.
* src/base/input/cl_read_eof_exception.cc: New file.
* src/base/cl_N.h (cl_as_error): Removed (see cln/exception.h).
* src/base/macros.h (NOTREACHED): Throw.
* src/base/cl_malloc.cc (xmalloc): Throw.
* src/base/digitseq/cl_2DS_div.cc: Throw.
* src/base/digitseq/cl_DS_div.cc: Throw.
* src/base/digitseq/cl_DS_mul.cc: Throw.
* src/base/digitseq/cl_DS_mul_fftc.h: Throw.
* src/base/digitseq/cl_DS_mul_fftcs.h: Throw.
* src/base/digitseq/cl_DS_mul_fftm.h: Throw.
* src/base/digitseq/cl_DS_mul_fftp.h: Throw.
* src/base/digitseq/cl_DS_mul_fftp3.h: Throw.
* src/base/digitseq/cl_DS_mul_fftp3m.h: Throw.
* src/base/digitseq/cl_DS_mul_fftr.h: Throw.
* src/base/digitseq/cl_DS_mul_nuss.h: Throw.
* src/base/digitseq/cl_DS_recipsqrt.cc: Throw.
* src/base/digitseq/cl_DS_sqrt.cc: Throw.
* src/base/hash/cl_hash.h: Throw.
* src/base/hash/cl_hash1.h: Throw.
* src/base/hash/cl_hash1weak.h: Throw.
* src/base/hash/cl_hash2.h: Throw.
* src/base/hash/cl_hash2weak.h: Throw.
* src/base/hash/cl_hashset.h: Throw.
* src/base/hash/cl_hashuniq.h: Throw.
* src/base/hash/cl_hashuniqweak.h: Throw.
* src/base/proplist/cl_pl_add.cc: Throw.
* src/base/ring/cl_no_ring.cc: Throw.
* src/base/string/cl_spushstring.h: Throw.
* src/base/symbol/cl_symbol.cc: Throw.
* src/integer/bitwise/cl_I_ash.h: Removed (see cln/integer.h.)
* src/integer/bitwise/cl_I_asherr.cc: Removed.
* src/integer/bitwise/cl_I_ash_exception.cc: New file.
* src/integer/division/cl_I_exquoerr.cc: Removed.
* src/integer/division/cl_I_exquo_exception.cc: New file.
* src/integer/cl_I.h: Throw.
* src/integer/division/cl_I_exquopos.cc: Throw.
* src/integer/bitwise/cl_I_logbitp_I.cc: Throw.
* src/integer/bitwise/cl_I_ash.cc: Throw.
* src/integer/bitwise/cl_I_ash_I.cc: Throw.
* src/integer/division/cl_I_exquo.cc: Throw.
* src/integer/gcd/cl_I_gcd_aux2.cc: Throw.
* src/integer/conv/cl_I_to_L.cc: Throw.
* src/integer/conv/cl_I_to_Q.cc: Throw.
* src/integer/conv/cl_I_to_UL.cc: Throw.
* src/integer/conv/cl_I_to_UQ.cc: Throw.
* src/integer/conv/cl_I_to_digits.cc: Throw.
* src/integer/elem/cl_I_div.cc: Throw.
* src/integer/algebraic/cl_I_sqrt.cc: Throw.
* src/integer/input/cl_I_read.cc: Throw.
* src/integer/input/cl_I_read_stream.cc: Throw.
* src/integer/misc/cl_I_as.cc: Throw.
* src/rational/elem/cl_RA_from_I_I_div.cc: Throw.
* src/rational/elem/cl_RA_recip.cc: Throw.
* src/rational/input/cl_RA_read.cc: Throw.
* src/rational/input/cl_RA_read_stream.cc: Throw.
* src/rational/input/cl_RA_readparsed.cc: Throw.
* src/rational/misc/cl_RA_as.cc: Throw.
* src/float/base/cl_F_err_nan.cc: Removed.
* src/float/base/cl_F_nan_exception.cc: New file.
* src/float/base/cl_F_err_un.cc: Removed.
* src/float/base/cl_F_underflow_exception.cc: New file.
* src/float/base/cl_F_err_ov.cc: Removed.
* src/float/base/cl_F_overflow_exception.cc: New file.
* src/float/cl_F.h (cl_error_floating_point_nan,
cl_error_floating_point_overflow, cl_error_floating_point_underflow):
Removed (see cln/float.h.)
* src/float/sfloat/cl_SF.h: Throw.
* src/float/sfloat/elem/cl_SF_div.cc: Throw.
* src/float/sfloat/elem/cl_SF_from_RA.cc: Throw.
* src/float/sfloat/elem/cl_SF_scale.cc: Throw.
* src/float/sfloat/elem/cl_SF_scale_I.cc: Throw.
* src/float/sfloat/misc/cl_SF_as.cc: Throw.
* src/float/ffloat/cl_FF.h: Throw.
* src/float/ffloat/conv/cl_FF_from_float.cc: Throw.
* src/float/ffloat/elem/cl_FF_div.cc: Throw.
* src/float/ffloat/elem/cl_FF_from_RA.cc: Throw.
* src/float/ffloat/elem/cl_FF_scale.cc: Throw.
* src/float/ffloat/elem/cl_FF_scale_I.cc: Throw.
* src/float/ffloat/misc/cl_FF_as.cc: Throw.
* src/float/dfloat/cl_DF.h: Throw.
* src/float/dfloat/conv/cl_DF_from_double.cc: Throw.
* src/float/dfloat/elem/cl_DF_div.cc: Throw.
* src/float/dfloat/elem/cl_DF_from_RA.cc: Throw.
* src/float/dfloat/elem/cl_DF_scale.cc: Throw.
* src/float/dfloat/elem/cl_DF_scale_I.cc: Throw.
* src/float/dfloat/misc/cl_DF_as.cc: Throw.
* src/float/lfloat/algebraic/cl_LF_sqrt.cc: Throw.
* src/float/lfloat/elem/cl_LF_1plus.cc: Throw.
* src/float/lfloat/elem/cl_LF_I_div.cc: Throw.
* src/float/lfloat/elem/cl_LF_I_mul.cc: Throw.
* src/float/lfloat/elem/cl_LF_div.cc: Throw.
* src/float/lfloat/elem/cl_LF_from_I.cc: Throw.
* src/float/lfloat/elem/cl_LF_mul.cc: Throw.
* src/float/lfloat/elem/cl_LF_scale.cc: Throw.
* src/float/lfloat/elem/cl_LF_scale_I.cc: Throw.
* src/float/lfloat/elem/cl_LF_square.cc: Throw.
* src/float/lfloat/misc/cl_LF_as.cc: Throw.
* src/float/lfloat/misc/cl_LF_shorten.cc: Throw.
* src/float/lfloat/misc/cl_LF_shortenrel.cc: Throw.
* src/float/lfloat/misc/cl_LF_shortenwith.cc: Throw.
* src/float/input/cl_F_read.cc: Throw.
* src/float/input/cl_F_read_stream.cc: Throw.
* src/float/misc/cl_F_as.cc: Throw.
* src/float/misc/cl_F_shortenrel.cc: Throw.
* src/float/transcendental/cl_LF_coshsinh_aux.cc: Throw.
* src/float/transcendental/cl_LF_cossin_aux.cc: Throw.
* src/float/transcendental/cl_LF_exp_aux.cc: Throw.
* src/float/transcendental/cl_LF_ratseries_a.cc: Throw.
* src/float/transcendental/cl_LF_ratseries_ab.cc: Throw.
* src/float/transcendental/cl_LF_ratseries_b.cc: Throw.
* src/float/transcendental/cl_LF_ratseries_p.cc: Throw.
* src/float/transcendental/cl_LF_ratseries_pa.cc: Throw.
* src/float/transcendental/cl_LF_ratseries_pab.cc: Throw.
* src/float/transcendental/cl_LF_ratseries_pb.cc: Throw.
* src/float/transcendental/cl_LF_ratseries_pq.cc: Throw.
* src/float/transcendental/cl_LF_ratseries_pqa.cc: Throw.
* src/float/transcendental/cl_LF_ratseries_pqab.cc: Throw.
* src/float/transcendental/cl_LF_ratseries_pqb.cc: Throw.
* src/float/transcendental/cl_LF_ratseries_q.cc: Throw.
* src/float/transcendental/cl_LF_ratseries_qa.cc: Throw.
* src/float/transcendental/cl_LF_ratseries_qab.cc: Throw.
* src/float/transcendental/cl_LF_ratseries_qb.cc: Throw.
* src/float/transcendental/cl_LF_ratseries_stream_pq.cc: Throw.
* src/float/transcendental/cl_LF_ratseries_stream_pqa.cc: Throw.
* src/float/transcendental/cl_LF_ratseries_stream_pqab.cc: Throw.
* src/float/transcendental/cl_LF_ratseries_stream_pqb.cc: Throw.
* src/float/transcendental/cl_LF_ratsumseries_pqcd_aux.cc: Throw.
* src/float/transcendental/cl_LF_ratsumseries_pqd.cc: Throw.
* src/float/transcendental/cl_LF_ratsumseries_pqd_aux.cc: Throw.
* src/float/transcendental/cl_LF_zeta_int.cc: Throw.
* src/real/elem/cl_R_div.cc: Throw.
* src/real/format-output/cl_fmt_cardinal.cc: Throw.
* src/real/format-output/cl_fmt_newroman.cc: Throw.
* src/real/format-output/cl_fmt_oldroman.cc: Throw.
* src/real/input/cl_R_read.cc: Throw.
* src/real/input/cl_R_read_stream.cc: Throw.
* src/real/misc/cl_R_as.cc: Throw.
* src/real/random/cl_R_random.cc: Throw.
* src/real/transcendental/cl_R_atan2.cc: Throw.
* src/real/transcendental/cl_R_log.cc: Throw.
* src/complex/input/cl_N_read.cc: Throw.
* src/complex/input/cl_N_read_stream.cc: Throw.
* src/complex/misc/cl_N_as.cc: Throw.
* src/complex/transcendental/cl_C_atanh_aux.cc: Throw.
* src/complex/transcendental/cl_C_expt_C.cc: Throw.
* src/complex/transcendental/cl_C_log.cc: Throw.
* src/complex/transcendental/cl_C_log2.cc: Throw.
* src/numtheory/cl_nt_cornacchia1.cc: Throw.
* src/numtheory/cl_nt_cornacchia4.cc: Throw.
* src/numtheory/cl_nt_isprobprime.cc: Throw.
* src/numtheory/cl_nt_jacobi.cc: Throw.
* src/numtheory/cl_nt_jacobi_low.cc: Throw.
* src/numtheory/cl_nt_sqrtmodp.cc: Throw.
* src/modinteger/cl_MI.cc: Throw.
* src/modinteger/cl_MI_int.h: Throw.
* src/modinteger/cl_MI_montgom.h: Throw.
* src/modinteger/cl_MI_pow2.h: Throw.
* src/modinteger/cl_MI_rshift.cc: Throw.
* src/modinteger/cl_MI_std.h: Throw.
* src/polynomial/elem/cl_UP_GF2.h: Throw.
* src/polynomial/elem/cl_UP_MI.h: Throw.
* src/polynomial/elem/cl_UP_gen.h: Throw.
* src/polynomial/elem/cl_UP_named.cc: Throw.
* src/polynomial/elem/cl_UP_no_ring.cc (uninitialized_error,
uninitialized_ring): Removed (see cln/ring.h.)
* src/polynomial/elem/cl_UP_number.h: Throw.
* src/polynomial/elem/cl_UP_unnamed.cc: Throw.
* src/vector/cl_GV_I.cc: Throw.
* src/vector/cl_GV_number.cc: Throw.
* tests/timediv2adic-compare.cc: Use default abort(), not cl_abort().
* tests/timeprint-compare.cc: Likewise.
* tests/timerecip2adic-compare.cc: Likewise.
* doc/cln.tex: Document the exception classes.
* examples/contfrac.cc: Use try/catch instead of setjmp/longjmp.
* INSTALL: undocument -fno-exceptions.
* README: Add exceptions to list of used C++ features.
18 years ago
Richard Kreckel
6fdd87f5e7
* Cumulative patch including Bruno's work on large fixnums on 64 bit machines.
19 years ago
Richard Kreckel
e269351d54
The patch of 2005-05-01 made it impossible to test the type of a cl_UP
by comparing with &cl_class_univpoly_ring. We need an alternative:
* include/cln/object.h (cl_class_flags_modint_ring): New #define...
* src/polynomial/elem/cl_UP.cc (cl_class_univpoly_ring): ...used here.
* src/polynomial/elem/cl_UP_GF2.h: Likewise.
* src/polynomial/elem/cl_UP_MI.h: Likewise.
* src/polynomial/elem/cl_UP_gen.h: Likewise.
* src/polynomial/elem/cl_UP_number.h: Likewise.
20 years ago
Richard Kreckel
77bcf72d79
* include/cln/config.h.in: Add support for PowerPC 64 CPU.
* include/cln/modules.h: Likewise.
* include/cln/object.h: Likewise.
* include/cln/types.h: Likewise.
20 years ago
Richard Kreckel
6d4cabf35e
Fix crashes in find_univpoly_ring and related functions
* include/cln/modinteger.h: Remove vptr from cl_heap_modint_ring;
remove declaration of cl_class cl_class_modint_ring.
* include/cln/univpoly.h: Remove vptr from cl_heap_univpoly_ring;
remove declaration of cl_class_univpoly_ring.
* include/cln/object.h: cl_class_flags_modint_ring: New #define...
* src/modinteger/cl_MI.cc: ...used in cl_class_modint_ring.
* src/modinteger/cl_MI_fix16.h: No vptr, but static dtor and type flag.
* src/modinteger/cl_MI_fix29.h: Likewise.
* src/modinteger/cl_MI_fix32.h: Likewise.
* src/modinteger/cl_MI_int32.h: Likewise.
* src/modinteger/cl_MI_montgom.h: Likewise.
* src/modinteger/cl_MI_pow2: Likewise.
* src/modinteger/cl_MI_pow2m1.h: Likewise.
* src/modinteger/cl_MI_pow2p1.h: Likewise.
* src/modinteger/cl_MI_std.h: Likewise.
* src/polynomial/elem/cl_UP.cc (cl_make_univpoly_ring): Compare with
cl_class_flags_modint_ring, not with cl_class_modint_ring.
* src/polynomial/elem/cl_UP_GF2.h (cl_class_num_univpoly_ring): New.
* src/polynomial/elem/cl_UP_MI.h (cl_class_modint_univpoly_ring): New.
* src/polynomial/elem/cl_UP_gen.h (cl_class_gen_univpoly_ring): New.
* src/polynomial/elem/cl_UP_number.h (cl_class_num_univpoly_ring): New.
Reported by Ralf Goertz <R_Goertz@web.de>.
20 years ago
Richard Kreckel
089003015a
Support for little-endian Mips, second shot
* src/base/digitseq/cl_asm_mipsel_.cc: New file...
* src/base/digitseq/cl_asm_cc: ...used here.
* src/base/digitseq/cl_asm.h: Include cl_asm_mips.h for any endianness.
* include/cln/object.h: Set alignment for mipsel explicitly.
20 years ago
Richard Kreckel
a8369235e2
* Change all C include headers to ISO style within C++ code.
21 years ago
Richard Kreckel
34f61129e8
Dependent base resolution needed for GCC-3.4
* include/cln/GV.h: Preceed inherited members with this->.
* include/cln/SV.h: Likewise.
* include/cln/object.h: Likewise.
* src/base/hash/cl_hash1.h: Likewise.
* src/base/hash/cl_hash1weak.h: Likewise.
* src/base/hash/cl_hash2.h: Likewise.
* src/base/hash/cl_hashuniq.h: Likewise.
* src/base/hash/cl_hash.h: Make lookup of static member function
explicit.
* src/base/hash/cl_hash2weak.h: Likewise.
* src/base/hash/cl_hashuniqweak.h: Likewise.
* src/modinteger/cl_MI.cc: Make shell-comment a C-comment. Geez.
22 years ago
Bruno Haible
7e82f04c80
Add support for x86_64 CPU.
23 years ago
Richard Kreckel
460a165479
* include/cln/modules.h, include/cln/object.h: add support for
s390.
* src/numtheory/cl_nt_sqrtmodp.cc: workaround for GCC2.x compiler-bug
on s390, provided by Gerhard Tonn.
23 years ago
Richard Kreckel
0c3376e344
* include/cln/*.h: Change signatures of all classes' methods
cln::cl_foo::operator new(size_t, cl_foo*) to
cln::cl_foo::operator new(size_t, void*) so one can declare
std::vector<cln::cl_foo>, std::list<cln::cl_foo> etc. for
certain STL implementations (like libstdc++-v3).
24 years ago
Richard Kreckel
f57f23a99a
* */*: Removed problematic stdin, stdout and stderr definitions.
Use std::cin, std::cout, std::cerr instead (obsoletes 2000-10-29).
24 years ago
Richard Kreckel
795eaad118
* src/base/digitseq/cl_asm.h: Test if (intDsize==32) for MIPS and HPPA,
in order to guard against an accidented configuration.
* src/integer/conv/cl_I_to_digits.cc (table): member b_hoch_k of
struct power_table_entry initialized as ULL instead of as UL, if
intDsize==64 (caused misprinting on MIPS w/ GMP).
* src/base/cl_macros.h (minus_bitm, bitc): implemented ULL, if
HAVE_FAST_LONGLONG.
* src/integer/bitwise/cl_I_mkfx.cc (mkf_extract): Likewise.
* src/integer/conv/cl_I_from_L.cc (cl_I_from_L): Added trival
generation of Bignum for intDsize==64 and a notreached-check at end.
* autoconf/config.guess, autoconf/config.sub: updated from FSF.
* include/cln/config.h.in: Prepared support for IA64.
* include/cln/types.h: Likewise.
* include/cln/object.h: Likewise.
* include/cln/modules.h: Likewise.
* src/base/cl_macros.h (nonreturning_function): Likewise (NUE's
compiler claims __GNUC_MINOR__==9).
* src/base/cl_macros.h (bit, minus_bit): changed criterion for ULL from
HAVE_DD to HAVE_FAST_LONGLONG.
* src/base/cl_macros.h (bitm): implemented ULL, if HAVE_FAST_LONGLONG.
* src/base/cl_low.h: actually no need to include "cln/types.h" here.
* src/base/cl_low.h (logcount_64): always ULL, independent of HAVE_DD.
* src/base/random/cl_UL_random.cc (random32): a is always ULL.
24 years ago
Richard Kreckel
e0c2092123
* 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.
24 years ago
Richard Kreckel
850abfde7f
* All Files have been modified for inclusion of namespace cln;
I am too lazy for a detailed discussion of all the changes.
Many identifiers got their `cl_' stripped off. Ok, this is a
clumpsy CVS log-entry. Promise: more will soon go into the
file ChangeLog. I apologize for the inconvenience. :-(
25 years ago
Bruno Haible
9c6ab33803
Distinguish between cl_word_size and the ABI's pointer size.
25 years ago
Richard Kreckel
dd9e0f894e
Initial revision
25 years ago