From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id B82943858C3A for ; Mon, 25 Oct 2021 20:34:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B82943858C3A Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19PKYIDE002696; Mon, 25 Oct 2021 20:34:21 GMT Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0b-001b2d01.pphosted.com with ESMTP id 3bx1ghbyc2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 25 Oct 2021 20:34:19 +0000 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 19PKJ3bN012739; Mon, 25 Oct 2021 20:33:26 GMT Received: from b03cxnp07027.gho.boulder.ibm.com (b03cxnp07027.gho.boulder.ibm.com [9.17.130.14]) by ppma03dal.us.ibm.com with ESMTP id 3bva1axbsm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 25 Oct 2021 20:33:26 +0000 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp07027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 19PKXOm131654332 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 25 Oct 2021 20:33:24 GMT Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B654A6E052; Mon, 25 Oct 2021 20:33:24 +0000 (GMT) Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 503E06E054; Mon, 25 Oct 2021 20:33:24 +0000 (GMT) Received: from localhost (unknown [9.160.64.204]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 25 Oct 2021 20:33:23 +0000 (GMT) From: "Paul A. Clarke" To: segher@kernel.crashing.org, gcc-patches@gcc.gnu.org Subject: [PATCH] rs6000: Fixes for tests including only Date: Mon, 25 Oct 2021 15:33:21 -0500 Message-Id: <20211025203321.645546-1-pc@us.ibm.com> X-Mailer: git-send-email 2.27.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 0v5cDI0KXBn1EtOsXdhq4ACWpmh_esFv X-Proofpoint-ORIG-GUID: 0v5cDI0KXBn1EtOsXdhq4ACWpmh_esFv Content-Transfer-Encoding: 8bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-10-25_07,2021-10-25_02,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 adultscore=0 impostorscore=0 bulkscore=0 malwarescore=0 spamscore=0 mlxscore=0 suspectscore=0 lowpriorityscore=0 priorityscore=1501 mlxlogscore=999 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109230001 definitions=main-2110250119 X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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-List-Received-Date: Mon, 25 Oct 2021 20:34:23 -0000 Tests which only include expect many other include files to be brought in, but not enough are. Try to increase compatibility with x86 headers by: - Create new immintrin.h, including the analogous subset of intrinsics headers available for powerpc. - Create new x86gprintrin.h, serving exclusively as the umbrella for bmiintrin.h and bmi2intrin.h. - Modify x86intrin.h: - Include new immintrin.h. - Remove mmintrin.h, xmmintrin.h, emmintrin.h, now included indirectly from immintrin.h. - Remove bmiintrin.h, bmi2intrin.h, now included indirectly from x86gprintrin.h (which is now included from immintrin.h). Add the new files to gcc/config.gcc. Also, fix up the testcase that provoked PR102719, which requires Power8 vector support. Fixes commit 29fb1e831bf1c25e4574bf2f98a9f534e5c67665. 2021-10-25 Paul A. Clarke gcc PR target/102719 * config/rs6000/x86intrin.h: Move some included headers to new headers; include new immintrin.h instead. * config/rs6000/immintrin.h: New. * config/rs6000/x86gprintrin.h: New. * config/config.gcc (powerpc-*-*): Add new headers to extra_headers. gcc/testsuite * gcc.target/powerpc/pr78102.c: Fix dg directives to require Power8 vector support. --- Tested on powerpc64le-linux (Power9), powerpc64-linux (Power8) and powerpc-linux (Power8). OK for trunk? gcc/config.gcc | 2 +- gcc/config/rs6000/immintrin.h | 41 ++++++++++++++++++++++ gcc/config/rs6000/x86gprintrin.h | 31 ++++++++++++++++ gcc/config/rs6000/x86intrin.h | 10 +----- gcc/testsuite/gcc.target/powerpc/pr78102.c | 4 +-- 5 files changed, 76 insertions(+), 12 deletions(-) create mode 100644 gcc/config/rs6000/immintrin.h create mode 100644 gcc/config/rs6000/x86gprintrin.h diff --git a/gcc/config.gcc b/gcc/config.gcc index fb1f06f3da89..efd1f42ac234 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -490,7 +490,7 @@ powerpc*-*-*) extra_headers="${extra_headers} xmmintrin.h mm_malloc.h emmintrin.h" extra_headers="${extra_headers} mmintrin.h x86intrin.h" extra_headers="${extra_headers} pmmintrin.h tmmintrin.h smmintrin.h" - extra_headers="${extra_headers} nmmintrin.h" + extra_headers="${extra_headers} nmmintrin.h immintrin.h x86gprintrin.h" extra_headers="${extra_headers} ppu_intrinsics.h spu2vmx.h vec_types.h si2vmx.h" extra_headers="${extra_headers} amo.h" case x$with_cpu in diff --git a/gcc/config/rs6000/immintrin.h b/gcc/config/rs6000/immintrin.h new file mode 100644 index 000000000000..647a5ae49b5a --- /dev/null +++ b/gcc/config/rs6000/immintrin.h @@ -0,0 +1,41 @@ +/* Copyright (C) 2021 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GCC is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + + You should have received a copy of the GNU General Public License and + a copy of the GCC Runtime Library Exception along with this program; + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + . */ + +#ifndef _IMMINTRIN_H_INCLUDED +#define _IMMINTRIN_H_INCLUDED + +#include + +#include + +#include + +#include + +#include + +#include + +#include + +#endif /* _IMMINTRIN_H_INCLUDED */ diff --git a/gcc/config/rs6000/x86gprintrin.h b/gcc/config/rs6000/x86gprintrin.h new file mode 100644 index 000000000000..57ef120f805f --- /dev/null +++ b/gcc/config/rs6000/x86gprintrin.h @@ -0,0 +1,31 @@ +/* Copyright (C) 2021 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GCC is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + + You should have received a copy of the GNU General Public License and + a copy of the GCC Runtime Library Exception along with this program; + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + . */ + +#ifndef _X86GPRINTRIN_H_INCLUDED +#define _X86GPRINTRIN_H_INCLUDED + +#include + +#include + +#endif /* _X86GPRINTRIN_H_INCLUDED. */ diff --git a/gcc/config/rs6000/x86intrin.h b/gcc/config/rs6000/x86intrin.h index 6ad2bfcb6dcd..e8aa922dcf03 100644 --- a/gcc/config/rs6000/x86intrin.h +++ b/gcc/config/rs6000/x86intrin.h @@ -36,15 +36,7 @@ #define _X86INTRIN_H_INCLUDED #ifdef __ALTIVEC__ -#include - -#include - -#include +#include #endif /* __ALTIVEC__ */ -#include - -#include - #endif /* _X86INTRIN_H_INCLUDED */ diff --git a/gcc/testsuite/gcc.target/powerpc/pr78102.c b/gcc/testsuite/gcc.target/powerpc/pr78102.c index 434e677e1714..eef58abb2b78 100644 --- a/gcc/testsuite/gcc.target/powerpc/pr78102.c +++ b/gcc/testsuite/gcc.target/powerpc/pr78102.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mvsx" } */ -/* { dg-require-effective-target vsx_hw } */ +/* { dg-options "-O2 -mpower8-vector -DNO_WARN_X86_INTRINSICS" } */ +/* { dg-require-effective-target p8vector_hw } */ #include -- 2.27.0