Wanted: 128 bit integers

Jonathan M Davis jmdavisProg at gmx.com
Wed Mar 14 11:19:57 PDT 2012


On Wednesday, March 14, 2012 17:51:49 Alex Rønne Petersen wrote:
> On 14-03-2012 17:49, Jonathan M Davis wrote:
> > On Wednesday, March 14, 2012 10:57:03 Manu wrote:
> >> On 14 March 2012 02:37, Alex Rønne Petersen<xtzgzorex at gmail.com> wrote:
> >>> On 14-03-2012 01:34, Paul D. Anderson wrote:
> >>> The D language specifies 128-bit integers: cent and ucent. They just
> >>> aren't implemented yet...
> >> 
> >> Why aren't they implemented in a library for the time being at least, so
> >> code can compile and work?
> > 
> > I believe that what it really comes down to is that cent and ucent were
> > set
> > aside just in case they would be needed with no specific plans to do
> > anything with them. So, they'll probably be implemented eventually, but
> > they're definitely not a priority. And if you really need larger
> > integers, then there's BigInt. Prior to the 64-bit ports of dmd (which
> > are fairly recent), dmd wasn't even on any architectures that supported
> > 128 bit integers anyway.
> > 
> > - Jonathan M Davis
> 
> There aren't really any platforms that natively support 128-bit
> integers, even today. The most "support" you'll get is SIMD-like
> extensions, but those aren't necessarily useful for implementing 128-bit
> integers.
> 
> So, most likely, the compiler would just have to unroll 128-bit
> operations just as it does for 64-bit operations on 32-bit targets.

long long is 128 bits on 64-bit Linux. That's what I meant by support. 32-bit 
doesn't have that with any C type on any platform that I know of. I have no 
idea how it's implemented though.

- Jonathan M Davis


More information about the Digitalmars-d mailing list