YunQiang Su [Sun, 18 Mar 2018 11:05:51 +0000 (12:05 +0100)]
Support MIPS release 6.
MIPS release 6 is not full compatible with the previous releases, it removes
some instructions and changes encoding of some instruction.
the `multu' is included.
MIPS r6 drops `lo' and `hi' registers, and then removes `multu'/`mfhi'/`mflo'.
Instead it uses `mulu' to compute the low part and `muhu' to compute
the high part.
Richard Kreckel [Sat, 11 Oct 2014 22:03:21 +0000 (22:03 +0000)]
Fix floating-point input from decimal string.
A bug was introduced in 3480230e: The divide-and-conquer method multiplies
with a power of the base, but this power is one too much if there is a
decimal point. This may happen because digits_to_I(...) is also called
from read_float(...). As a result, the number containd spurious zeros
(in the base used for reading it).
Thanks to Thomas Luthe <tluthe@physik.uni-bielefeld.de>.
Richard Kreckel [Fri, 19 Sep 2014 20:40:20 +0000 (20:40 +0000)]
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).
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.
Richard Kreckel [Sat, 6 Oct 2012 20:44:34 +0000 (22:44 +0200)]
Fix integer input with leading zeros in power-of-two base.
Reading leading '0' characters in integers of base 2, 4, 8, 16, or 32
could result in a NUDS with leading zero digits. This is against the
rules. The result was a misbehaving cl_I down the road.
Thanks to Morgan Deters <mdeters@cs.nyu.edu> of the CVC4 team.
Richard Kreckel [Sun, 1 Apr 2012 20:38:54 +0000 (22:38 +0200)]
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.)
Richard Kreckel [Sat, 9 Apr 2011 08:04:39 +0000 (10:04 +0200)]
Support for MSVC.
This patch works around problems MSVC has with extern "C" declarations
inside namespace cln. As a result, it should work with MS 32-bit compiler
version 16.00.30319.01.
Thanks to Jan Rheinländer <jrheinlaender@gmx.de>.
Fix the documentation build failure (wrong texinfo).
Building PDF, PostScript, and DVI versions of the documentation fails
with the following error message(s):
../../doc/cln.texi:1170: Argument of @asis has an extra }.
<inserted text>
@par
<to be read again>
}
According to texinfo maintainer @itemize @asis is illegal, one should
use @itemize @w{} instead.
See <http://lists.gnu.org/archive/html/bug-texinfo/2009-03/msg00016.html>.
Richard Kreckel [Fri, 11 Sep 2009 20:54:27 +0000 (22:54 +0200)]
Fix double_approx(const cl_RA& x) on 64-Bit platforms.
When we extended immediate types on 64-bit platforms back for CLN
1.2.0, we broke the assumption that integers 2^53..2^55-1 are
bignums. This lead to segfaults when approximating a non-integer cl_RA
to double, as reported by Igor Khavkine <igor.kh@gmail.com>.
Richard Kreckel [Mon, 22 Jun 2009 21:12:46 +0000 (23:12 +0200)]
Fix build breakage on Sparc.
With 7da4d3ae46279298acd5d65637499caab7b57071, the code that sed-converted
the $ to # in all the Sparc assembler files was removed. Let's hope that
we won't need it again.
Richard Kreckel [Sun, 15 Feb 2009 21:16:11 +0000 (22:16 +0100)]
Prefer GMP's multiplication routine (if GMP version >= 4.0).
Recent GMP multiplication routines (mpn_mul) are somewhat faster than CLN's.
For huge operands, this is due to better tuned FFT. For medium-sized operands
it's due to more algorithms (Toom 3-way.) For small operands, I couldn't find
a difference. Let's just use mpn_mul if it's available.
For huge binsplit sums, this can half the runtimes, on amd64.
Automake adds all kinds of subdirectories to -I, the list of directories
to be searched for header files. However, CLN's header files are not
supposed to be included without the cln/ subdirectory, so adding
-Iinclude/cln can lead to conflicts with other header files. (The
problem at hand was a conflict between CLN's string.h and the C
library's string.h).
Use std::iostream functions instead of EOF and cl_EOF macros.
This enables us to get rid of the freadchar and funreadchar functions.
While at it, removed the extra signatures introduced for CLN-1.2.0
compatibilty. After all, the soname has been bumped.
Also updated largest known Mersenne prime in examples/perfnum.cc.
[bugfix] Actually compile in version info into the library.
src/base/cl_version.cc: don't #include "cl_sysdep.h", so the version info
actually gets compiled into the library.
Due to the changes introduced in 7da4d3ae ("build: switch to ordinary auto*
tools system") including "cln/version.h" after "cl_config.h" is no-op (yes,
this is intended).
benchmarks: time{catalan,euler,exp1,zeta3}.cc actually compile and work now.
These benchmarks use internal CLN functions. Even worse -- they expect to
find these functions in the global namespace. Declare internal CLN functions
in the namespace cln.
1. If a header file gets modified, all dependent stuff gets rebuilt.
No need for 'make clean' after each header modification, no more
spurious errors, no more spurious rebuilds.
2. No more errors due to redefined preprocessor, compiler, and linker
FLAGS.
3. Build scripts don't try to build every *.cc file which happen to
lurk in the source directory.
Replace CL_REQUIRE/CL_PROVIDE(cl_UP) with portable code.
The order of initialization of non-local objects in different compilation units
is not specified in C++. Hence special care should be taken to avoid static
initialization order fiasco. CLN solved the problem with some evil (GCC
specific, and even GCC-version-specific) hack. Replace it with a technique
similar to one used in STL to initialize std::cout and friends.
Replace CL_REQUIRE/CL_PROVIDE(cl_UP_no_ring) with portable code.
The order of initialization of non-local objects in different compilation units
is not specified in C++. Hence special care should be taken to avoid static
initialization order fiasco. CLN solved the problem with some evil (GCC
specific, and even GCC-version-specific) hack. Replace it with a technique
similar to one used in STL to initialize std::cout and friends.
Replace CL_REQUIRE/CL_PROVIDE(cl_UP_named) with portable code.
The order of initialization of non-local objects in different compilation units
is not specified in C++. Hence special care should be taken to avoid static
initialization order fiasco. CLN solved the problem with some evil (GCC
specific, and even GCC-version-specific) hack. Replace it with a technique
similar to one used in STL to initialize std::cout and friends.
Replace CL_REQUIRE/CL_PROVIDE(cl_UP_unnamed) with portable code.
The order of initialization of non-local objects in different compilation units
is not specified in C++. Hence special care should be taken to avoid static
initialization order fiasco. CLN solved the problem with some evil (GCC
specific, and even GCC-version-specific) hack. Replace it with a technique
similar to one used in STL to initialize std::cout and friends.
Get rid CL_REQUIRE/CL_PROVIDE(cl_F_epsneg), it is not really necessary.
Move static variables [SFDL]F_negative_epsilon into LF_negative_epsilon()
function (which is the only user of those variables) in order to avoid
possible static order initialization problems. While at it, make
LF_negative_epsilon() function static.
Get rid CL_REQUIRE/CL_PROVIDE(cl_F_epspos), it is not really necessary.
Move static variables [SFDL]F_epsilon into LF_epsilon() function (which
is the only user of those variables) in order to avoid possible static
order initialization problems. While at it, make LF_epsilon() function
static.
Get rid CL_REQUIRE/CL_PROVIDE(cl_F_leastneg), it is not really necessary.
Move static variables least_negative_[SFDL]F into least_negative_LF() function
(which is the only user of those variables) in order to avoid possible static
order initialization problems. While at it, make least_negative_LF() function
static.
Get rid CL_REQUIRE/CL_PROVIDE(cl_F_leastpos), it is not really necessary.
Move static variables least_positive_[SFDL]F into least_positive_LF() function
(which is the only user of those variables) in order to avoid possible static
order initialization problems. While at it, make least_positive_LF() function
static.
Get rid CL_REQUIRE/CL_PROVIDE(cl_F_mostneg), it is not really necessary.
Move static variables most_negative_[SFDL]F into most_negative_LF() function
(which is the only user of those variables) in order to avoid possible static
order initialization problems. While at it, make most_negative_LF() function
static.
Get rid CL_REQUIRE/CL_PROVIDE(cl_F_mostpos), it is not really necessary.
Move static variables most_positive_[SFDL]F into most_positive_LF() function
(which is the only user of those variables) in order to avoid possible static
order initialization problems. While at it, make most_positive_LF() function
static.
Get rid of CL_REQUIRE/CL_PROVIDE(cl_F_catalanconst_var).
Turn cl_[SDFL]F_catalanconst global variables into functions (which return
a reference to the static value) in order to avoid static initialization
order problems.
Get rid of CL_REQUIRE/CL_PROVIDE(cl_F_eulerconst_var).
Turn cl_[SDFL]F_eulerconst global variables into functions (which return
a reference to the static value) in order to avoid static initialization
order problems.
Turn cl_[SDFL]F_exp1 global variables into functions (which return a reference
to the static value) in order to avoid static initialization order problems.
Turn cl_[SDFL]F_ln10 global variables into functions (which return a constant
reference to the static value) in order to avoid static initialization order
problems.
Turn cl_[SDFL]F_ln2 global variables into functions (which return a constant
reference to the static value) in order to avoid static initialization order
problems.
Turn cl_[SDFL]F_pi global variables into functions (which return a constant
reference to the static value) in order to avoid static initialization order
problems.
Replace CL_REQUIRE/CL_PROVIDE(cl_GV_I) with portable code.
The order of initialization of non-local objects in different compilation units
is not specified in C++. Hence special care should be taken to avoid static
initialization order fiasco. CLN solved the problem with some evil (GCC
specific, and even GCC-version-specific) hack. Replace it with a technique
similar to one used in STL to initialize std::cout and friends.
Replace CL_REQUIRE/CL_PROVIDE(cl_GV_number) with portable code.
The order of initialization of non-local objects in different compilation units
is not specified in C++. Hence special care should be taken to avoid static
initialization order fiasco. CLN solved the problem with some evil (GCC
specific, and even GCC-version-specific) hack. Replace it with a technique
similar to one used in STL to initialize std::cout and friends.
Replace CL_REQUIRE/CL_PROVIDE(cl_SV_number) with portable code.
The order of initialization of non-local objects in different compilation units
is not specified in C++. Hence special care should be taken to avoid static
initialization order fiasco. CLN solved the problem with some evil (GCC
specific, and even GCC-version-specific) hack. Replace it with a technique
similar to one used in STL to initialize std::cout and friends.