From patchwork Wed Jun 29 20:43:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Meissner X-Patchwork-Id: 642203 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 3rfvmN0RjYz9sf9 for ; Thu, 30 Jun 2016 06:44:19 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=T15O3uZh; 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:references:mime-version:content-type :in-reply-to:message-id; q=dns; s=default; b=ecXgquBU3pLUeAnZCSM eeayKsSdFRKOUBSiW9IP7MAbbw8ffwTnu1E8hWM1Q1mwTQ9LZ8LA/HV8xtomanN+ tIqPWZsOc7up1QXYUlU+e3OGkAImiBc2dqw4RIIGPCKiOQjyUWjBjS+UGG2V4x1x UrzidnazLK/ruvdFdKknol5o= 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:references:mime-version:content-type :in-reply-to:message-id; s=default; bh=Yok5Wr/VWr91nYfng1dv1mupP qM=; b=T15O3uZhZ7zIgxRuzro7SZBL/Mw9/ohvrUf//nHAIso3megKCw4vbiEEj dl+HP3OOgshrrsCdNqsPAicdUl4TPn6RTV4vAdTYMz58cDGJu3z3DYphnMMLuBcU 4AWMjhN/mpkIdpObDbtNp/R24COp4t0n34FCRLHOsJkYH0R/d4= Received: (qmail 83641 invoked by alias); 29 Jun 2016 20:44:12 -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 83584 invoked by uid 89); 29 Jun 2016 20:44:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.1 required=5.0 tests=AWL, BAYES_50, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=UD:p9-extract-2.c, extract_schar_0, vextractub, stxsibx 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 (AES256-SHA encrypted) ESMTPS; Wed, 29 Jun 2016 20:44:06 +0000 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u5TKhUhX144012 for ; Wed, 29 Jun 2016 16:44:04 -0400 Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.150]) by mx0a-001b2d01.pphosted.com with ESMTP id 23uuhu6vkd-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 29 Jun 2016 16:44:04 -0400 Received: from localhost by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 29 Jun 2016 14:44:03 -0600 Received: from d03dlp03.boulder.ibm.com (9.17.202.179) by e32.co.us.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 29 Jun 2016 14:44:00 -0600 X-IBM-Helo: d03dlp03.boulder.ibm.com X-IBM-MailFrom: meissner@ibm-tiger.the-meissners.org Received: from b03cxnp08025.gho.boulder.ibm.com (b03cxnp08025.gho.boulder.ibm.com [9.17.130.17]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 40FF219D8048; Wed, 29 Jun 2016 14:43:38 -0600 (MDT) Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u5TKi0BG45482146; Wed, 29 Jun 2016 13:44:00 -0700 Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 220186A03D; Wed, 29 Jun 2016 14:44:00 -0600 (MDT) Received: from ibm-tiger.the-meissners.org (unknown [9.32.77.111]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP id E8C1D6A03F; Wed, 29 Jun 2016 14:43:59 -0600 (MDT) Received: by ibm-tiger.the-meissners.org (Postfix, from userid 500) id 3925245D0E; Wed, 29 Jun 2016 16:43:59 -0400 (EDT) Date: Wed, 29 Jun 2016 16:43:59 -0400 From: Michael Meissner To: Michael Meissner , gcc-patches@gcc.gnu.org, Segher Boessenkool , David Edelsohn , Bill Schmidt Subject: Re: [PATCH], Add PowerPC ISA 3.0 vector extract support Mail-Followup-To: Michael Meissner , gcc-patches@gcc.gnu.org, Segher Boessenkool , David Edelsohn , Bill Schmidt References: <20160629193324.GA7321@ibm-tiger.the-meissners.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160629193324.GA7321@ibm-tiger.the-meissners.org> User-Agent: Mutt/1.5.20 (2009-12-10) X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16062920-0004-0000-0000-00000FCDFD03 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16062920-0005-0000-0000-000076A37987 Message-Id: <20160629204358.GA21819@ibm-tiger.the-meissners.org> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-06-29_11:, , 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-1604210000 definitions=main-1606290192 X-IsSubscribed: yes On Wed, Jun 29, 2016 at 03:33:24PM -0400, Michael Meissner wrote: > This patch adds support to generate the ISA 3.0 VEXTRACTUB, VEXTRACTUH, and > XXEXTRACTUW instructions to extract a constant element from the small vector > integer types. I also added support to generate STXSIWX if a DImode is in an > Altivec register (which is needed for this patch when extracting char or short > elements). > > I built this on a little endian power8 system, and there were no regressions in > make check. Is it ok to install in the trunk? Note, I discovered that the second test (p9-extract-2.c) had the wrong number of '\'s for the alternative, and it would fail. This is the correct patch. Sorry about that. Index: gcc/testsuite/gcc.target/powerpc/p9-extract-2.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/p9-extract-2.c (.../svn+ssh://meissner@gcc.gnu.org/svn/gcc/trunk/gcc/testsuite/gcc.target/powerpc) (revision 0) +++ gcc/testsuite/gcc.target/powerpc/p9-extract-2.c (.../gcc/testsuite/gcc.target/powerpc) (revision 237858) @@ -0,0 +1,27 @@ +/* { dg-do compile { target { powerpc64*-*-* && lp64 } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-options "-mcpu=power9 -O2" } */ + +#include + +void extract_int_0 (int *p, vector int a) { *p = vec_extract (a, 0); } +void extract_int_3 (int *p, vector int a) { *p = vec_extract (a, 3); } + +void extract_short_0 (short *p, vector short a) { *p = vec_extract (a, 0); } +void extract_short_3 (short *p, vector short a) { *p = vec_extract (a, 7); } + +void extract_schar_0 (signed char *p, vector signed char a) { *p = vec_extract (a, 0); } +void extract_schar_3 (signed char *p, vector signed char a) { *p = vec_extract (a, 15); } + +/* { dg-final { scan-assembler "vextractub" } } */ +/* { dg-final { scan-assembler "vextractuh" } } */ +/* { dg-final { scan-assembler "xxextractuw" } } */ +/* { dg-final { scan-assembler "stxsibx" } } */ +/* { dg-final { scan-assembler "stxsihx" } } */ +/* { dg-final { scan-assembler "stfiwx\|stxsiwx" } } */ +/* { dg-final { scan-assembler-not "mfvsrd" } } */ +/* { dg-final { scan-assembler-not "stxvd2x" } } */ +/* { dg-final { scan-assembler-not "stxv" } } */ +/* { dg-final { scan-assembler-not "lwa" } } */ +/* { dg-final { scan-assembler-not "stw" } } */