From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx08-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by sourceware.org (Postfix) with ESMTPS id 371993858D38 for ; Wed, 22 May 2024 19:50:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 371993858D38 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=foss.st.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 371993858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=91.207.212.93 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716407414; cv=none; b=XacdtOsKtb21yHsnecTToSyXOcdiKIeWMEPIGnKoQ71o4Vqqhk/DeJ7giHwSCR3DsjpvMYu9LG3mdMON9v/W3KUb4upeOPhm9hnsO2DSNVjhNMuo9kJbL2RKjgzrNhFwdLMqhIorldjDMswVm38M3u5tJr08cxOCFemOGUlOHpI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716407414; c=relaxed/simple; bh=fNoVTeLuk/GV975n4kARPHULSeQD13yDSeHzG2Hzc3k=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=uecICbngUnCSgEl08WtfBjq+RyD02EQUO9nQsCJixxFobr01EDblnQxPW8imaFz7hyt0eRRQCPnAlQcT/orDK3kJEMOPN6naU3IXB9HHHeqvuprarhHAR1bKuUijPz1gD59XMN+t6eGtxJjLjBSUdcgwi0fwELG8nYNFmYKIj+M= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0369457.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 44MIFO4U017785; Wed, 22 May 2024 21:50:08 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= selector1; bh=iuo8BQEUfzUT1zGUeJsIrWWAeJ+3pTYxrx4bm92ratA=; b=g7 Z1YMti2vIMi4WDsOr1FFi+63ZX+XnKt918YWS9DO/pYlaUjzoCIXe/gc3yXXXc0p YLQVBgExIsJiZxjIhm7c5FudXVPDHZH7MRIc7SX/Ds/ak74MKQmQhEtDp7NS2sYx 0JEAmn0lQv4EwnvS0yW8W2DKpMXk3ovtS/SlpogymSiz4440nu9OzpQ1NQma00bZ SyLHDdNkqNVO2TKKUgavIdy43useaPBgN+55AWkWQNfVfeLHFj+zCo3Co9iy71+B +jiC92f2OLUK+pkaVR4tZy0SeNwBl7zARv4/qhzQKW9CsIx5pKPk+/zyH991zejP wWbKm0E06hGmWfEzSmjw== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3y8vqhe6eq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 May 2024 21:50:07 +0200 (MEST) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 7921B4002D; Wed, 22 May 2024 21:50:02 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id F30EA227C2E; Wed, 22 May 2024 21:49:47 +0200 (CEST) Received: from [10.252.21.232] (10.252.21.232) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 22 May 2024 21:49:47 +0200 Message-ID: Date: Wed, 22 May 2024 21:49:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] testsuite: Verify r0-r3 are extended with CMSE To: "Richard Earnshaw (lists)" , CC: , References: <07fde3e9-c08a-4a05-839f-86c8a18efec3@arm.com> <20240502105045.2505591-1-torbjorn.svensson@foss.st.com> <0c050cb3-e3fd-4a71-a49f-bd4b0138d975@foss.st.com> <4a67aa30-18ab-4ca3-9536-bab7b70b3367@arm.com> Content-Language: en-US From: Torbjorn SVENSSON In-Reply-To: <4a67aa30-18ab-4ca3-9536-bab7b70b3367@arm.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.252.21.232] X-ClientProxiedBy: SHFCAS1NODE2.st.com (10.75.129.73) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.12.28.16 definitions=2024-05-22_10,2024-05-22_01,2024-05-17_01 X-Spam-Status: No, score=-10.2 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,GIT_PATCH_0,KAM_LOTSOFHASH,KAM_SHORT,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi, I've now pushed the below change to the following branches with the corresponding commit id. trunk: 9ddad76e98ac8f257f90b3814ed3c6ba78d0f3c7 releases/gcc-14: da3a6b0dda45bc676bb985d7940853b50803e11a releases/gcc-13: 75d394c20b0ad85dfe8511324d61d13e453c9285 releases/gcc-12: d9c89402b54be4c15bb3c7bcce3465f534746204 releases/gcc-11: 08ca81e4b49bda153d678a372df7f7143a94f4ad Kind regards, Torbjörn On 2024-05-22 13:54, Richard Earnshaw (lists) wrote: > On 22/05/2024 12:14, Torbjorn SVENSSON wrote: >> Hello Richard, >> >> Thanks for the reply. >> >> From my point of view, at least the -fshort-enums part should be on all branches. Just to be clean, maybe it's easier to backport the entire patch? > > Yes, that's a fair point. I was only thinking about the broadening of the test to the other argument registers when I said that. > > So, just to be clear, OK all. > > R. > >> >> Unless you have an objection, I would like to go ahead and just backport it to all branches. >> >> Kind regards, >> Torbjörn >> >> On 2024-05-22 12:55, Richard Earnshaw (lists) wrote: >>> On 06/05/2024 12:50, Torbjorn SVENSSON wrote: >>>> Hi, >>>> >>>> Forgot to mention when I sent the patch that I would like to commit it to the following branches: >>>> >>>> - releases/gcc-11 >>>> - releases/gcc-12 >>>> - releases/gcc-13 >>>> - releases/gcc-14 >>>> - trunk >>>> >>> >>> Well you can [commit it to the release branches], but I'm not sure it's essential.  It seems pretty unlikely to me that this would regress on a release branch without having first regressed on trunk. >>> >>> R. >>> >>>> Kind regards, >>>> Torbjörn >>>> >>>> On 2024-05-02 12:50, Torbjörn SVENSSON wrote: >>>>> Add regression test to the existing zero/sign extend tests for CMSE to >>>>> verify that r0, r1, r2 and r3 are properly extended, not just r0. >>>>> >>>>> boolCharShortEnumSecureFunc test is done using -O0 to ensure the >>>>> instructions are in a predictable order. >>>>> >>>>> gcc/testsuite/ChangeLog: >>>>> >>>>>      * gcc.target/arm/cmse/extend-param.c: Add regression test. Add >>>>>        -fshort-enums. >>>>>      * gcc.target/arm/cmse/extend-return.c: Add -fshort-enums option. >>>>> >>>>> Signed-off-by: Torbjörn SVENSSON >>>>> --- >>>>>    .../gcc.target/arm/cmse/extend-param.c        | 21 +++++++++++++++---- >>>>>    .../gcc.target/arm/cmse/extend-return.c       |  4 ++-- >>>>>    2 files changed, 19 insertions(+), 6 deletions(-) >>>>> >>>>> diff --git a/gcc/testsuite/gcc.target/arm/cmse/extend-param.c b/gcc/testsuite/gcc.target/arm/cmse/extend-param.c >>>>> index 01fac786238..d01ef87e0be 100644 >>>>> --- a/gcc/testsuite/gcc.target/arm/cmse/extend-param.c >>>>> +++ b/gcc/testsuite/gcc.target/arm/cmse/extend-param.c >>>>> @@ -1,5 +1,5 @@ >>>>>    /* { dg-do compile } */ >>>>> -/* { dg-options "-mcmse" } */ >>>>> +/* { dg-options "-mcmse -fshort-enums" } */ >>>>>    /* { dg-final { check-function-bodies "**" "" "" } } */ >>>>>      #include >>>>> @@ -78,7 +78,6 @@ __attribute__((cmse_nonsecure_entry)) char enumSecureFunc (enum offset index) { >>>>>      if (index >= ARRAY_SIZE) >>>>>        return 0; >>>>>      return array[index]; >>>>> - >>>>>    } >>>>>      /* >>>>> @@ -88,9 +87,23 @@ __attribute__((cmse_nonsecure_entry)) char enumSecureFunc (enum offset index) { >>>>>    **    ... >>>>>    */ >>>>>    __attribute__((cmse_nonsecure_entry)) char boolSecureFunc (bool index) { >>>>> - >>>>>      if (index >= ARRAY_SIZE) >>>>>        return 0; >>>>>      return array[index]; >>>>> +} >>>>>    -} >>>>> \ No newline at end of file >>>>> +/* >>>>> +**__acle_se_boolCharShortEnumSecureFunc: >>>>> +**    ... >>>>> +**    uxtb    r0, r0 >>>>> +**    uxtb    r1, r1 >>>>> +**    uxth    r2, r2 >>>>> +**    uxtb    r3, r3 >>>>> +**    ... >>>>> +*/ >>>>> +__attribute__((cmse_nonsecure_entry,optimize(0))) char boolCharShortEnumSecureFunc (bool a, unsigned char b, unsigned short c, enum offset d) { >>>>> +  size_t index = a + b + c + d; >>>>> +  if (index >= ARRAY_SIZE) >>>>> +    return 0; >>>>> +  return array[index]; >>>>> +} >>>>> diff --git a/gcc/testsuite/gcc.target/arm/cmse/extend-return.c b/gcc/testsuite/gcc.target/arm/cmse/extend-return.c >>>>> index cf731ed33df..081de0d699f 100644 >>>>> --- a/gcc/testsuite/gcc.target/arm/cmse/extend-return.c >>>>> +++ b/gcc/testsuite/gcc.target/arm/cmse/extend-return.c >>>>> @@ -1,5 +1,5 @@ >>>>>    /* { dg-do compile } */ >>>>> -/* { dg-options "-mcmse" } */ >>>>> +/* { dg-options "-mcmse -fshort-enums" } */ >>>>>    /* { dg-final { check-function-bodies "**" "" "" } } */ >>>>>      #include >>>>> @@ -89,4 +89,4 @@ unsigned char __attribute__((noipa)) enumNonsecure0 (ns_enum_foo_t * ns_foo_p) >>>>>    unsigned char boolNonsecure0 (ns_bool_foo_t * ns_foo_p) >>>>>    { >>>>>      return ns_foo_p (); >>>>> -} >>>>> \ No newline at end of file >>>>> +} >>> >