home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c      Meh, in C you gotta define EVERYTHING      243,242 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 242,259 of 243,242   
   David Brown to Keith Thompson   
   Re: _BitInt(N)   
   30 Nov 25 12:07:15   
   
   From: david.brown@hesbynett.no   
      
   On 30/11/2025 02:32, Keith Thompson wrote:   
   > Philipp Klaus Krause  writes:   
   >> Am 23.11.25 um 16:06 schrieb Michael S:   
   >>> Upper limit is implementation-defined.   
   >>> On both existing implementations the limit (on 64-bit targets) appears   
   >>> to be 2**16 or  2**16-1. I don't remember which one.   
   >   
   > Recent versions of gcc have BITINT_MAXWIDTH == 65535.   
   >   
   > llvm/clang has BITINT_MAXWIDTH == 8388608 (2**23) (and some serious   
   > performance problems with multiplication and division for large _BitInt   
   > types).   
   >   
   >> Thisis comp.lang.c, not comp.lang.c++. There still are implementations   
   >> of C other than GCC and clang. E.g. SDCC has a limit of 64.   
   >   
   > I didn't see any references to C++ in the parent article.  But it's   
   > interesting that SDCC support _BitInt.   
   >   
      
   It is also worth remembering that gcc does /not/ as yet support _BitInt   
   on most targets.  AFAIK, it only supports them on x86 and AArch64.   
      
   I think it is disappointing that the C23 standard allows BITINT_MAXWIDTH   
   to be as low as the bit-width of "long long int" (typically 64 bits).  I   
   do see _BitInt of 64-bit and less being useful, but I would like to be   
   able to use larger sizes without worrying about portability.  The gcc   
   limit is, I think, more than sufficient for realistic usage (though it I   
   think a power of two size makes more sense than one less than a power of   
   two).  Obviously the type of targets SDCC supports could not practically   
   support huge _BitInt's anyway - typically they have ram of only a few KB.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca