From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16699 invoked by alias); 6 Oct 2012 11:13:21 -0000 Received: (qmail 16685 invoked by uid 22791); 6 Oct 2012 11:13:21 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 06 Oct 2012 11:13:14 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 678F229000A; Sat, 6 Oct 2012 13:13:25 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Z-AeMXIqiwO1; Sat, 6 Oct 2012 13:13:25 +0200 (CEST) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id A9524290007; Sat, 6 Oct 2012 13:13:24 +0200 (CEST) From: Eric Botcazou To: Richard Sandiford Cc: gcc-patches@gcc.gnu.org, Andrew Pinski , Uros Bizjak , Paul_Koning@dell.com, kkojima@gcc.gnu.org, aoliva@redhat.com, dje.gcc@gmail.com, uweigand@de.ibm.com, walt@tilera.com Subject: Re: RFA: Simplifying truncation and integer lowpart subregs Date: Sat, 06 Oct 2012 11:13:00 -0000 Message-ID: <6083166.IsGSDDFhFR@polaris> User-Agent: KMail/4.7.2 (Linux/3.1.10-1.16-desktop; KDE/4.7.2; x86_64; ; ) In-Reply-To: <87k3v3oq72.fsf_-_@talisman.home> References: <87bogkr7o2.fsf@talisman.home> <87k3v3oq72.fsf_-_@talisman.home> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 X-SW-Source: 2012-10/txt/msg00610.txt.bz2 > Tested on x86_64-linux-gnu, mipsisa32-elf and mipsisa64-elf. Also tested > by making sure that there were no code differences for a set of gcc .ii > files on gcc20 (-O2 -march=native). OK to install? Are you sure that generating TRUNCATEs out of nowhere in simplify_subreg is always correct? > gcc/ > * machmode.h (GET_MODE_UNIT_PRECISION): New macro. > * simplify-rtx.c (simplify_truncation): New function. You should say where it comes from. > (simplify_unary_operation_1): Use it. Remove sign bit test > for !TRULY_NOOP_TRUNCATION_MODES_P. (simplify_unary_operation_1) : ... > (simplify_subreg): Use simplify_int_lowpart for TRUNCATE. This function doesn't exist. And this is misleading, it's not just for TRUNCATE, it's for a truncation to the lowpart. > /* Try to simplify a unary operation CODE whose output mode is to be > MODE with input operand OP whose mode was originally OP_MODE. > Return zero if no simplification can be made. */ > @@ -689,12 +850,6 @@ simplify_unary_operation_1 (enum rtx_cod > op_mode = mode; > in2 = simplify_gen_unary (NOT, op_mode, in2, op_mode); > > - if (GET_CODE (in2) == NOT && GET_CODE (in1) != NOT) > - { > - rtx tem = in2; > - in2 = in1; in1 = tem; > - } > - > return gen_rtx_fmt_ee (GET_CODE (op) == IOR ? AND : IOR, > mode, in1, in2); > } Why is this hunk here? > @@ -5595,14 +5730,6 @@ simplify_subreg (enum machine_mode outer > return NULL_RTX; > } > > - /* Merge implicit and explicit truncations. */ > - > - if (GET_CODE (op) == TRUNCATE > - && GET_MODE_SIZE (outermode) < GET_MODE_SIZE (innermode) > - && subreg_lowpart_offset (outermode, innermode) == byte) > - return simplify_gen_unary (TRUNCATE, outermode, XEXP (op, 0), > - GET_MODE (XEXP (op, 0))); > - > /* SUBREG of a hard register => just change the register number > and/or mode. If the hard register is not valid in that mode, > suppress this simplification. If the hard register is the stack, Likewise. -- Eric Botcazou