lp://staging/~mgiuca/mars/llvm-backend-gmp

Created by Matt Giuca and last modified

Adding GMP (GNU Multiple Precision Arithmetic library) support to the Mars LLVM backend. This will make the Int type have the correct bignum semantics, rather than the current 32-bit wraparound behaviour.

Get this branch:
bzr branch lp://staging/~mgiuca/mars/llvm-backend-gmp
Only Matt Giuca can upload to this branch. If you are Matt Giuca please log in for upload directions.

Branch merges

Related bugs

Related blueprints

Branch information

Owner:
Matt Giuca
Project:
Mars
Status:
Experimental

Recent revisions

1242. By Matt Giuca

lib/runtime: mars.mars_string_to_c_string now correctly extracts integers from GMP format.

1241. By Matt Giuca

lib/runtime: Rewrite a lot of builtins to use the GMP library rather than casting ints to pointers (such builtins now work with bigints).
Note that this is highly unstable; any builtins which haven't been changed will treat pointers as integers.
This build is utterly broken.

1240. By Matt Giuca

lib/runtime: Change the type of Int to a mpz_ptr (mpz_t*).
Ints are now conceptually represented as pointers to GMP big integers. However, currently the implementation still just casts 32-bit ints to pointers as it always has (so it doesn't actually work for big ints).

1239. By Matt Giuca

backend_llvm: ld_intlit now compiles to a call to mars.new_int_si, rather than directly casting to an i8*.
This will be compatible with a future change of the definition of the %Int type.

1238. By Matt Giuca

lib/runtime: Added declarations of a bunch of libgmp functions.

1237. By Matt Giuca

lib/runtime: Added @mars.new_int_0 and @mars.new_int_si.

1236. By Matt Giuca

Makefile: Mars is now linked with libgmp, which will be required by the runtime system.

1235. By Matt Giuca

backend_llvm: Correctly bitcast the result of ld_field if required.

1234. By Matt Giuca

lib/runtime: Fix __impure_is type (return %Int instead of %Any).

1233. By Matt Giuca

lib/runtime: div and mod now perform adjustments to use floored division rather than truncated division.
Two test_builtin cases now pass.

Branch metadata

Branch format:
Branch format 7
Repository format:
Bazaar repository format 2a (needs bzr 1.16 or later)
Stacked on:
lp://staging/mars
This branch contains Public information 
Everyone can see this information.

Subscribers