From patchwork Tue Aug 4 05:53:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Meissner X-Patchwork-Id: 1340671 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=BGusBc3f; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BLP8J6BdGz9sSt for ; Tue, 4 Aug 2020 15:54:08 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B15B63857C7C; Tue, 4 Aug 2020 05:54:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B15B63857C7C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1596520445; bh=pcl81D1y+mAbXRSQepCInQ9w0pMpawD4un7r4XMDSg0=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=BGusBc3fkNbaKmaH7FcwSANx2jRP/TQ2uyMXtjgpip5sa/2IMuSb2MdR0+9irfx2z Q2SphqxtFPeMRZ+B/0hcyILk3anPZfXxemgem/txPnTEog6nq8Hf0IMrSr8+vtV/XO pxSfyEJcyYN3MOR+sentKDymds/AVrwqmP/1ufF8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 393D43857C7C for ; Tue, 4 Aug 2020 05:54:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 393D43857C7C Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0745XLJF026317; Tue, 4 Aug 2020 01:54:02 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 32q06h2egg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 04 Aug 2020 01:54:02 -0400 Received: from m0098409.ppops.net (m0098409.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 0745liLc058664; Tue, 4 Aug 2020 01:54:01 -0400 Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0a-001b2d01.pphosted.com with ESMTP id 32q06h2eg4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 04 Aug 2020 01:54:01 -0400 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0745oqJf022987; Tue, 4 Aug 2020 05:54:00 GMT Received: from b01cxnp22034.gho.pok.ibm.com (b01cxnp22034.gho.pok.ibm.com [9.57.198.24]) by ppma03dal.us.ibm.com with ESMTP id 32n018u59v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 04 Aug 2020 05:54:00 +0000 Received: from b01ledav001.gho.pok.ibm.com (b01ledav001.gho.pok.ibm.com [9.57.199.106]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0745s0vi55050618 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 4 Aug 2020 05:54:00 GMT Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0A7B828059; Tue, 4 Aug 2020 05:54:00 +0000 (GMT) Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A65BC28058; Tue, 4 Aug 2020 05:53:59 +0000 (GMT) Received: from ibm-tinman.the-meissners.org (unknown [9.160.3.19]) by b01ledav001.gho.pok.ibm.com (Postfix) with ESMTPS; Tue, 4 Aug 2020 05:53:59 +0000 (GMT) Date: Tue, 4 Aug 2020 01:53:58 -0400 To: Michael Meissner , gcc-patches@gcc.gnu.org, Segher Boessenkool , David Edelsohn Subject: [PATCH 2/6] Backport Power10 prefix test for DS/DQ. Message-ID: <20200804055358.GB6014@ibm-tinman.the-meissners.org> Mail-Followup-To: Michael Meissner , gcc-patches@gcc.gnu.org, Segher Boessenkool , David Edelsohn References: <20200804054649.GA5546@ibm-tinman.the-meissners.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200804054649.GA5546@ibm-tinman.the-meissners.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-08-04_02:2020-08-03, 2020-08-04 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 spamscore=0 mlxscore=0 clxscore=1015 impostorscore=0 mlxlogscore=999 suspectscore=0 phishscore=0 priorityscore=1501 bulkscore=0 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008040041 X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Michael Meissner via Gcc-patches From: Michael Meissner Reply-To: Michael Meissner Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Backport Power10 prefix test for DS/DQ. This patch adds a test to make sure offsets that are not legal for non-prefixed DS/DQ instructions are legal for a prefixed instruction. This test has been in the master branch since June, and no changes were needed to backport it to GCC 10. Can I check this into the GCC 10 branch? gcc/testsuite/ 2020-08-03 Michael Meissner Backport from the master branch: 2020-06-27 Michael Meissner * gcc.target/powerpc/prefix-ds-dq.c: New test. --- gcc/testsuite/gcc.target/powerpc/prefix-ds-dq.c | 161 ++++++++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 gcc/testsuite/gcc.target/powerpc/prefix-ds-dq.c diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-ds-dq.c b/gcc/testsuite/gcc.target/powerpc/prefix-ds-dq.c new file mode 100644 index 0000000..554cd0c --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/prefix-ds-dq.c @@ -0,0 +1,161 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_prefixed_addr } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-O2 -mdejagnu-cpu=power10" } */ + +/* Tests whether we generate a prefixed load/store operation for addresses that + don't meet DS/DQ offset constraints. 64-bit is needed for testing the use + of the PLWA instruciton. */ + +struct packed_struct +{ + long long pad; /* offset 0 bytes. */ + unsigned char pad_uc; /* offset 8 bytes. */ + unsigned char uc; /* offset 9 bytes. */ + + unsigned char pad_sc[sizeof (long long) - sizeof (unsigned char)]; + unsigned char sc; /* offset 17 bytes. */ + + unsigned char pad_us[sizeof (long long) - sizeof (signed char)]; + unsigned short us; /* offset 25 bytes. */ + + unsigned char pad_ss[sizeof (long long) - sizeof (unsigned short)]; + short ss; /* offset 33 bytes. */ + + unsigned char pad_ui[sizeof (long long) - sizeof (short)]; + unsigned int ui; /* offset 41 bytes. */ + + unsigned char pad_si[sizeof (long long) - sizeof (unsigned int)]; + unsigned int si; /* offset 49 bytes. */ + + unsigned char pad_f[sizeof (long long) - sizeof (int)]; + float f; /* offset 57 bytes. */ + + unsigned char pad_d[sizeof (long long) - sizeof (float)]; + double d; /* offset 65 bytes. */ + __float128 f128; /* offset 73 bytes. */ +} __attribute__((packed)); + +unsigned char +load_uc (struct packed_struct *p) +{ + return p->uc; /* LBZ 3,9(3). */ +} + +signed char +load_sc (struct packed_struct *p) +{ + return p->sc; /* LBZ 3,17(3) + EXTSB 3,3. */ +} + +unsigned short +load_us (struct packed_struct *p) +{ + return p->us; /* LHZ 3,25(3). */ +} + +short +load_ss (struct packed_struct *p) +{ + return p->ss; /* LHA 3,33(3). */ +} + +unsigned int +load_ui (struct packed_struct *p) +{ + return p->ui; /* LWZ 3,41(3). */ +} + +int +load_si (struct packed_struct *p) +{ + return p->si; /* PLWA 3,49(3). */ +} + +float +load_float (struct packed_struct *p) +{ + return p->f; /* LFS 1,57(3). */ +} + +double +load_double (struct packed_struct *p) +{ + return p->d; /* LFD 1,65(3). */ +} + +__float128 +load_float128 (struct packed_struct *p) +{ + return p->f128; /* PLXV 34,73(3). */ +} + +void +store_uc (struct packed_struct *p, unsigned char uc) +{ + p->uc = uc; /* STB 4,9(3). */ +} + +void +store_sc (struct packed_struct *p, signed char sc) +{ + p->sc = sc; /* STB 4,17(3). */ +} + +void +store_us (struct packed_struct *p, unsigned short us) +{ + p->us = us; /* STH 4,25(3). */ +} + +void +store_ss (struct packed_struct *p, signed short ss) +{ + p->ss = ss; /* STH 4,33(3). */ +} + +void +store_ui (struct packed_struct *p, unsigned int ui) +{ + p->ui = ui; /* STW 4,41(3). */ +} + +void +store_si (struct packed_struct *p, signed int si) +{ + p->si = si; /* STW 4,49(3). */ +} + +void +store_float (struct packed_struct *p, float f) +{ + p->f = f; /* STFS 1,57(3). */ +} + +void +store_double (struct packed_struct *p, double d) +{ + p->d = d; /* STFD 1,65(3). */ +} + +void +store_float128 (struct packed_struct *p, __float128 f128) +{ + p->f128 = f128; /* PSTXV 34,1(3). */ +} + +/* { dg-final { scan-assembler-times {\mextsb\M} 1 } } */ +/* { dg-final { scan-assembler-times {\mlbz\M} 2 } } */ +/* { dg-final { scan-assembler-times {\mlfd\M} 1 } } */ +/* { dg-final { scan-assembler-times {\mlfs\M} 1 } } */ +/* { dg-final { scan-assembler-times {\mlha\M} 1 } } */ +/* { dg-final { scan-assembler-times {\mlhz\M} 1 } } */ +/* { dg-final { scan-assembler-times {\mlwz\M} 1 } } */ +/* { dg-final { scan-assembler-times {\mplwa\M} 1 } } */ +/* { dg-final { scan-assembler-times {\mplxv\M} 1 } } */ +/* { dg-final { scan-assembler-times {\mpstxv\M} 1 } } */ +/* { dg-final { scan-assembler-times {\mstb\M} 2 } } */ +/* { dg-final { scan-assembler-times {\mstfd\M} 1 } } */ +/* { dg-final { scan-assembler-times {\mstfs\M} 1 } } */ +/* { dg-final { scan-assembler-times {\msth\M} 2 } } */ +/* { dg-final { scan-assembler-times {\mstw\M} 2 } } */