From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2060a.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eaf::60a]) by sourceware.org (Postfix) with ESMTPS id BEBE1385B519 for ; Fri, 17 Feb 2023 08:01:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BEBE1385B519 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ak8DZnLps6VyNaTIbvYTxwX8a45mOENllIrJWQAkmSQItnKLsT6rpzbkMhmWJBi+u2yNLtnfIgDzFOcSy+Rx31RA4+aapfyy+KFzUDZjka/hCUz5zFChyvMWDiM7WEhxEugmZo3DwYK9fFNkFvEag9ezEa6SGpuNHkGxGJsfstW1vzLQiV3voP86rgz/YCEuOGgpOlBtepxK2sse9cnDYf7i3EJVtWiOrTTiUtUc+MdXXr46JBO00XkJCENWMVZ93QRfXCEaVNxypJlGjxAni84uLiWh5RdAwqV4OMlNduMg0WcFNSA8E3yjj/sPMPde+G6ONoSmy5ca7aho1PDpfQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=S3VfKym9rxY8DCuUmmfpfY4a+zQ3412cOoADi64spWg=; b=FUedL39ZFGdlLSMKHJ6eRNp9KIswkUZ9wkQdAejg+gLQJyo68lZn5wzA2BLPzucwq+lhMmmecc/YuoXOk0MpkApd3LNxCqZJFMxopgvb/3YO65BK6aYD3anZlo/Z/GFPDUv3in7zLHarJkmDQuNPX/iQ69iTOVHiWOBwqAmLFgSDt3ZUhlEkEtZNXjInRO1Jf4a3OwoLXF4KbfoXPnv4wxxiMLxsmDtZVsZRCDUDToXY/PYKTs5hVPlSmzNyTEdpWTNF7GJnogyxuE/U48NlMSIt3oatBjQC3TLXuG9FVLmhxS+ET93DAT1j2o546XJ02YSdUTJZFhAvc1JuL8ptMQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=S3VfKym9rxY8DCuUmmfpfY4a+zQ3412cOoADi64spWg=; b=dWpfPR7IN9dNOvoPEpxUnMgNRHq762qJu1JUggSztrGGUCZ5zKCvp34P8s/PwS45G6yopUTh6fgUaryvUf34TBEe1vb2hIpnCmWXRO9Hb+uRzeCmaB38ey0B3S/Sj+9c/DNRurI/1MSd77VuEWF8AoGiauVq38ym9ih4xpM+KFQULb2VJH2D5dnFYsyTxNoDESqQOXQzZBSqNtGG6xorrRTOZPFrBpb3gmDpJMqoSmeoFCNy0L19xbALrsUagtFPd+FQ8tea1v7y0KtzFUZeUuvGZcO/BDtArwEk5rI5uiezR1VHs8sIjllwZlT+oRNJfiXEmiEPByDB15zm4hIqJg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) by AM9PR04MB8604.eurprd04.prod.outlook.com (2603:10a6:20b:43b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.13; Fri, 17 Feb 2023 08:01:55 +0000 Received: from VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::e138:4fc3:705c:d178]) by VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::e138:4fc3:705c:d178%7]) with mapi id 15.20.6111.013; Fri, 17 Feb 2023 08:01:55 +0000 Message-ID: Date: Fri, 17 Feb 2023 09:01:53 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 From: Jan Beulich Subject: Re: Paired Nested Macroses Support To: Dmytro Tarasiuk References: <01350d86-628f-77c0-4fb2-dbffeaf8219d@suse.com> Content-Language: en-US Cc: Binutils In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR2P281CA0051.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:92::8) To VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6560:EE_|AM9PR04MB8604:EE_ X-MS-Office365-Filtering-Correlation-Id: 3505cba2-d61a-4f92-1e65-08db10bd3c5e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7zwafPNe0H9WFhIbKrL0wT+Nr5f+C8JA/2DTyWCbqY4lLpeFNkQYrKZjz/2vDQ+LCisdnKo2EyzqW7wq3XEPR3Vs+0jRqLT4BksijoU/Lr5NZIRCwzwHs3a3rU5Is8TdTmcIS2GHv3z3cSZu2wNy9oYUvruYpgZJrtmIWqpYMqpVjig4fMtG0r2800qPhrty4CQnEVYcl79GfI6xZlX/jeonpwSKju3f/ceh/Z5HKzMgCqFAJVfxLyZ8krCTiUc3n5po4BrG+wuyGMcp5OiRXh8fpL398+NWJVfwwmkekI+L+zIL8ADRe3yGWANWiPJHsc8Foi3K+wX+yod5Z2KiedNjyc+3Trwa2xlIo1e9mH55edZeTg3uJ9zcwdcPry49/YcAdUmI9XqBPqyHe/XNbyhqtNaiyHNZ/FsixCnODdlZX7YUylhI3LbsFz1u8U8QlSbcV1Vi8tuGh5KPCccVjQrjjrFoR/XxQxS9hsNVk1ixKA+NY1T9VicbXb7bXBwp4PtltOkV2cB1U0h0jOd1/JCMEayhQePK2n4kSX3iEHpLDYdnW0I9NZ9XzUK3osY4d3DE9bK306K1vIwOrzrnpfItfkXMw4bcKasOAEdpoXArUmVveFG5i9uWkAwctY9UBxvJRJM8CmEXZMBPFpHgvAdxNoLytFocrtESQXwGPup6dd/xjOyey0qjM977SD9rhov/kCuff6MX9rc5gygY3A5Rmgl0MyLA61Y3DOOphKg= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB6560.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(39860400002)(366004)(376002)(396003)(136003)(346002)(451199018)(31686004)(26005)(36756003)(2906002)(316002)(5660300002)(66476007)(8936002)(66946007)(478600001)(41300700001)(6916009)(8676002)(4326008)(66556008)(6486002)(6512007)(186003)(53546011)(31696002)(6506007)(86362001)(2616005)(83380400001)(3480700007)(38100700002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?eGFKMVpIbHM3RXg2NWFhbEtOZlBneklXQW5lK0kyQ2pRZ2N3bTBjVzNEa0Zm?= =?utf-8?B?cWU0NTBJT3hjWFJCaVZRK0VXSlNDa0lwZFUvRmNNTThzL3dLeS9JSDhMOGVD?= =?utf-8?B?Tm9zZlhMeXI4WWJ1OW9qY1JrVjVBN2lVeEZLbEhGR2FYTldrVnB4U2hTZm0z?= =?utf-8?B?d3Nzc1JYbmNjZ2dJejBST2NqMGJlaUltYXc5Zm5vZ09CMW1Tb25NaW13L09z?= =?utf-8?B?cGZKU0ZUdVBWZFdkblNjU3dyTXBGd1NlcTl6czJLb0tPSUxCR0xKdHVGMlhk?= =?utf-8?B?SjBHRTJUWlB0em5wWDNY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yVE9I?= =?utf-8?Q?QQ2YKTpAxAHS0qE+3joeJTLAq?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3505cba2-d61a-4f92-1e65-08db10bd3c5e X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6560.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Feb 2023 08:01:55.2127 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: F5UK+k+3rFEP3eOeN/LSk2gfcldN5J/gBVc18V7be88NONehoBhROf0+v0YqR5V1QJ5I3vXTD9h4OV4QSqkKzw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8604 X-Spam-Status: No, score=-3028.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS,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: (re-sending again, since you _again_ dropped the list from your reply; I'm not going to further reply to private mails you may send on technical matters) On 16.02.2023 23:28, Dmytro Tarasiuk wrote: > On 16.02.2023 18:31 Jan Beulich wrote: >> (re-sending with the list added back - please don't drop the list when >> replying to earlier list communication, unless there's a very specific >> reason to do so) >> >> On 16.02.2023 16:06, Dmytro Tarasiuk wrote: >>> on, 16.02.2023 10:04 Jan Beulich wrote: >>>> On 16.02.2023 00:37, Dmytro Tarasiuk via Binutils wrote: >>>>> Writing paired nested macros is not possible in the gas macro >> assembler. >>>>> For example, BEGIN/WHILE macros for loops, etc. This is important to >> me >>>>> for writing portable pseudocode between different architectures that >>>>> supports gas. >>>> >>>> Without explaining (perhaps by way of providing an example) it's unclear >>>> what you mean here. >>>> >>> >>> Excuse me. Here is an example of the macroses for nested cycles: >> >> Thanks for the example. My first conclusion is - there's no nesting >> of macros here. Instead you want multiple macros to interact with >> one another in a certain way. I think this can be achieved without >> patching the assembler, using alternative macro mode (.altmacro) and >> the special unary % operator that this mode supports. That may >> require helper macros, yes, so the set of macros overall may end up >> bigger (and uglier), but that's still not necessarily a reason to >> extend gas. >> > > a: > DO > [...] > b: > DO > [...] > DONE_WNEN > [...] > DONE > > Here is shown the pair (open/close) connected with one another macroses (DO > ... DONE_WNEN) which are nested into another pair (open/close) connected > with one another macroses (DO .. DONE). To work correctly there must be 2 > counters: one for the sequential pairs and one for the nested pairs in each > sequential one. These counters allow generating unique labels in each pair. > Current macro language including altmacro features looks weak to be happy > with it. I have paid a lot of time to find a decision. Could you show me an > example how it is possible to do without patching even if it looks ugly?. I'm sorry, but no, I simply lack the time to invest into putting together something I'm never going to use. >> Furthermore ... >> >>> .macro DO >>> LABEL_DO\(++DO)_start: >> >> ... while this syntax may indeed have a low chance of colliding with >> anything people already use (simply because it is pretty unlikely >> for anyone to use two + in a row), ... >> >>> .endm >>> >>> .macro DO_WHILE cond >>> j\cond LABEL_DO_WHILE\@continue >>> jmp LABEL_DONE\(DO)_end >> >> ... this is a problem: There's nothing wrong with somebody having a >> construct like this in an existing macro, while at the same time >> also having a macro somewhere with the name DO. If you wanted to >> extend the language, you would need to make sure that this cannot >> break existing code. >> > > There seems to be no new problem here. Macro conflicts can be resolved by > scope area, etc. How is .macro DO .endm .macro M pfx:req, sfx:req \pfx\(DO)\sfx: .endm suddenly changing behavior not a new problem? In what you propose nothing in M identifies that \(DO) is meant to reference DO's local counter. Right now the DO there is substituted in literally. Jan