From patchwork Fri Feb 24 17:44:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pat Haugen X-Patchwork-Id: 732203 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 3vVJR36389z9s7D for ; Sat, 25 Feb 2017 04:45:18 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="u4IZF5HP"; 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:from :subject:to:cc:date:mime-version:content-type:message-id; q=dns; s=default; b=dpMRKOeyEdQtGf3c5TAHsxZnaD14QbUg7BK7oIimRLT69UI+8z bscTSvsdMi2OsoQoGeMLcWtRn7GY4hs0RZyNJ65XqcK7XThO233kAdiRmmN1HyJk zm2hxgC/sgwave+PcooscBI0wzY+fGydmSCr/pUXNGF0Lh+s2TpgKY9/o= 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:from :subject:to:cc:date:mime-version:content-type:message-id; s= default; bh=kRzU0okyqya4xlaB5EAbiA36og0=; b=u4IZF5HPQEKA7tsoV1Q2 dsiEynX2x/0QuvS/OQiE8l/yuGAoES+QiK2UK+Ms8FdPp4x4c6R0b3jjkM4yQLG3 YCkgYYqCD3JUsWu9sHhPJW0EG0blI8QetL+BUI6RcOJ9R7abUtoybPo6qufG3Nt5 VT3Dtf/hp9wZD/qGkjDQAUk= Received: (qmail 109544 invoked by alias); 24 Feb 2017 17:44:41 -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 109448 invoked by uid 89); 24 Feb 2017 17:44:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.8 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy= 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; Fri, 24 Feb 2017 17:44:38 +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 v1OHibjO103446 for ; Fri, 24 Feb 2017 12:44:37 -0500 Received: from e19.ny.us.ibm.com (e19.ny.us.ibm.com [129.33.205.209]) by mx0a-001b2d01.pphosted.com with ESMTP id 28thjbmjp2-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 24 Feb 2017 12:44:37 -0500 Received: from localhost by e19.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 24 Feb 2017 12:44:32 -0500 Received: from d01dlp02.pok.ibm.com (9.56.250.167) by e19.ny.us.ibm.com (146.89.104.206) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 24 Feb 2017 12:44:30 -0500 Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 01D666E803C; Fri, 24 Feb 2017 12:44:01 -0500 (EST) Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v1OHiTaV22347992; Fri, 24 Feb 2017 17:44:29 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B9648AE03B; Fri, 24 Feb 2017 12:44:26 -0500 (EST) Received: from oc1687012634.ibm.com (unknown [9.80.200.219]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP id 8B3D9AE056; Fri, 24 Feb 2017 12:44:26 -0500 (EST) From: Pat Haugen Subject: [PATCH rs6000] Fix PR79544 To: GCC Patches Cc: Segher Boessenkool , David Edelsohn Date: Fri, 24 Feb 2017 11:44:29 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17022417-0056-0000-0000-000002DB9D07 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006676; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000204; SDB=6.00826547; UDB=6.00404831; IPR=6.00603997; BA=6.00005171; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00014427; XFM=3.00000011; UTC=2017-02-24 17:44:31 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17022417-0057-0000-0000-00000710AC4C Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-02-24_12:, , 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-1702240170 X-IsSubscribed: yes The following patch fixes the problem of generating a logical shift for vec_sra of an unsigned v2di vector. Bootstrap/regtest on powerpc64le-unknown-linux-gnu with no new regressions. Ok for trunk? Ok for backport to 5/6 branches after testing? -Pat 2017-02-24 Pat Haugen PR target/79544 * rs6000/rs6000-c.c (struct altivec_builtin_types): Use VSRAD for arithmetic shift of unsigned V2DI. testsuite/ChangeLog: 2017-02-24 Pat Haugen * gcc.target/powerpc/pr79544.c: New. Index: config/rs6000/rs6000-c.c =================================================================== --- config/rs6000/rs6000-c.c (revision 245687) +++ config/rs6000/rs6000-c.c (working copy) @@ -2444,7 +2444,7 @@ const struct altivec_builtin_types altiv RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, { ALTIVEC_BUILTIN_VEC_SRA, P8V_BUILTIN_VSRAD, RS6000_BTI_V2DI, RS6000_BTI_V2DI, RS6000_BTI_unsigned_V2DI, 0 }, - { ALTIVEC_BUILTIN_VEC_SRA, P8V_BUILTIN_VSRD, + { ALTIVEC_BUILTIN_VEC_SRA, P8V_BUILTIN_VSRAD, RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, 0 }, { ALTIVEC_BUILTIN_VEC_VSRAW, ALTIVEC_BUILTIN_VSRAW, RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, @@ -5012,7 +5012,7 @@ const struct altivec_builtin_types altiv { P8V_BUILTIN_VEC_VSRAD, P8V_BUILTIN_VSRAD, RS6000_BTI_V2DI, RS6000_BTI_V2DI, RS6000_BTI_unsigned_V2DI, 0 }, - { P8V_BUILTIN_VEC_VSRAD, P8V_BUILTIN_VSRD, + { P8V_BUILTIN_VEC_VSRAD, P8V_BUILTIN_VSRAD, RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, 0 }, { P8V_BUILTIN_VEC_VSUBCUQ, P8V_BUILTIN_VSUBCUQ, Index: testsuite/gcc.target/powerpc/pr79544.c =================================================================== --- testsuite/gcc.target/powerpc/pr79544.c (nonexistent) +++ testsuite/gcc.target/powerpc/pr79544.c (working copy) @@ -0,0 +1,15 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ +/* { dg-options "-mcpu=power8 -O2" } */ + +#include + +vector unsigned long long +test_sra (vector unsigned long long x, vector unsigned long long y) +{ + return vec_sra (x, y); +} + +/* { dg-final { scan-assembler "vsrad" } } */ +