From patchwork Fri Sep 15 15:06:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: will schmidt X-Patchwork-Id: 814319 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-462252-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Reeu3VK6"; dkim-atps=neutral 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 3xtzJg4tqCz9sBZ for ; Sat, 16 Sep 2017 01:06:58 +1000 (AEST) 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:reply-to:to:cc:content-type:date:mime-version :content-transfer-encoding:message-id; q=dns; s=default; b=SHWqP tvHtWYbUVCM/PkvqLa+OynGIoaS4VwsLebEAE4X4uiec3YeaomRcNbfPE9+lkwuS 0YLzLiYKyDRiFtCjoDFr0S0kTkvWWdhUOZWIII+6Uxu0QG12T8qDmQ/Pzhg7q+0W zzBX6ynkaYRKz1NEc7A0M+G9EpA4n59R15vdu4= 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:reply-to:to:cc:content-type:date:mime-version :content-transfer-encoding:message-id; s=default; bh=VspupjjFwGH B9GTBqltepXoE84A=; b=Reeu3VK6MRubnntjZpY/d0fXNy5fPyXk9APe+gljuTV 0HfH/paonFUPSSYvslydhHud5XdzXM1ZMFR3lumtMZygwOTU9ptr/HfDE61esT1n ScGoQiTdAB4z1u9kahxB87aMh02JKuBCgwdz0HzeC168CQlors4xJ3nzCHFYyPo4 = Received: (qmail 29882 invoked by alias); 15 Sep 2017 15:06:50 -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 28958 invoked by uid 89); 15 Sep 2017 15:06:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS 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, 15 Sep 2017 15:06:47 +0000 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v8FF5VJ5099391 for ; Fri, 15 Sep 2017 11:06:46 -0400 Received: from e18.ny.us.ibm.com (e18.ny.us.ibm.com [129.33.205.208]) by mx0b-001b2d01.pphosted.com with ESMTP id 2d0fxk406a-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 15 Sep 2017 11:06:45 -0400 Received: from localhost by e18.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 15 Sep 2017 11:06:45 -0400 Received: from b01cxnp23033.gho.pok.ibm.com (9.57.198.28) by e18.ny.us.ibm.com (146.89.104.205) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 15 Sep 2017 11:06:42 -0400 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v8FF6fGX66191422; Fri, 15 Sep 2017 15:06:41 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 15861AC046; Fri, 15 Sep 2017 11:07:12 -0400 (EDT) Received: from [9.10.86.107] (unknown [9.10.86.107]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP id CAC02AC043; Fri, 15 Sep 2017 11:07:11 -0400 (EDT) Subject: [PATCH, rs6000] gimple folding vector load test variant From: Will Schmidt Reply-To: will_schmidt@vnet.ibm.com To: GCC Patches Cc: Segher Boessenkool , Richard Biener , Bill Schmidt , David Edelsohn Date: Fri, 15 Sep 2017 10:06:40 -0500 Mime-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 17091515-0044-0000-0000-0000038FF9AC X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007743; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000229; SDB=6.00917425; UDB=6.00460790; IPR=6.00697653; BA=6.00005589; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017168; XFM=3.00000015; UTC=2017-09-15 15:06:43 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17091515-0045-0000-0000-000007BEFAB2 Message-Id: <1505488000.26707.32.camel@brimstone.rchland.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-09-15_06:, , 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-1707230000 definitions=main-1709150220 X-IsSubscribed: yes Hi, This is a test created during investigation of the feedback on the rs6000 gimple vector folding code, regarding the handling of arg1_type. Inspired by feedback from Richard and Bill. This was useful to illustrate the issue to me. Whether this is a valid test for the testsuite I'll defer to the judgement of the maintainers.. :-) OK for trunk? [gcc/testsuite] 2017-09-15 Will Schmidt * gcc.target/powerpc/fold-vec-ld-misc.c: New. diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-ld-misc.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-ld-misc.c new file mode 100644 index 0000000..01069f6 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-ld-misc.c @@ -0,0 +1,54 @@ +/* Verify that overloaded built-ins for vec_ld with + structure pointer / double inputs produce the right code. */ + +/* This test is to ensure that when a cast is associated with arg1 on a + call to vec_ld (arg0, arg1), that the arg1 type is properly handled + through the gimple folding code. + We want something like this: + D.2736 = MEM[(voidD.44 *)D.2739]; + We specifically do not want 'struct S' showing up: + D.3212 = MEM[(struct S *)D.3215]; +*/ + +/* { dg-do compile { target lp64 } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2 -mpower8-vector -fdump-tree-gimple" } */ + +#include +#include + +struct S { + vector int *i1,*i2; + vector long long *ll1; + vector double *vd1; + vector double *vd2; + vector double *vd3; + vector double *vd4; +}; + +vector double +testld_struct1 (long long ll1, struct S *p) +{ + return __builtin_altivec_lvx_v2df (ll1, (double *)p); +} + +vector double +testld_struct1b (long long ll1, struct S *p) +{ + return vec_ld (ll1, (vector double *)p); +} + +vector double +testld_struct2 (struct S *p) +{ + return vec_ld (16, (vector double *)p); +} + +vector double +testld_struct3 (struct S *p) +{ + return vec_ld (16, (vector double *)p->vd2); +} + +// We do not want the "struct S" reference to show up. +/* { dg-final { scan-tree-dump-times "MEM\[\(struct S *\)D.\[0-9\]+\]" 0 "gimple" } } */