From patchwork Wed Aug 28 16:45:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mike Stump X-Patchwork-Id: 270602 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "www.sourceware.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 1B5B32C00B7 for ; Thu, 29 Aug 2013 02:45:50 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; q=dns; s= default; b=tFhq+ItMXVaTkmhMeLFCssrfxwJXgXIp3CXYnE/lpmx7zK56b5iGq 3hhlUSSbWmTQcO6kpl7r0aAJ0Vt4EVbf9SWmEwjKO0LNgRsK8GHYJTjaYh9elIK2 nEcf+d9qtKlOh2+5lR1HV04rkMR0JIymDUznCR2uFQWtHBa+qjiiIQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=default; bh=mzxFnDDZHoundptNkHAQCI/MvhA=; b=mbkL8jhlrq1lvd1eo6EKGLsepfrJ n/y2DvOVNu9h0JoR4x+YyyQhR3cUVImkSSbK2iIWE1MVxreKURsApmdfggy1diUC hjbAwYMY4Zsp62a/63kxTeoePLyedCmEmWTRXnAAisiH143VEi+Gk7iTOHVgls/W +5j1W8PZWDSByNg= Received: (qmail 9835 invoked by alias); 28 Aug 2013 16:45:43 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 9825 invoked by uid 89); 28 Aug 2013 16:45:42 -0000 Received: from qmta15.emeryville.ca.mail.comcast.net (HELO qmta15.emeryville.ca.mail.comcast.net) (76.96.27.228) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 28 Aug 2013 16:45:42 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, KHOP_THREADED, RCVD_IN_DNSWL_NONE, RCVD_IN_HOSTKARMA_NO, RDNS_NONE, SPF_PASS autolearn=no version=3.3.2 X-HELO: qmta15.emeryville.ca.mail.comcast.net Received: from omta09.emeryville.ca.mail.comcast.net ([76.96.30.20]) by qmta15.emeryville.ca.mail.comcast.net with comcast id JFvn1m0060S2fkCAFGlgyZ; Wed, 28 Aug 2013 16:45:40 +0000 Received: from up.mrs.kithrup.com ([24.4.193.8]) by omta09.emeryville.ca.mail.comcast.net with comcast id JGlf1m01H0BKwT48VGlg7a; Wed, 28 Aug 2013 16:45:40 +0000 Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: wide-int branch now up for public comment and review From: Mike Stump In-Reply-To: Date: Wed, 28 Aug 2013 09:45:39 -0700 Cc: Richard Sandiford , Kenneth Zadeck , gcc-patches Message-Id: <13426B61-E40A-4B54-AAFD-691AE4735820@comcast.net> References: <520A9DCC.6080609@naturalbridge.com> <87ppt4e9hg.fsf@talisman.default> <878uzmp2lg.fsf@sandifor-thinkpad.stglab.manchester.uk.ibm.com> <87y57mnjjk.fsf@sandifor-thinkpad.stglab.manchester.uk.ibm.com> <871u5ec836.fsf@talisman.default> To: Richard Biener On Aug 28, 2013, at 5:48 AM, Richard Biener wrote: >> Only if the precision is > HOST_BITS_PER_WIDE_INT. If the precision >> is HOST_BITS_PER_WIDE_INT then both are { -1U }. > > That wasn't my understanding on how things work. You are thinking about prec==0 numbers. These are useful and important for ease of use of the wide-int package. They allow one to do: wide_int w = …; w = w + 6; w = w - 3; w = w + (unsigned HOST_WIDE_INT)~0; and extend the constant out to the precision of the other side. This is a very narrow feature and not a general property of a wide_int. In general, signedness of a wide_int is an external feature of wide_int. We only permit prec==0 numbers for ease of use, and ease of use needs to track the sign, in the general case. Now, one is free to have a precision that allows the sign to be stored, this is available to the user, if they want. They merely are not forced to do this. For example, RTL largely doesn't want or need a sign. >> Right, that's what the constructors, from_* and to_* routines do. > > I wonder where the from_tree and to_tree ones are? tree t; wide_int w = t; wide_int_to_tree needs an additional type, so, the spelling is not as short out of necessity. > Are they > from_double_int / wide_int_to_tree (what's wide_int_to_infinite_tree?) I think wide_int_to_infinite_tree is leftover junk. I removed it: diff --git a/gcc/wide-int.h b/gcc/wide-int.h index 86be20a..83c2170 100644 --- a/gcc/wide-int.h +++ b/gcc/wide-int.h @@ -4203,8 +4203,6 @@ wide_int_ro::to_shwi2 (HOST_WIDE_INT *s ATTRIBUTE_UNUSED, /* tree related routines. */ extern tree wide_int_to_tree (tree type, const wide_int_ro &cst); -extern tree wide_int_to_infinite_tree (tree type, const wide_int_ro &cst, - unsigned int prec); extern tree force_fit_type_wide (tree, const wide_int_ro &, int, bool); /* real related routines. */