From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 9158 invoked from network); 31 May 2023 14:30:14 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 31 May 2023 14:30:14 -0000 Received: (qmail 22178 invoked by uid 550); 31 May 2023 14:30:12 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 22125 invoked from network); 31 May 2023 14:30:11 -0000 Date: Wed, 31 May 2023 10:29:59 -0400 From: Rich Felker To: Jens Gustedt Cc: musl@lists.openwall.com Message-ID: <20230531142959.GC4163@brightrain.aerifal.cx> References: <1c8e850ed3190af39b9e3f501d79899d438e7292.1685536608.git.Jens.Gustedt@inria.fr> <20230531142743.GB4163@brightrain.aerifal.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230531142743.GB4163@brightrain.aerifal.cx> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] [C23 128 bit 4/4] C23: implement proper support for int128_t and uint128_t On Wed, May 31, 2023 at 10:27:44AM -0400, Rich Felker wrote: > On Wed, May 31, 2023 at 04:15:50PM +0200, Jens Gustedt wrote: > > By implementing support for w128 length specifiers for printf and > > scanf, the only final bit that we need to be able to support these > > types officially as extended integer type and map them to the > > fixed-width types are the integer literals. In C23, the new types > > `_IntBit(N)` and their literals are mandatory. Most commonly they will > > support N >= 128. The maximum value for N can be queried with > > `BITINT_MAXWIDTH`. If we have such literals, use them to construct the > > constants for `[U]INT128_C` and provide the rest of the macros for > > these types. > > Unless the rules in C23 changed, I don't think yoou can define uintN_t > where N is larger than width of intmax_t; these can only be accessible > as _BitInt types not intN_t. (This was the whole reason _BitInt was > added, no?) And, as I'm reading it, this also means printf and scanf do not need to support w128. 7.23.6.1 ΒΆ7: "All minimum-width integer types (7.22.1.2) and exact-width integer types (7.22.1.1) de- fined in the header shall be supported. Other supported values of N are implementation-defined." Rich