The future of Int128 support in D language

Siarhei Siamashka siarhei.siamashka at gmail.com
Sun Jan 8 03:11:15 UTC 2023


Hello,

Will it ever turn into a native integer type nicely supported by 
the language? What about 128-bit integer literals? Also unsigned 
128-bit type? Implicit conversions between `int` and `Int128`? Is 
interoperability with the other parts of Phobos planned? I mean, 
it would be great if things like this worked:

```D
import std.int128, std.stdio, std.conv;

void main() {
   Int128 x;
   x = 123;
   writefln!"x = %d"(x);
   writeln(x.to!int);
}
```

I'm posting this because I tried to experiment with Int128 in 
https://github.com/ssvb/speedy-int128 and see that performance 
parity with Clang can be easily achieved for LDC after applying a 
few minor tweaks.

What's the best way to get some inline LLVM IR optimizations for 
Int128 included in the next release of LDC? So that it works fast 
out of the box. The struct alignment is causing some troubles 
though.


More information about the Digitalmars-d mailing list