From patchwork Thu Jan 26 01:03:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Meissner X-Patchwork-Id: 719921 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 3v83ZX2tM8z9sR9 for ; Thu, 26 Jan 2017 12:03:31 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="o8rIqMkM"; 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:subject:mime-version:content-type:message-id; q=dns; s= default; b=ZO8G8IQMURz36GdZFcfCqbB2qovOichiu6bMg0nzp0ugt3o+hXcG7 gpdvSDsMp3fWmd/ou+G4gvk49f7l5w+AYbtO1MG/axulv5ONsz3cysFmE1mQPz8P Gn4q+kzvn0UBBBHFIBjCU7VKcBPyVGCmCdtAQu8hJCZ+MqbMBU4cx8= 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:subject:mime-version:content-type:message-id; s= default; bh=BpBgxogiQx8pu49XXnCthQNj+Vs=; b=o8rIqMkM59zA/36s3ob+ 0yTwsCnZeVw04QrcqaMSc232nSdXWJCXITUVfoT03ESxlOaEEYKFCwZBG8sK9fEd 7OVP/VtGABPOdS7UxX5nLHSM1t2tc+IspcrnBOCWSiKIEYP4EljYUm9NL367Ciql VicvjeQCd9ad2AijaXRSBHc= Received: (qmail 58725 invoked by alias); 26 Jan 2017 01:03:21 -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 58713 invoked by uid 89); 26 Jan 2017 01:03:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=AWL, BAYES_00, KAM_ASCII_DIVIDERS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=King, sk:meissne, U*meissner, king 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, 26 Jan 2017 01:03:10 +0000 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v0Q0wTme113673 for ; Wed, 25 Jan 2017 20:03:08 -0500 Received: from e17.ny.us.ibm.com (e17.ny.us.ibm.com [129.33.205.207]) by mx0a-001b2d01.pphosted.com with ESMTP id 2871dxu7mp-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 25 Jan 2017 20:03:08 -0500 Received: from localhost by e17.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 25 Jan 2017 20:03:07 -0500 Received: from d01dlp02.pok.ibm.com (9.56.250.167) by e17.ny.us.ibm.com (146.89.104.204) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 25 Jan 2017 20:03:05 -0500 Received: from b01cxnp23032.gho.pok.ibm.com (b01cxnp23032.gho.pok.ibm.com [9.57.198.27]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 733456E803C; Wed, 25 Jan 2017 20:02:37 -0500 (EST) Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v0Q135Qn16843254; Thu, 26 Jan 2017 01:03:05 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0AE5EAE052; Wed, 25 Jan 2017 20:03:05 -0500 (EST) Received: from ibm-tiger.the-meissners.org (unknown [9.32.77.111]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP id E3A35AE04E; Wed, 25 Jan 2017 20:03:04 -0500 (EST) Received: by ibm-tiger.the-meissners.org (Postfix, from userid 500) id 63569473EE; Wed, 25 Jan 2017 20:03:04 -0500 (EST) Date: Wed, 25 Jan 2017 20:03:04 -0500 From: Michael Meissner To: gcc-patches@gcc.gnu.org, Segher Boessenkool , David Edelsohn , Bill Schmidt Subject: [PATCH], Fix PR target/79179, wrong constraint for power9 Mail-Followup-To: Michael Meissner , gcc-patches@gcc.gnu.org, Segher Boessenkool , David Edelsohn , Bill Schmidt 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: 17012601-0040-0000-0000-00000275F326 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006499; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000200; SDB=6.00812724; UDB=6.00396390; IPR=6.00590142; BA=6.00005090; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00014050; XFM=3.00000011; UTC=2017-01-26 01:03:07 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17012601-0041-0000-0000-00000668F2F8 Message-Id: <20170126010303.GA20850@ibm-tiger.the-meissners.org> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-01-25_17:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1701260008 X-IsSubscribed: yes This patch fixes the wrong constraint (o instead of wY) for a STXSD instruction on a vector extract operation that is optimizd to do a store if the element being extracted is in the right position. I have built a compiler with/with out the patch on a little endian power8 system. The runs finished with no regressions. Can I check it into trunk? [gcc] 2017-01-25 Michael Meissner PR target/79179 * config/rs6000/vsx.md (vsx_extract__store): Use wY constraint instead of o for the stxsd instruction. [gcc/testsuite] 2017-01-25 Michael Meissner PR target/79179 * gcc.target/powerpc/pr79179.c: New test. Index: gcc/config/rs6000/vsx.md =================================================================== --- gcc/config/rs6000/vsx.md (revision 244906) +++ gcc/config/rs6000/vsx.md (working copy) @@ -2323,7 +2323,7 @@ (define_insn_and_split "*vsx_extract__store" - [(set (match_operand: 0 "memory_operand" "=m,Z,o") + [(set (match_operand: 0 "memory_operand" "=m,Z,wY") (vec_select: (match_operand:VSX_D 1 "register_operand" "d,wv,wb") (parallel [(match_operand:QI 2 "vsx_scalar_64bit" "wD,wD,wD")])))] Index: gcc/testsuite/gcc.target/powerpc/pr79179.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/pr79179.c (revision 0) +++ gcc/testsuite/gcc.target/powerpc/pr79179.c (revision 0) @@ -0,0 +1,23 @@ +/* { dg-do assemble { target { powerpc*-*-* && lp64 } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-options "-mcpu=power9 -O3" } */ + +/* Compile with -O3 -mcpu=power9. It originally generated + + stxsd 12,1(9) + + which is illegal. */ + +#pragma pack(1) +struct { + signed : 1; + unsigned long a; +} b; + +void c(void) +{ + b.a = 0; + for (; b.a <= 45; b.a = (long)b.a + 1) + ; +}