From patchwork Thu Jan 5 16:46:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dominik Vogt X-Patchwork-Id: 711485 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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tvYVg0dHXz9sXx for ; Fri, 6 Jan 2017 03:46:50 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Gj9lbYW4"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:reply-to:mime-version:content-type :message-id; q=dns; s=default; b=auZ9mn1/7wNZD3oU7PnfRe+3AZwCHed nKOUeXvgeFnt2IirqZrH25D1xMvV43Ki3WZn2gUL4e6tWNnydWxw+kIZ6P+uBaAB WeG3NTm7BfZVWuJc8OOdajP24cdobM0DkTnkBJQNhqlmR2R1CR59EG0ocTwwWwnN tLxQ0YQ1Q5x0= 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:date :from:to:cc:subject:reply-to:mime-version:content-type :message-id; s=default; bh=iZIZ4rtlUD9m6pxFD2Nf3vlwbfE=; b=Gj9lb YW4Z3lKh/v939uWCiDDlkSTE5/GIG4gamT9UaCuV6uPmUxWAfpeK7rFpHBXlPL3Q PPQ8uR1PQAFpK+oswKKg++GU/RHVdPOe5vxJs59Pu/2mG0xQnmxVvWDlb/swztRB 9BaY8v5wUyLx4FgJOPf7H1DpNXgt4G98C6TaeM= Received: (qmail 47994 invoked by alias); 5 Jan 2017 16:46:38 -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 47982 invoked by uid 89); 5 Jan 2017 16:46:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=U*vogt, sk:vogt@li, vogtlinuxvnetibmcom, vogt@linux.vnet.ibm.com X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 05 Jan 2017 16:46:36 +0000 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id v05GhpEW043084 for ; Thu, 5 Jan 2017 11:46:35 -0500 Received: from e06smtp08.uk.ibm.com (e06smtp08.uk.ibm.com [195.75.94.104]) by mx0b-001b2d01.pphosted.com with ESMTP id 27skxvt3gx-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 05 Jan 2017 11:46:34 -0500 Received: from localhost by e06smtp08.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 5 Jan 2017 16:46:33 -0000 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp08.uk.ibm.com (192.168.101.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 5 Jan 2017 16:46:32 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 4ECA01B08061; Thu, 5 Jan 2017 16:49:10 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v05GkVYa7864636; Thu, 5 Jan 2017 16:46:31 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6A46342041; Thu, 5 Jan 2017 15:44:29 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 385024204C; Thu, 5 Jan 2017 15:44:29 +0000 (GMT) Received: from oc5510024614.ibm.com (unknown [9.145.52.215]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 5 Jan 2017 15:44:29 +0000 (GMT) Received: by oc5510024614.ibm.com (Postfix, from userid 500) id 13B1F1AA61; Thu, 5 Jan 2017 17:46:51 +0100 (CET) Date: Thu, 5 Jan 2017 17:46:51 +0100 From: Dominik Vogt To: gcc-patches@gcc.gnu.org Cc: Segher Boessenkool Subject: [RFC] combine: Handle zero_extend without subreg in change_zero_ext. Reply-To: vogt@linux.vnet.ibm.com Mail-Followup-To: vogt@linux.vnet.ibm.com, gcc-patches@gcc.gnu.org, Segher Boessenkool MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-12-10) X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17010516-0032-0000-0000-000007026304 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17010516-0033-0000-0000-000022F9A627 Message-Id: <20170105164651.GA6294@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-01-05_10:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1701050254 The attached patch deals with another type of zero_extend that is not yet handled in change_zero_ext, i.e. (zero_extend (pseudoreg)), without a "subreg" in between. What do you think? (Mostly untested yet.) Ciao Dominik ^_^ ^_^ diff --git a/gcc/combine.c b/gcc/combine.c index e77f203..b5131b8 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -11372,6 +11372,16 @@ change_zero_ext_src (subrtx_ptr_iterator *piter) else if (GET_CODE (x) == ZERO_EXTEND && SCALAR_INT_MODE_P (mode) && REG_P (XEXP (x, 0)) + && !HARD_REGISTER_P (XEXP (x, 0)) + && GET_MODE_PRECISION (GET_MODE (XEXP (x, 0))) + < GET_MODE_PRECISION (mode)) + { + /* (zero_extract (reg)) -> (and (subreg (reg) 0) (const_int)) */ + x = gen_lowpart_SUBREG (mode, XEXP (x, 0)); + } + else if (GET_CODE (x) == ZERO_EXTEND + && SCALAR_INT_MODE_P (mode) + && REG_P (XEXP (x, 0)) && HARD_REGISTER_P (XEXP (x, 0)) && can_change_dest_mode (XEXP (x, 0), 0, mode)) {