From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10705 invoked by alias); 22 Aug 2014 05:15:53 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 10690 invoked by uid 89); 22 Aug 2014 05:15:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.9 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 22 Aug 2014 05:15:51 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7M5FkBU002579 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Aug 2014 01:15:47 -0400 Received: from greed.delorie.com (ovpn-113-60.phx2.redhat.com [10.3.113.60]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s7M5Fj8W010500 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 22 Aug 2014 01:15:46 -0400 Received: from greed.delorie.com (greed.delorie.com [127.0.0.1]) by greed.delorie.com (8.14.4/8.14.4) with ESMTP id s7M5FiKX007480; Fri, 22 Aug 2014 01:15:44 -0400 Received: (from dj@localhost) by greed.delorie.com (8.14.4/8.14.4/Submit) id s7M5Fhpa007479; Fri, 22 Aug 2014 01:15:43 -0400 Date: Fri, 22 Aug 2014 05:15:00 -0000 Message-Id: <201408220515.s7M5Fhpa007479@greed.delorie.com> From: DJ Delorie To: "Joseph S. Myers" CC: gcc-patches@gcc.gnu.org In-reply-to: (joseph@codesourcery.com) Subject: Re: __intN patch 3/5: main __int128 -> __intN conversion. References: <201408132211.s7DMBGBu016387@greed.delorie.com> <201408212123.s7LLNPIQ018746@greed.delorie.com> X-IsSubscribed: yes X-SW-Source: 2014-08/txt/msg02167.txt.bz2 > Maybe you need to refactor __glibcxx_digits so there is a version taking > the bitsize as an argument rather than using sizeof(T) * __CHAR_BIT__, but > that should be the only change needed to handle such types with the > existing macros. The bitsize macros should be the only ones needing > predefining to pass information to libstdc++. Like this? #define __glibcxx_signed_b(T,B) ((T)(-1) < 0) #define __glibcxx_min_b(T,B) \ (__glibcxx_signed_b (T,B) ? -__glibcxx_max_b (T,B) - 1 : (T)0) #define __glibcxx_max_b(T,B) \ (__glibcxx_signed_b (T,B) ? \ (((((T)1 << (__glibcxx_digits_b (T,B) - 1)) - 1) << 1) + 1) : ~(T)0) #define __glibcxx_digits_b(T,B) \ (B - __glibcxx_signed_b (T,B)) // The fraction 643/2136 approximates log10(2) to 7 significant digits. #define __glibcxx_digits10_b(T,B) \ (__glibcxx_digits_b (T,B) * 643L / 2136) #define __glibcxx_signed(T) \ __glibcxx_signed_b (T, sizeof(T) * __CHAR_BIT__) #define __glibcxx_min(T) \ __glibcxx_min (T, sizeof(T) * __CHAR_BIT_) #define __glibcxx_max(T) \ __glibcxx_max (T, sizeof(T) * __CHAR_BIT_) #define __glibcxx_digits(T) \ __glibcxx_digits (T, sizeof(T) * __CHAR_BIT_) #define __glibcxx_digits10(T) \ __glibcxx_digits10 (T, sizeof(T) * __CHAR_BIT_)