From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14547 invoked by alias); 17 Jun 2009 00:28:52 -0000 Received: (qmail 14539 invoked by uid 22791); 17 Jun 2009 00:28:52 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_41,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 17 Jun 2009 00:28:44 +0000 Received: from wpaz1.hot.corp.google.com (wpaz1.hot.corp.google.com [172.24.198.65]) by smtp-out.google.com with ESMTP id n5H0SgpF027568 for ; Tue, 16 Jun 2009 17:28:42 -0700 Received: from wa-out-1112.google.com (wagm34.prod.google.com [10.114.214.34]) by wpaz1.hot.corp.google.com with ESMTP id n5H0SdL8022559 for ; Tue, 16 Jun 2009 17:28:39 -0700 Received: by wa-out-1112.google.com with SMTP id m34so1350425wag.26 for ; Tue, 16 Jun 2009 17:28:39 -0700 (PDT) Received: by 10.115.89.18 with SMTP id r18mr14534165wal.111.1245198519208; Tue, 16 Jun 2009 17:28:39 -0700 (PDT) Received: from localhost.localdomain.google.com ([67.218.105.128]) by mx.google.com with ESMTPS id n30sm9220651wag.41.2009.06.16.17.28.37 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 16 Jun 2009 17:28:38 -0700 (PDT) To: Adam Nemet Cc: gcc@gcc.gnu.org, law@redhat.com Subject: Re: Rationale for an old TRUNCATE patch References: <19000.8283.533096.76324@ropi.home> From: Ian Lance Taylor Date: Wed, 17 Jun 2009 00:28:00 -0000 In-Reply-To: <19000.8283.533096.76324@ropi.home> (Adam Nemet's message of "Tue\, 16 Jun 2009 15\:44\:43 -0700") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-06/txt/msg00385.txt.bz2 Adam Nemet writes: > Ian Lance Taylor writes: >> I agree that this patch looks wrong in todays compiler. There should be >> no need to call TRULY_NOOP_TRUNCATION if you are in a TRUNCATE anyhow. > > Thanks. > > Do you think we can assume this for TRUNCATEs in general or only for MIPS-like > TRUNCATEs? truncate has a machine independent meaning. > I can't think of why it would be useful to represent a mode so that bits > outside the mode mask don't either depent on bits inside the mask or are > don't-care bits. IOW, can we assume that for any TRUNCATE from wider mode W > to narrower mode N the following holds: > > (truncate:N expr:W) == (truncate:N (and:W expr:W GET_MODE_MASK(Nmode))) > > ? Where == is not necessarily identical bit representation of the object > holding the value (e.g. QI HI values in MIPS) but that they are > indistinguishable in the operations that are defined on them. Yes. The bits in Nmode's mask are determined by the truncate. The other bits are don't-care. If the result of the truncate happens to wind up in a register, then in some cases PROMOTE_MODE will apply. Ian