From patchwork Wed Aug 14 23:13:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Meissner X-Patchwork-Id: 1147281 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-507002-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="UI64uaEo"; 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 46854Y1dtwz9sND for ; Thu, 15 Aug 2019 09:14:03 +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:date :from:to:subject:message-id:references:mime-version:content-type :in-reply-to; q=dns; s=default; b=pb9xeVcYeQDdEYBzRGPyCCIe0gQ1zb sFyL/9Lo4s+xlbFXYQw4SxC5z4UswsyPogPVdfrlUcTbmvoJXoBuXK+l2Dcn/X2k g0lbnLOaYXvcyWlH2p+BW2H5Kk+UuKoa4Ibk2nlntzZJZMejeVQp313xf+G/mp3q 5kIf0ltZypV+I= 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:message-id:references:mime-version:content-type :in-reply-to; s=default; bh=1oGaBr7obGmYpA0L2CnkyKtOL3c=; b=UI64 uaEotTOyb6cR+7Ygs1DNr+dRgxDbPPEyxcgTvASl+Up6olmD0Pmb6SVVTmHDpZxD +3jdW957qgRx0/mAmZEAfHFTgI8itECYWeqbc7XZNFvq7Km8RzvmAGKwCk7Dtdpk 6kkA+G0TUHRhw//5mHfNbAA8uYG2+XF7aguQ9CI= Received: (qmail 71510 invoked by alias); 14 Aug 2019 23:13:55 -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 71501 invoked by uid 89); 14 Aug 2019 23:13:55 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy= 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; Wed, 14 Aug 2019 23:13:52 +0000 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x7EN7E8w128845; Wed, 14 Aug 2019 19:13:51 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ucsg7488v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 14 Aug 2019 19:13:51 -0400 Received: from m0098394.ppops.net (m0098394.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id x7EN9BZg146356; Wed, 14 Aug 2019 19:13:50 -0400 Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ucsg74889-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 14 Aug 2019 19:13:50 -0400 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x7EN54rn012690; Wed, 14 Aug 2019 23:13:49 GMT Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by ppma01dal.us.ibm.com with ESMTP id 2ucr3q1b1h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 14 Aug 2019 23:13:49 +0000 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x7ENDmJD55837044 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Aug 2019 23:13:48 GMT Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4DFDF78068; Wed, 14 Aug 2019 23:13:48 +0000 (GMT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B4F9A78064; Wed, 14 Aug 2019 23:13:47 +0000 (GMT) Received: from ibm-toto.the-meissners.org (unknown [9.32.77.177]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTPS; Wed, 14 Aug 2019 23:13:47 +0000 (GMT) Date: Wed, 14 Aug 2019 19:13:45 -0400 From: Michael Meissner To: gcc-patches@gcc.gnu.org, Segher Boessenkool , David Edelsohn , Michael Meissner , Alan Modra Subject: [PATCH], Patch #9 of 10, Add tests with large memory offsets Message-ID: <20190814231345.GI16578@ibm-toto.the-meissners.org> Mail-Followup-To: Michael Meissner , gcc-patches@gcc.gnu.org, Segher Boessenkool , David Edelsohn , Alan Modra References: <20190814205732.GA11956@ibm-toto.the-meissners.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190814205732.GA11956@ibm-toto.the-meissners.org> User-Agent: Mutt/1.5.21 (2010-09-15) This patch adds tests for all of the types using large address offsets that would not fit into 16 bits, and verifies that prefixed instructions are generated. The tests in this patch all succeed when patches 1-7 are applied on a little endian power8 system. Can I check these patches into the trunk when the previous patches have been applied? 2019-08-14 Michael Meissner * gcc/testsuite/gcc.target/powerpc/prefix-large.h: New set of tests to test prefixed addressing on 'future' system with large numeric offsets. * gcc/testsuite/gcc.target/powerpc/prefix-large-dd.c: New test. * gcc/testsuite/gcc.target/powerpc/prefix-large-df.c: New test. * gcc/testsuite/gcc.target/powerpc/prefix-large-di.c: New test. * gcc/testsuite/gcc.target/powerpc/prefix-large-hi.c: New test. * gcc/testsuite/gcc.target/powerpc/prefix-large-kf.c: New test. * gcc/testsuite/gcc.target/powerpc/prefix-large-qi.c: New test. * gcc/testsuite/gcc.target/powerpc/prefix-large-sd.c: New test. * gcc/testsuite/gcc.target/powerpc/prefix-large-sf.c: New test. * gcc/testsuite/gcc.target/powerpc/prefix-large-si.c: New test. * gcc/testsuite/gcc.target/powerpc/prefix-large-udi.c: New test. * gcc/testsuite/gcc.target/powerpc/prefix-large-uhi.c: New test. * gcc/testsuite/gcc.target/powerpc/prefix-large-uqi.c: New test. * gcc/testsuite/gcc.target/powerpc/prefix-large-usi.c: New test. * gcc/testsuite/gcc.target/powerpc/prefix-large-v2df.c: New test. Index: gcc/testsuite/gcc.target/powerpc/prefix-large-dd.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/prefix-large-dd.c (revision 0) +++ gcc/testsuite/gcc.target/powerpc/prefix-large-dd.c (working copy) @@ -0,0 +1,13 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-require-effective-target powerpc_future_ok } */ +/* { dg-options "-O2 -mdejagnu-cpu=future" } */ + +/* Tests for prefixed instructions testing whether we can generate a prefixed + load/store instruction that has a 34-bit offset. */ + +#define TYPE _Decimal64 + +#include "prefix-large.h" + +/* { dg-final { scan-assembler-times {\mplfd\M} 2 } } */ +/* { dg-final { scan-assembler-times {\mpstfd\M} 2 } } */ Index: gcc/testsuite/gcc.target/powerpc/prefix-large-df.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/prefix-large-df.c (revision 0) +++ gcc/testsuite/gcc.target/powerpc/prefix-large-df.c (working copy) @@ -0,0 +1,13 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-require-effective-target powerpc_future_ok } */ +/* { dg-options "-O2 -mdejagnu-cpu=future" } */ + +/* Tests for prefixed instructions testing whether we can generate a prefixed + load/store instruction that has a 34-bit offset. */ + +#define TYPE double + +#include "prefix-large.h" + +/* { dg-final { scan-assembler-times {\mplfd\M} 2 } } */ +/* { dg-final { scan-assembler-times {\mpstfd\M} 2 } } */ Index: gcc/testsuite/gcc.target/powerpc/prefix-large-di.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/prefix-large-di.c (revision 0) +++ gcc/testsuite/gcc.target/powerpc/prefix-large-di.c (working copy) @@ -0,0 +1,13 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-require-effective-target powerpc_future_ok } */ +/* { dg-options "-O2 -mdejagnu-cpu=future" } */ + +/* Tests for prefixed instructions testing whether we can generate a prefixed + load/store instruction that has a 34-bit offset. */ + +#define TYPE long + +#include "prefix-large.h" + +/* { dg-final { scan-assembler-times {\mpld\M} 2 } } */ +/* { dg-final { scan-assembler-times {\mpstd\M} 2 } } */ Index: gcc/testsuite/gcc.target/powerpc/prefix-large-hi.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/prefix-large-hi.c (revision 0) +++ gcc/testsuite/gcc.target/powerpc/prefix-large-hi.c (working copy) @@ -0,0 +1,13 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-require-effective-target powerpc_future_ok } */ +/* { dg-options "-O2 -mdejagnu-cpu=future" } */ + +/* Tests for prefixed instructions testing whether we can generate a prefixed + load/store instruction that has a 34-bit offset. */ + +#define TYPE short + +#include "prefix-large.h" + +/* { dg-final { scan-assembler-times {\mplh[az]\M} 2 } } */ +/* { dg-final { scan-assembler-times {\mpsth\M} 2 } } */ Index: gcc/testsuite/gcc.target/powerpc/prefix-large-kf.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/prefix-large-kf.c (revision 0) +++ gcc/testsuite/gcc.target/powerpc/prefix-large-kf.c (working copy) @@ -0,0 +1,13 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-require-effective-target powerpc_future_ok } */ +/* { dg-options "-O2 -mdejagnu-cpu=future" } */ + +/* Tests for prefixed instructions testing whether we can generate a prefixed + load/store instruction that has a 34-bit offset. */ + +#define TYPE __float128 + +#include "prefix-large.h" + +/* { dg-final { scan-assembler-times {\mplxv\M} 2 } } */ +/* { dg-final { scan-assembler-times {\mpstxv\M} 2 } } */ Index: gcc/testsuite/gcc.target/powerpc/prefix-large-qi.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/prefix-large-qi.c (revision 0) +++ gcc/testsuite/gcc.target/powerpc/prefix-large-qi.c (working copy) @@ -0,0 +1,13 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-require-effective-target powerpc_future_ok } */ +/* { dg-options "-O2 -mdejagnu-cpu=future" } */ + +/* Tests for prefixed instructions testing whether we can generate a prefixed + load/store instruction that has a 34-bit offset. */ + +#define TYPE signed char + +#include "prefix-large.h" + +/* { dg-final { scan-assembler-times {\mplbz\M} 2 } } */ +/* { dg-final { scan-assembler-times {\mpstb\M} 2 } } */ Index: gcc/testsuite/gcc.target/powerpc/prefix-large-sd.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/prefix-large-sd.c (revision 0) +++ gcc/testsuite/gcc.target/powerpc/prefix-large-sd.c (working copy) @@ -0,0 +1,16 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-require-effective-target powerpc_future_ok } */ +/* { dg-options "-O2 -mdejagnu-cpu=future" } */ + +/* Tests for prefixed instructions testing whether we can generate a prefixed + load/store instruction that has a 34-bit offset. */ + +#define TYPE _Decimal32 + +#include "prefix-large.h" + +/* { dg-final { scan-assembler-times {\mpaddi\M|\mpli|\mpla\M} 3 } } */ +/* { dg-final { scan-assembler-times {\mlfiwzx\M} 2 } } */ +/* { dg-final { scan-assembler-times {\mstfiwx\M} 2 } } */ + + Index: gcc/testsuite/gcc.target/powerpc/prefix-large-sf.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/prefix-large-sf.c (revision 0) +++ gcc/testsuite/gcc.target/powerpc/prefix-large-sf.c (working copy) @@ -0,0 +1,13 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-require-effective-target powerpc_future_ok } */ +/* { dg-options "-O2 -mdejagnu-cpu=future" } */ + +/* Tests for prefixed instructions testing whether we can generate a prefixed + load/store instruction that has a 34-bit offset. */ + +#define TYPE float + +#include "prefix-large.h" + +/* { dg-final { scan-assembler-times {\mplfs\M} 2 } } */ +/* { dg-final { scan-assembler-times {\mpstfs\M} 2 } } */ Index: gcc/testsuite/gcc.target/powerpc/prefix-large-si.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/prefix-large-si.c (revision 0) +++ gcc/testsuite/gcc.target/powerpc/prefix-large-si.c (working copy) @@ -0,0 +1,13 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-require-effective-target powerpc_future_ok } */ +/* { dg-options "-O2 -mdejagnu-cpu=future" } */ + +/* Tests for prefixed instructions testing whether we can generate a prefixed + load/store instruction that has a 34-bit offset. */ + +#define TYPE int + +#include "prefix-large.h" + +/* { dg-final { scan-assembler-times {\mplw[az]\M} 2 } } */ +/* { dg-final { scan-assembler-times {\mpstw\M} 2 } } */ Index: gcc/testsuite/gcc.target/powerpc/prefix-large-udi.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/prefix-large-udi.c (revision 0) +++ gcc/testsuite/gcc.target/powerpc/prefix-large-udi.c (working copy) @@ -0,0 +1,13 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-require-effective-target powerpc_future_ok } */ +/* { dg-options "-O2 -mdejagnu-cpu=future" } */ + +/* Tests for prefixed instructions testing whether we can generate a prefixed + load/store instruction that has a 34-bit offset. */ + +#define TYPE unsigned long + +#include "prefix-large.h" + +/* { dg-final { scan-assembler-times {\mpld\M} 2 } } */ +/* { dg-final { scan-assembler-times {\mpstd\M} 2 } } */ Index: gcc/testsuite/gcc.target/powerpc/prefix-large-uhi.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/prefix-large-uhi.c (revision 0) +++ gcc/testsuite/gcc.target/powerpc/prefix-large-uhi.c (working copy) @@ -0,0 +1,13 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-require-effective-target powerpc_future_ok } */ +/* { dg-options "-O2 -mdejagnu-cpu=future" } */ + +/* Tests for prefixed instructions testing whether we can generate a prefixed + load/store instruction that has a 34-bit offset. */ + +#define TYPE unsigned short + +#include "prefix-large.h" + +/* { dg-final { scan-assembler-times {\mplhz\M} 2 } } */ +/* { dg-final { scan-assembler-times {\mpsth\M} 2 } } */ Index: gcc/testsuite/gcc.target/powerpc/prefix-large-uqi.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/prefix-large-uqi.c (revision 0) +++ gcc/testsuite/gcc.target/powerpc/prefix-large-uqi.c (working copy) @@ -0,0 +1,13 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-require-effective-target powerpc_future_ok } */ +/* { dg-options "-O2 -mdejagnu-cpu=future" } */ + +/* Tests for prefixed instructions testing whether we can generate a prefixed + load/store instruction that has a 34-bit offset. */ + +#define TYPE unsigned char + +#include "prefix-large.h" + +/* { dg-final { scan-assembler-times {\mplbz\M} 2 } } */ +/* { dg-final { scan-assembler-times {\mpstb\M} 2 } } */ Index: gcc/testsuite/gcc.target/powerpc/prefix-large-usi.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/prefix-large-usi.c (revision 0) +++ gcc/testsuite/gcc.target/powerpc/prefix-large-usi.c (working copy) @@ -0,0 +1,13 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-require-effective-target powerpc_future_ok } */ +/* { dg-options "-O2 -mdejagnu-cpu=future" } */ + +/* Tests for prefixed instructions testing whether we can generate a prefixed + load/store instruction that has a 34-bit offset. */ + +#define TYPE unsigned int + +#include "prefix-large.h" + +/* { dg-final { scan-assembler-times {\mplwz\M} 2 } } */ +/* { dg-final { scan-assembler-times {\mpstw\M} 2 } } */ Index: gcc/testsuite/gcc.target/powerpc/prefix-large-v2df.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/prefix-large-v2df.c (revision 0) +++ gcc/testsuite/gcc.target/powerpc/prefix-large-v2df.c (working copy) @@ -0,0 +1,13 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-require-effective-target powerpc_future_ok } */ +/* { dg-options "-O2 -mdejagnu-cpu=future" } */ + +/* Tests for prefixed instructions testing whether we can generate a prefixed + load/store instruction that has a 34-bit offset. */ + +#define TYPE vector double + +#include "prefix-large.h" + +/* { dg-final { scan-assembler-times {\mplxv\M} 2 } } */ +/* { dg-final { scan-assembler-times {\mpstxv\M} 2 } } */ Index: gcc/testsuite/gcc.target/powerpc/prefix-large.h =================================================================== --- gcc/testsuite/gcc.target/powerpc/prefix-large.h (revision 0) +++ gcc/testsuite/gcc.target/powerpc/prefix-large.h (working copy) @@ -0,0 +1,59 @@ +/* Common tests for prefixed instructions testing whether we can generate a + 34-bit offset using 1 instruction. */ + +typedef signed char schar; +typedef unsigned char uchar; +typedef unsigned short ushort; +typedef unsigned int uint; +typedef unsigned long ulong; +typedef long double ldouble; +typedef vector double v2df; +typedef vector long v2di; +typedef vector float v4sf; +typedef vector int v4si; + +#ifndef TYPE +#define TYPE ulong +#endif + +#ifndef ITYPE +#define ITYPE TYPE +#endif + +#ifndef OTYPE +#define OTYPE TYPE +#endif + +#if !defined(DO_ADD) && !defined(DO_VALUE) && !defined(DO_SET) +#define DO_ADD 1 +#define DO_VALUE 1 +#define DO_SET 1 +#endif + +#ifndef CONSTANT +#define CONSTANT 0x123450UL +#endif + +#if DO_ADD +void +add (TYPE *p, TYPE a) +{ + p[CONSTANT] += a; +} +#endif + +#if DO_VALUE +OTYPE +value (TYPE *p) +{ + return p[CONSTANT]; +} +#endif + +#if DO_SET +void +set (TYPE *p, ITYPE a) +{ + p[CONSTANT] = a; +} +#endif