From patchwork Tue Mar 14 14:47:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Aaron Sawdey X-Patchwork-Id: 738746 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 3vjHfH0yWNz9ryv for ; Wed, 15 Mar 2017 01:48:06 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="PJ2JE9iT"; 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 :subject:from:to:cc:date:content-type:mime-version :content-transfer-encoding:message-id; q=dns; s=default; b=a2MOp 1PVSRYhkImIHDB01s9oOKFUMMbBQ1YmUTxki20/irc5agB6TUHtISeCLILLOmQca quFrMxNj0JSYEovinyVWf8hRhmTfrSsOi201g3l+a4ZypoNzfHhUUJCp7/J44Jkf MYm7cwNKMALJxf7eplJHeO+8m5wJaqry5zpRiQ= 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 :subject:from:to:cc:date:content-type:mime-version :content-transfer-encoding:message-id; s=default; bh=e+sgQ2R90s6 cVDy+ca9voTHLqbY=; b=PJ2JE9iTon5zSU1xlqAr3Tzdzm9lt6zvXAgzjwDi0Ba i4iHufM0KieZ6K70cwQLZ3Km4mrWOw4Ym9LrCG9HVB5KIf9dws+TY20vNCDoqsTl 9X8KNINFr9hpA/2wuJNNSlr/JCEKu1caqFU5EPg1C8iIMw89s5ouMLAuLzDtvGXY = Received: (qmail 79000 invoked by alias); 14 Mar 2017 14:47:57 -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 78982 invoked by uid 89); 14 Mar 2017 14:47:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.6 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.2 spammy=Hx-languages-length:1385 X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 14 Mar 2017 14:47:56 +0000 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v2EEZXQp071148 for ; Tue, 14 Mar 2017 10:47:55 -0400 Received: from e14.ny.us.ibm.com (e14.ny.us.ibm.com [129.33.205.204]) by mx0a-001b2d01.pphosted.com with ESMTP id 296gbdg70c-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 14 Mar 2017 10:47:54 -0400 Received: from localhost by e14.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 14 Mar 2017 10:47:53 -0400 Received: from b01cxnp22035.gho.pok.ibm.com (9.57.198.25) by e14.ny.us.ibm.com (146.89.104.201) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 14 Mar 2017 10:47:52 -0400 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v2EElpN561407332; Tue, 14 Mar 2017 14:47:51 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 74B4B112070; Tue, 14 Mar 2017 10:47:50 -0400 (EDT) Received: from ragesh3a (unknown [9.85.155.74]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP id E3CFB11205F; Tue, 14 Mar 2017 10:47:49 -0400 (EDT) Subject: [PATCH][PR target/79752] fix rs6000 power9 peephole2 for udiv/umod -- backported to gcc-6-branch From: Aaron Sawdey To: gcc-patches@gcc.gnu.org Cc: Segher Boessenkool , Bill Schmidt , meissner@gcc.gnu.org Date: Tue, 14 Mar 2017 09:47:45 -0500 Mime-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 17031414-0052-0000-0000-000001A0B442 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006781; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000206; SDB=6.00833724; UDB=6.00409356; IPR=6.00611381; BA=6.00005209; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00014646; XFM=3.00000013; UTC=2017-03-14 14:47:53 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17031414-0053-0000-0000-00004F1BE88B Message-Id: <1489502865.5885.1.camel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-03-14_08:, , 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-1702020001 definitions=main-1703140116 X-IsSubscribed: yes This showed up in power9 code for __divkf3 software float support and caused a divd to be emitted where we needed a divdu. backported/bootstrapped/regtested to gcc-6-branch 2017-03-14  Aaron Sawdey   Backport from mainline 2017-02-28  Aaron Sawdey   PR target/79752         * config/rs6000/rs6000.md (peephole2 for udiv/umod): Should emit         udiv rather than div since input pattern is unsigned. Index: gcc/config/rs6000/rs6000.md =================================================================== --- gcc/config/rs6000/rs6000.md (revision 246123) +++ gcc/config/rs6000/rs6000.md (working copy) @@ -3063,8 +3063,8 @@     && ! reg_mentioned_p (operands[3], operands[1])     && ! reg_mentioned_p (operands[3], operands[2])"    [(set (match_dup 0) -       (div:GPR (match_dup 1) -                (match_dup 2))) +       (udiv:GPR (match_dup 1) +                 (match_dup 2)))     (set (match_dup 3)         (mult:GPR (match_dup 0)                   (match_dup 2)))