[Aldor-l] Using GMP and extending the biging protocol
pip88nl at gmail.com
pip88nl at gmail.com
Fri Aug 15 23:26:19 EDT 2008
On Sat, Aug 16, 2008 at 03:52:20AM +0200, wrote:
> By the way, it is not possible to replace the bigint entirely, because it
> would break all bytecode. BInts are stored directly in bytecode in the
> representation of BInt. gmp would only go into the runtime.
>
> Pippijn
Funny thing.. using the gmp version of the aldor runtime makes it
segfault in float4.as (from axllib tests) because of aliasing between
mpz_t and BInt (gmp data is being interpreted as BInt data).
I instrumented the generated C code (asm transformations.. yuck) and
added overflow checks (replaced all add, sub and mul instructions with
calls to my checking routine) and found that bigmand.as (from axllib
tests) in fact overflows something:
checked (0xfffffffffffffff4 + 0xf)
[1] 7235 abort tests/library/axllib/bigmand.run
Note that I don't return from the failure functions, because they mess
up the stack slightly. In a debugger, I can still get a backtrace,
though.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://mail.aldor.org/pipermail/aldor-l_aldor.org/attachments/20080816/fea0f432/attachment-0002.bin>
More information about the Aldor-l
mailing list