The future of Int128 support in D language

Patrick Schluter Patrick.Schluter at bbox.fr
Mon Jan 9 18:10:43 UTC 2023


On Monday, 9 January 2023 at 16:51:45 UTC, Iain Buclaw wrote:
> On Sunday, 8 January 2023 at 17:36:07 UTC, Johan wrote:
>> [...]
>
> Actually, I had implemented core.int128 as compiler-recognized 
> intrinsics that do the necessary conversion to/from native on 
> the fly.
>
> I ran into some problems when testing this on SPARC though (to 
> name one non-x86 target that I use for sanity checking new 
> code-gen features).  Never found the time to get to the bottom 
> of what was causing it to crash, so left it as a TBD patch set.
>
> I suspect I am going wrong somewhere with all the concatenated 
> `*cast(cent*)&c` and `*cast(core.int128.Cent*)&c` going on all 
> around the place when you chain these functions together with 
> UFCS.  Maybe should investigate using a `union` instead, but 
> not enough bandwidth to do that at the moment.

SPARC is big endian. Probably somewhere an intermediate value 
that is truncated to 64 bits which passes in LE but not in BE.
Talking completely out of my a.s. :-)


More information about the Digitalmars-d mailing list