Changes between Version 6 and Version 7 of ReplacingGMPNotes


Ignore:
Timestamp:
Aug 3, 2006 1:36:05 AM (8 years ago)
Author:
ptanski
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ReplacingGMPNotes

    v6 v7  
    3737        This current implementation of Integer means that all Integers are at least the size of an Int# plus a !ByteArr, even if there is only one limb (which would fit into an Int, as Int is also the representation of a machine word in current implementations).  The suggestion discussed by John Meacham, [http://www.haskell.org/pipermail/glasgow-haskell-users/2006-August/010664.html Lennart Augustsson], [http://www.haskell.org/pipermail/glasgow-haskell-users/2006-August/010677.html Simon Marlow] and [http://www.haskell.org/pipermail/glasgow-haskell-users/2006-August/010687.html Bulat Ziganshin] was to change the representation of Integer so the Int# could be either a pointer to the Bignum library array of limbs or, if the number of significant digits could fit into say, 31 bits, to use the extra bit as an indicator of that fact and hold the entire value in the Int#, thereby saving the memory from the ByteArr# and increasing the speed with an unboxed Int#.   
    3838 
    39         Note that the downside to this approach would mean that:  
    40         * pointers would have to be constrained (the size of an actual pointer may be greater than 32 bits on some machines (it is not defined by the C99 standard)); and,  
    41         * either Ints in general would all be 30 or 31 bits, depending on how many bits you need to indicate the ByteArr#, or you would have to come up with a new primitive type. 
    42  
    4339=== Overview of the Current GMP Implementation === 
    4440