From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20167 invoked by alias); 21 Feb 2006 23:04:44 -0000 Received: (qmail 20146 invoked by uid 22791); 21 Feb 2006 23:04:41 -0000 X-Spam-Check-By: sourceware.org Received: from atrey.karlin.mff.cuni.cz (HELO atrey.karlin.mff.cuni.cz) (195.113.31.123) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 21 Feb 2006 23:04:40 +0000 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 29025) id 90F114B408B; Wed, 22 Feb 2006 00:04:37 +0100 (CET) Date: Tue, 21 Feb 2006 23:04:00 -0000 From: Zdenek Dvorak To: Richard Henderson , Roger Sayle , Paolo Bonzini , gcc-patches@gcc.gnu.org Subject: Re: Patch ping Message-ID: <20060221230437.GA4783@atrey.karlin.mff.cuni.cz> References: <20060221091531.GA26781@atrey.karlin.mff.cuni.cz> <20060221154317.GA27569@atrey.karlin.mff.cuni.cz> <20060221180114.GA16778@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060221180114.GA16778@redhat.com> User-Agent: Mutt/1.5.9i Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2006-02/txt/msg01721.txt.bz2 Hello, > On Tue, Feb 21, 2006 at 04:43:17PM +0100, Zdenek Dvorak wrote: > > yes, this is about the only real advantage of the representation (b). > > The fact that rtl uses (b) for its const_int lends support for using > that representation elsewhere. It's surely less confusing to have > one rule instead of two. rtl (function immed_double_const) usses the following rules: the function takes two HOST_WIDE_INTs i0 and i1 (where i1 corresponds to higher bits). Let w be precision of the mode of the constructed constant, and s the sign bit of the represented number (i.e. the one at position 1 << (w - 1)). If w <= HOST_BITS_PER_WIDE_INT, the functions returns just CONST_INT, not CONST_DOUBLE. In this case, rule (b) -- filling bits above w with s -- is used. Suppose now w > HOST_BITS_PER_WIDE_INT. If i1 == 0 and i0 >=0, or i1 == -1 and i1 < 0, we return CONST_INT for i0, anyway. Otherwise, the components i0 and i1 are put into the constant unchanged. In particular, this means that the rtl semantics allows multiple representations for the same number, in case HOST_BITS_PER_WIDE_INT < w < 2 * HOST_BITS_PER_WIDE_INT. I do not really have very strong preferences whether to use semantics (a) or (b), as long as we do not use the semantics we use for rtl :-) I slightly prefer (a), as 1) normalization is slightly simpler 2) it is the more senseful one if the components of double_int are manipulated as unsigned numbers (which I prefer as it makes it less likely to run into problems with undefined semantics of overflow for signed types). Zdenek