| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
patch, resulting in an insufficient bit field width for representing
the allocation size of the MPI integer on 32 bit platforms.
|
|
|
|
|
|
| |
It will take days to completely wipe the egg off my face.
I forgot to fix this code for unsigned integers before
pasting it into MPI.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(abso, isqrt): New functions.
(isqrt_fixnum): New static function.
* eval.c (eval_init): Registered abs, sqrt and numberp instrinsics.
* lib.c (numberp): New function.
* lib.h (numberp, abso, isqrt): Declared.
* mpi-patches/series: New patch added.
* mpi-patches/faster-square-root: New patch added.
* txr.1: Documentation stubs for new functions.
|
|
|
|
|
|
|
|
| |
so that obj_t stays four pointers wide.
* mpi-patches/series: New patch added.
* mpi-patches/shrink-mpi-int: New file.
|
|
|
|
|
|
|
|
|
| |
storage class specifier.
* mpi-patches/fix-mult-bug (s_mp_sqr): More braindamage found in MPI.
This function performs additions and multiplication mp_digit,
expecting a mp_word precision result without casting. This function
is needed for exponentiation.
|
|
|
|
|
|
|
|
|
| |
the highest bit, replacing them with an adapation of the
bit searching function used in arith.c.
* mpi-patches/series: Patch added.
* mpi-patches/bit-search-optimizations: New file.
|
|
|
|
|
|
|
|
|
|
|
|
| |
s_mp_mul_d and added to patch. This one caused malloc corruption and
crashes, because the incorrect arithmetic causes the function
to think that the multiplication will not be needing another
digit, but then there is a carry out which does spill into
a new digit.
* mpi-patches/series: Arg! Somehow the patch fix-bad-shift
went missing from the series file, even though the patch
itself is in the GIT repository.
|
|
|
|
|
|
|
|
|
|
|
| |
code like 1 << n, where n exceeds the width of the type int.
* arith.c (trunc): New function, reimplementation of removed
trunc from lib.c.
* lib.c (trunc): Removed.
* mpi-patches/fix-bad-shifts: New file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* arith.c: Regenerated.
* arith.txr (CNUM_BIT): New constant.
(bignum, bignum_dbl_ipt): New static functions.
(@{add-fname}): Use bignum function.
(mul): New functions, rewrite of mul from lib.c.
* lib.c (mul): Function removed.
* mpi-patches/add-mp-set-intptr (mp_set_intptr): Revised patch.
Local variable v should be int_ptr_t not unsigned long.
Also, the mp_set interface doesn't set the sign; it's an unsigned
interface. We must do that ourselves.
* mpi-patches/fix-mult-bug: The main multiplication function is
also broken in the same way, requiring the cast.
* mpi-patches/mpi-set-double-intptr: Fixed use of wrong type for
local variable v.
|
|
|
|
|
|
| |
* mpi-patches/mpi-set-double-intptr: New file.
* mpi-patches/series (mpi-set-double-intptr): Patch added.
|
|
|
|
|
|
| |
* mpi-patches/series (mpi-set-mpi-word): New patch.
* mpi-patches/mpi-set-mpi-word: New file.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
low-order bit material from the bignum to fill an unsigned long.
We don't need to walk the entire bignum. If the low order
digit of the bignum is at least as large as an unsigned long,
we just take that as the hash, otherwise we take enough of the
digits to fill an unsigned long. For negative numbers, we just
invert the bits of the hash.
* mpi-patches/add-mpi-toradix-with-case: Refreshed.
* mpi-patches/fix-mult-bug: Refreshed.
|
|
|
|
|
|
|
|
|
|
| |
* configure (longlong, ulonglong, superlong, usuperlong): Initialize
these variables so that if the detection tests fail, the script
does not access unbound variables.
Avoid adding junk like .bss.* into config.h.
* mpi-patches/config-types: Fixed wrong use of nonexistent
SIZEOF_LONG_T.
|
|
|
|
|
| |
* mpi-patches/config-types: Added missing definitions
of MP_DIGIT_SIZE in two cases.
|
|
Bignums, based on Michael Fromberger's MPI library, are integrated
into the input syntax, stream output, equality testing, the garbage
collector, and hashing.
The plus operation handles transitions between fixnums and bignums.
Other operations are still fixnum only.
* Makefile (CFLAGS): Add mpi directory to include file search.
(OBJS): Include new arith.o module and all of MPI_OBJS.
(MPI_OBJS, MPI_OBJS_BASE): New variables.
* configure (mpi_version, have_quilt, have_patch): New variables.
Script detects whether patch and quilt are available. Unpacks
mpi library, applies patches. Detects 128 bit integer type.
Records more information in config.h about the sizes of types.
* dep.mk: Updated.
* depend.txr: Make work with paths that have directory components.
* eval.c (eval_init): Rename of nump to fixnump.
* gc.c (finalize, mark_obj): Handle BGNUM case.
* hash.c: (hash_c_str): Changed to return unsigned long
instead of long.
(equal_hash): Handle BGNUM case.
(eql_hash): Handle bignums with equal-hash, but other
objects as eq.
* lib.c (num_s): Variable renamed to fixnum_s.
(bignum_s): New symbol variable.
(code2type): Follow rename of num_s. Handle BGNUM case.
(typeof): Follow rename of num_s.
(eql): Handle bignums using equal, and other types using eq.
(equal): Handle BGNUM case.
(chk_calloc): New function.
(c_num): Wording change in error message: is not a fixnum.
(nump): Renamed to fixnump.
(bignump): New function.
(plus): Function removed, reimplemented in arith.c.
(int_str): Handle integers which are too large for wcstol
using bignum conversion. Base 0 is no longer passed to
wcstol but converted to 10 because the special semantics
for 0 would be inconsistent for bignums.
(obj_init): Follow rename of num_s. Initialize bignum_s.
|