From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 326 invoked by alias); 5 Sep 2019 07:49:01 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 316 invoked by uid 89); 5 Sep 2019 07:49:01 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: smtprelay-out1.synopsys.com Received: from smtprelay-out1.synopsys.com (HELO smtprelay-out1.synopsys.com) (198.182.61.142) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 05 Sep 2019 07:48:59 +0000 Received: from mailhost.synopsys.com (dc2-mailhost2.synopsys.com [10.12.135.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 9FAA7C29CC; Thu, 5 Sep 2019 07:48:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1567669736; bh=RWVu6A7SdmryFlXLRdEIrEkzdQMVVyPr1KV44YHIv1A=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=i+khxxIFr0VjZbW8D/bporCpzH6EPzV6zK9QB6o7q9/S9xsX/QLhXrP2IsSyq/Fnc +SQzcwAXAwtuyE2EhOavpP752E06YdwTZJeBcqBp2+5hbPqU0+Vp8vWBsgJbAzf5YZ cMz3ybBNMqnkaEL3HxPdSjnbc5ZPtwXXCFuvJDcijEobYdyr/gvUSxY696sXg1Ki5z Bu5rc+BFBC+SJspNfSJNZO9XUEHJdQ4ZAyucsB9blJ/fX2s3H00WHDCgm/zHYwTHe/ C+6gyDAh5FX3hnaQkZwgfgC8uDYSM1mI8LXazfbzTnV+xCmvzqqOUfcy+iOpbX9B39 M8TeXXmfk2qeQ== Received: from US01WXQAHTC1.internal.synopsys.com (us01wxqahtc1.internal.synopsys.com [10.12.238.230]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by mailhost.synopsys.com (Postfix) with ESMTPS id 44144A0097; Thu, 5 Sep 2019 07:48:56 +0000 (UTC) Received: from US01HYBRID2.internal.synopsys.com (10.15.246.24) by US01WXQAHTC1.internal.synopsys.com (10.12.238.230) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 5 Sep 2019 00:48:55 -0700 Received: from NAM05-DM3-obe.outbound.protection.outlook.com (10.13.134.195) by mrs.synopsys.com (10.15.246.24) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 5 Sep 2019 00:48:55 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QLfFxYg/OPrk17WWzxziDT4hnFxahWEk4QkiIMXlbKqfAvHTub/GUMKCsGz31QdCnYTOVpSgIGc9MFwOstAh06PxkCvJXSWVlgDtZXcYjKBnLTXR9ojcHUFk73Sa0POoUyOfNzPMyKDtNYcPnpJ2tGSL2wZqokKs2BLk1UiGoCryeDNsX6UMhIrHZ2F7oHUajxaw8rMiFvWpx/NojnO8hH9gYt+yJbMRfDHoGHlwSdtOhWW/iY5l8l30YPI5V73jYj2PAovPMvaVlwh8cPHonQ4mfP44Qb68RgAA9xgA884qpb9lxGOCDf6Qp0tMAB23joIrHrgN/7rfctzSUr7/MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=i9mF0qu6UUysAhjZZ/593+ZnG5FxBiKqHQVygGTQ54Q=; b=a9r8fS0nCq76Zs+GaovOsGOpFBBDcTSMuij6Q7/iN1Sv9Z55sIpKwuMmpAFvVcz12oZp+SkfrnwkCsE4KLzI7hBCuPg3gkGkn7d9IyNKcBgzXKc8Ddrpii7Q2Riuu92cRNxsslIHr81vSyyf5Gc1MpyWIOhro7Ugwu1GqXjHKIlhwY5AytMDSCZmODsT58UC+i+fxvihTfPJnrbsnqs52sx4CiwjRfsB5P7BXFeIc/ifS/VjOUBqEV9PqZB7aXStquw+iUqf9KwT76cm3iqdozdPp2sdV6BdHNFOre+v40taIXz3NLgU72G15533WreRUUv3QW8lYivNVX6Ur5OgFQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=synopsys.com; dmarc=pass action=none header.from=synopsys.com; dkim=pass header.d=synopsys.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.onmicrosoft.com; s=selector2-synopsys-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=i9mF0qu6UUysAhjZZ/593+ZnG5FxBiKqHQVygGTQ54Q=; b=dUmhoihNFDGDBBHONr5demUmfwSwhQ8QCqCgneT5+cR74r9E5aUxxv/H+cw/E43egJFbcefSyE50fHswqUBPTtw5ZWZhYnouhLz8q6ULMvEIsXTtF46sbfewdKIZUEH6bRlxCZqvf0z27LUb0YGGc7wnHObGIFrSIrU2xmb/oTs= Received: from BN8PR12MB2849.namprd12.prod.outlook.com (20.179.67.153) by BN8PR12MB3012.namprd12.prod.outlook.com (20.178.209.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2220.21; Thu, 5 Sep 2019 07:48:54 +0000 Received: from BN8PR12MB2849.namprd12.prod.outlook.com ([fe80::b97e:5558:f857:df81]) by BN8PR12MB2849.namprd12.prod.outlook.com ([fe80::b97e:5558:f857:df81%5]) with mapi id 15.20.2220.022; Thu, 5 Sep 2019 07:48:54 +0000 From: Claudiu Zissulescu To: Shahab Vahedi CC: Shahab Vahedi , "gcc-patches@gcc.gnu.org" , Francois Bedard Subject: RE: [PATCH] [ARC] Pass along -mcode-density flag to the assembler Date: Thu, 05 Sep 2019 07:49:00 -0000 Message-ID: References: <20190903171357.26309-1-shahab.vahedi@gmail.com> In-Reply-To: <20190903171357.26309-1-shahab.vahedi@gmail.com> x-dg-rorf: authentication-results: spf=none (sender IP is ) smtp.mailfrom=claziss@synopsys.com; x-ms-exchange-transport-forked: True x-ms-oob-tlc-oobclassifiers: OLM:2449; received-spf: None (protection.outlook.com: synopsys.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: EPSOO2N6F527HidWZcZqn7N1lcBNQlEeoNy74zHTASqi/7wEbbW66/sOMn1m8f4VcRTr7qffiEoLdN2V0ErFjA== X-SW-Source: 2019-09/txt/msg00243.txt.bz2 It looks good. I'll merge it asap. Thank you for your contribution, Claudiu > -----Original Message----- > From: Shahab Vahedi [mailto:shahab.vahedi@gmail.com] > Sent: Tuesday, September 03, 2019 7:14 PM > To: Claudiu Zissulescu > Cc: Shahab Vahedi ; gcc-patches@gcc.gnu.org; > Francois Bedard > Subject: [PATCH] [ARC] Pass along -mcode-density flag to the assembler >=20 > From: Shahab Vahedi >=20 > This change makes sure that if the driver is invoked with > "-mcode-density" flag, then the assembler will receive it > too. >=20 > gcc/ > 2019-09-03 Sahahb Vahedi >=20 > * config/arc/arc.h (ASM_SPEC): pass -mcode-density > * gcc.target/arc/code-density-flag.c: New test. >=20 > Signed-off-by: Shahab Vahedi > --- > gcc/config/arc/arc.h | 5 +-- > .../gcc.target/arc/code-density-flag.c | 34 +++++++++++++++++++ > 2 files changed, 37 insertions(+), 2 deletions(-) > create mode 100644 gcc/testsuite/gcc.target/arc/code-density-flag.c >=20 > diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h > index 8dca0d2c4b2..05fba539295 100644 > --- a/gcc/config/arc/arc.h > +++ b/gcc/config/arc/arc.h > @@ -96,8 +96,9 @@ extern const char *arc_cpu_to_as (int argc, const char > **argv); > #endif >=20 > #undef ASM_SPEC > -#define ASM_SPEC "%{mbig-endian|EB:-EB} %{EL} " \ > - "%:cpu_to_as(%{mcpu=3D*:%*}) %{mspfp*} %{mdpfp*} %{mfpu=3Dfpuda*:- > mfpuda}" > +#define ASM_SPEC "%{mbig-endian|EB:-EB} %{EL} " \ > + "%:cpu_to_as(%{mcpu=3D*:%*}) %{mspfp*} %{mdpfp*} " \ > + "%{mfpu=3Dfpuda*:-mfpuda} %{mcode-density}" >=20 > #define OPTION_DEFAULT_SPECS > \ > {"cpu", "%{!mcpu=3D*:%{!mARC*:%{!marc*:%{!mA7:%{!mA6:- > mcpu=3D%(VALUE)}}}}}" } > diff --git a/gcc/testsuite/gcc.target/arc/code-density-flag.c > b/gcc/testsuite/gcc.target/arc/code-density-flag.c > new file mode 100644 > index 00000000000..1ecf1a2ca29 > --- /dev/null > +++ b/gcc/testsuite/gcc.target/arc/code-density-flag.c > @@ -0,0 +1,34 @@ > +/* Produce code-dense instructions and the assembler must * > + * be okay with it. An example would be: * > + * * > + * sub_s r3, r1, r3 * > + * * > + * While generally for _short instructions_ , it is not * > + * allowed to have different registers as the first and * > + * second operands, the code-dense mode allows it. * > + * This test is about the fact that if "-mcode-density" is * > + * passed to gcc driver as the flag, "as" must receive it * > + * as well, else it is going to choke on such encodings. */ > + > +/* { dg-do assemble } */ > +/* { dg-skip-if "" { ! { clmcpu } } } */ > +/* { dg-options "-mcpu=3Dem_mini -mcode-density" } */ > + > +typedef long long uint64_t; > + > +uint64_t f1(void) > +{ > + return 1; > +} > + > +void f2(void) > +{ > + uint64_t start_us =3D 0; > + while ((f1() - start_us) < 2); > +} > + > +/* This is a tricky check, because it hardcodes register * > + * numbers. Nevertheless, it is easier than coming up with * > + * a regular expression that the first two operands should * > + * not be the same. */ > +/* { dg-final { scan-assembler "sub_s\\s+r3,r1,r3" } } */ > -- > 2.23.0