From patchwork Thu Jul 15 13:04:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 1505683 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+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.a=rsa-sha256 header.s=default header.b=vtNE+CCN; dkim-atps=neutral Received: from sourceware.org (ip-8-43-85-97.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 4GQZQv3t7Rz9sS8 for ; Thu, 15 Jul 2021 23:07:19 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 268883983056 for ; Thu, 15 Jul 2021 13:07:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 268883983056 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1626354437; bh=8dTBUzPVvnXmI9sUVBHvtmRj1HicmMi0hPY8WzotYHU=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=vtNE+CCNd0vTpNlqw5VMZtqR3SHFdIwTgSIawab1tvaC84HbMQ5LNYJXkfs8Sr/MQ ov4lJZnWbNetRuiRFJR/rk+zaSvxSLuabZgtfAP2K4q2bY34k1gngvZjz4cuZQWd/I Dkx6TmxxW0CuKYQxxn6y+DnDBAScXHoaut5WSvI8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by sourceware.org (Postfix) with ESMTPS id B1AD3398305F for ; Thu, 15 Jul 2021 13:05:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B1AD3398305F Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16FD2GML010640 for ; Thu, 15 Jul 2021 15:05:57 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 39tfwaa81q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 15 Jul 2021 15:05:57 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 4B842100042 for ; Thu, 15 Jul 2021 15:05:55 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag2node3.st.com [10.75.127.6]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id A6A96226FBD for ; Thu, 15 Jul 2021 15:05:55 +0200 (CEST) Received: from [10.211.5.252] (10.75.127.46) by SFHDAG2NODE3.st.com (10.75.127.6) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 15 Jul 2021 15:04:54 +0200 To: gcc Patches Subject: [PATCH] arm: Fix multilib mapping for CDE extensions [PR100856] Message-ID: <71064e87-e296-4bfd-e934-9b582e2ed3de@foss.st.com> Date: Thu, 15 Jul 2021 15:04:53 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 Content-Language: en-US X-Originating-IP: [10.75.127.46] X-ClientProxiedBy: SFHDAG1NODE3.st.com (10.75.127.3) To SFHDAG2NODE3.st.com (10.75.127.6) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-07-15_07:2021-07-14, 2021-07-15 signatures=0 X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, 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-Patchwork-Original-From: Christophe LYON via Gcc-patches From: Christophe Lyon Reply-To: Christophe LYON Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" This is a followup to Srinath's recent patch: the newly added test is failing e.g. on arm-linux-gnueabihf without R/M profile multilibs. It is also failing on arm-eabi with R/M profile multilibs if the execution engine does not support v8.1-M instructions. The patch avoids this by adding check_effective_target_FUNC_multilib in target-supports.exp which effectively checks whether the target supports linking and execution, like what is already done for other ARM effective targets.  pr100856.c is updated to use it instead of arm_v8_1m_main_cde_mve_ok (which makes the testcase a bit of a duplicate with check_effective_target_FUNC_multilib). In addition, I noticed that requiring MVE does not seem necessary and this enables the test to pass even when targeting a CPU without MVE: since the test does not involve actual CDE instructions, it can pass on other architecture versions.  For instance, when requiring MVE, we have to use cortex-m55 under QEMU for the test to pass because the memset() that comes from v8.1-m.main+mve multilib uses LOB instructions (DLS) (memset is used during startup).  Keeping arm_v8_1m_main_cde_mve_ok would mean we would enable the test provided we have the right multilibs, causing a runtime error if the simulator does not support LOB instructions (e.g. when targeting cortex-m7). I do not update sourcebuild.texi since the CDE effective targets are already collectively documented. Finally, the patch fixes two typos in comments. 2021-07-15  Christophe Lyon          PR target/100856         gcc/         * config/arm/arm.opt: Fix typo.         * config/arm/t-rmprofile: Fix typo.         gcc/testsuite/         * gcc.target/arm/acle/pr100856.c: Use arm_v8m_main_cde_multilib         and arm_v8m_main_cde.         * lib/target-supports.exp: Add check_effective_target_FUNC_multilib for ARM CDE. From baa9ed42d986dd2569697ac8903b3ca70ad73bb9 Mon Sep 17 00:00:00 2001 From: Christophe Lyon Date: Thu, 15 Jul 2021 12:57:18 +0000 Subject: [PATCH] arm: Fix multilib mapping for CDE extensions [PR100856] This is a followup to Srinath's recent patch: the newly added test is failing e.g. on arm-linux-gnueabihf without R/M profile multilibs. It is also failing on arm-eabi with R/M profile multilibs if the execution engine does not support v8.1-M instructions. The patch avoids this by adding check_effective_target_FUNC_multilib in target-supports.exp which effectively checks whether the target supports linking and execution, like what is already done for other ARM effective targets. pr100856.c is updated to use it instead of arm_v8_1m_main_cde_mve_ok (which makes the testcase a bit of a duplicate with check_effective_target_FUNC_multilib). In addition, I noticed that requiring MVE does not seem necessary and this enables the test to pass even when targeting a CPU without MVE: since the test does not involve actual CDE instructions, it can pass on other architecture versions. For instance, when requiring MVE, we have to use cortex-m55 under QEMU for the test to pass because the memset() that comes from v8.1-m.main+mve multilib uses LOB instructions (DLS) (memset is used during startup). Keeping arm_v8_1m_main_cde_mve_ok would mean we would enable the test provided we have the right multilibs, causing a runtime error if the simulator does not support LOB instructions (e.g. when targeting cortex-m7). I do not update sourcebuild.texi since the CDE effective targets are already collectively documented. Finally, the patch fixes two typos in comments. 2021-07-15 Christophe Lyon PR target/100856 gcc/ * config/arm/arm.opt: Fix typo. * config/arm/t-rmprofile: Fix typo. gcc/testsuite/ * gcc.target/arm/acle/pr100856.c: Use arm_v8m_main_cde_multilib and arm_v8m_main_cde. * lib/target-supports.exp: Add check_effective_target_FUNC_multilib for ARM CDE. --- gcc/config/arm/arm.opt | 2 +- gcc/config/arm/t-rmprofile | 2 +- gcc/testsuite/gcc.target/arm/acle/pr100856.c | 4 ++-- gcc/testsuite/lib/target-supports.exp | 18 ++++++++++++++++++ 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/gcc/config/arm/arm.opt b/gcc/config/arm/arm.opt index af478a946b2..7417b55122a 100644 --- a/gcc/config/arm/arm.opt +++ b/gcc/config/arm/arm.opt @@ -82,7 +82,7 @@ EnumValue Enum(arm_arch) String(native) Value(-1) DriverOnly ; Set to the name of target architecture which is required for -; multilib linking. This option is undocumented becuase it +; multilib linking. This option is undocumented because it ; should not be used by the users. mlibarch= Target RejectNegative JoinedOrMissing NoDWARFRecord DriverOnly Undocumented diff --git a/gcc/config/arm/t-rmprofile b/gcc/config/arm/t-rmprofile index 3e75fcc9635..a6036bf0a51 100644 --- a/gcc/config/arm/t-rmprofile +++ b/gcc/config/arm/t-rmprofile @@ -54,7 +54,7 @@ MULTILIB_REQUIRED += mthumb/march=armv8.1-m.main+mve/mfloat-abi=hard MULTILIB_MATCHES += march?armv6s-m=march?armv6-m # For all MULITIB_MATCHES for v8-m and above add mlibarch? on the right hand side -# of = in the variant string instead of march?. This is needed becuase all the +# of = in the variant string instead of march?. This is needed because all the # MULITIB_MATCHES variant strings are compared with mlibarch option for multilib # linking. diff --git a/gcc/testsuite/gcc.target/arm/acle/pr100856.c b/gcc/testsuite/gcc.target/arm/acle/pr100856.c index 5bc030e2e46..adbe1ab08f7 100644 --- a/gcc/testsuite/gcc.target/arm/acle/pr100856.c +++ b/gcc/testsuite/gcc.target/arm/acle/pr100856.c @@ -1,6 +1,6 @@ /* { dg-do run } */ -/* { dg-require-effective-target arm_v8_1m_main_cde_mve_ok } */ -/* { dg-add-options arm_v8_1m_main_cde_mve } */ +/* { dg-require-effective-target arm_v8m_main_cde_multilib } */ +/* { dg-add-options arm_v8m_main_cde } */ #include "arm_cde.h" diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 7f78c5593ac..c29247c5bcf 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -5518,6 +5518,24 @@ foreach { armfunc armflag armdef arminc } { global et_FUNC_flags return "$flags $et_FUNC_flags" } + + proc check_effective_target_FUNC_multilib { } { + if { ! [check_effective_target_FUNC_ok] } { + return 0; + } + return [check_runtime FUNC_multilib { + #if !(DEF) + #error "DEF failed" + #endif + #include + INC + int + main (void) + { + return 0; + } + } [add_options_for_FUNC ""]] + } }] }