Re: Pointer-or-Int 63-bit representations for Integer

2021-03-08 Thread Sylvain Henry
Hi Chris, It has been considered in the past. There are some traces in the wiki: https://gitlab.haskell.org/ghc/ghc/-/wikis/replacing-gmp-notes >> The suggestion discussed by John Meacham , Lennart Augustsson

Re: Pointer-or-Int 63-bit representations for Integer

2021-03-08 Thread chris done
On Mon, Mar 8, 2021, at 5:41 PM, Spiwack, Arnaud wrote: > For what it's worth, Ocaml uses the fact that pointers are word-aligned > (hence even numbers) to let the gc distinguish between unboxed values and > pointers: 63-bit integers are made odd by representing n as (2n+1). > > But GHC also mak

Re: Pointer-or-Int 63-bit representations for Integer

2021-03-08 Thread Chris Done
Hi all, I did a trivial test, in case anybody's interested, in the unboxed sum idea approach, only considering the Int# branch. https://gist.github.com/chrisdone/6aef640a49fc30b45ad210eac287dce9 It seems to be on par with Int, which is pretty cool because I wasn't sure what to expect. Assuming

Re: Pointer-or-Int 63-bit representations for Integer

2021-03-08 Thread Spiwack, Arnaud
For what it's worth, Ocaml uses the fact that pointers are word-aligned (hence even numbers) to let the gc distinguish between unboxed values and pointers: 63-bit integers are made odd by representing n as (2n+1). But GHC also makes use of the word-alignment of pointers: it is used for pointer tag