Fix various assumptions about mpw sizes.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 4 Apr 2006 16:17:45 +0000 (17:17 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Tue, 16 Jan 2007 22:20:06 +0000 (22:20 +0000)
commitc29970a7717261e63ffaabb3c67381f13c5dbca5
treeb5610c1c29c74f830c603f4009f86c34177157b4
parentce541a0ec0b78847792b0a81b829bc76f9c5efcb
Fix various assumptions about mpw sizes.

  * configure, mptypes: New configure switches force mpw type to either
    sane but small (16/32 bits) or cussid (19/38 bits).  This found a
    bunch of exciting bugs...

  * gfreduce, mpreduce: If MPW_BITS is not a power of two, modular
    reduction of a `negative' unsigned value does the wrong thing.

  * mpx_lsl and friends: Shifting ops weren't masking high-order bits
    correctly when writing the output.  Apply MPW().

  * mpx_usubnlsl: More failure to elide high-order junk bits.

  * mptypes, mpx_udiv, mpx_bits, mp_odd: The binary search is neato, but
    starts in the wrong place if MPW_BITS is not a power of two.  Have
    mptypes  compute MPW_P2 as the largest power of two less than
    MPW_BITS.
configure.in
gfreduce.c
mp-arith.c
mpreduce.c
mptypes.c
mpx.c
mpx.h
tests/mpreduce
tests/mpx