Newsgroups: comp.arch Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border1.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!kithrup.com!mrs From: mrs@kithrup.com (Mike Stump) Subject: Re: The freedom that give us C++ and C Message-ID: Date: Sat, 6 Feb 2016 11:53:47 GMT References: Organization: Kithrup Enterprises, Ld. X-Newsreader: trn 4.0-test77 (Sep 1, 2010) Lines: 60 X-Received-Bytes: 3277 X-Received-Body-CRC: 1504021327 Xref: csiph.com comp.arch:33514 In article , David Brown wrote: >> Wait, you mean like this: >> >> https://gcc.gnu.org/onlinedocs/gcc/_005f_005fint128.html >> >> That isn't the right question, the right question is, why the heck >> don't we _always_ do this on every machine? Because we're exceedingly >> lazy or no one has contributed it yet, you're choice. >> > >Yes, it is exactly the __int128 type I was referring to. gcc >supports this in some ways, but not as a full extended integer,>and >not as int128_t and uint128_t types (except on platforms with 128-bit >longs or long longs). I was wondering if there was a particular >reason for this. Ah, well, the straw that breaks the camels back is that the standard says: 7.18.1.5 Greatest-width integer types 1 The following type designates a signed integer type capable of representing any value of any signed integer type: intmax_t The following type designates an unsigned integer type capable of representing any value of any unsigned integer type: uintmax_t These types are required. and once you do that, and have a binary abi that can't change, you can _never_ introduce a larger type and remain compatibility.[1] This complicates things. Designed to loose. Either, you have to break binary compatibility, or, you have to have it beyond the standard (beyond the range of intmax_t). Also, printf/scanf usually won't work with it, as there isn't a % to go with it and since it is larger than intmax, you can't use intmax to print either. And last, stdint.h is provided by the c library, and they get to decide to vend the type, or not, as they wish. gcc isn't a c library. If the system libc does vend a type, they do things like: typedef __uint64_t uint64_t; which uses the gcc name space and appears in the library name space, that type. > "No one has taken the time or effort to fully implement it - few >people are asking for the feature, so it is a low priority" is a >perfectly reasonable answer. It would perhaps be more /interesting/ to >have some technical reason, or chicken-and-egg problems (we can't make >it an extended integer until glibc supports it in printf, and glibc >can't support it until it is an extended integer). But "no one has had >the need or interest" is fine. Since I don't do any libcs (well, except for my port, in my port, I've not bothered to wire it because I'm lazy, but it library upstream had it, I would just have used it), I'm the wrong person to ask. Breaking >defind abi's is mostly likely the reason I suspect. 1 - https://gcc.gnu.org/PR49595