From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2054.outbound.protection.outlook.com [40.107.20.54]) by sourceware.org (Postfix) with ESMTPS id 363243858C5E for ; Mon, 28 Aug 2023 06:17:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 363243858C5E 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=Uh1N+ZKBY5BDi7RbxfJPsZAhdqZaUpwEE3QP0vW0VEb5EFdSrzNS6Mjtmo9760ASeC/mSBGfCrHbojx3Cr+pES9n+Iymc9t331dQ70ywSMC1+UmzhoPlECEOn9Zn6LzLrR++6uh4R3y1efND8RhogQjI/A62ACY8sSPPsUJUoB2abfMjtUXcD7pK79NEkqs76PjDGUPtvzWXpToeQ5fwL+vSZnVvodBwvywWXxPUepvCh28rHSWrwOr82+5aqtjtEfeDR3qK1usnhT9UkeBtxzjfAgRGtXyEMqXKFOCDu7efIKPgSDGY/U/cf6cceeiFIgin104QZktaxe5rH6Ecpg== 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=UE8LtiZ/ryjnSO+BD4NvQFGi7B922RCDxh76ApGR0to=; b=R47cqOhmElLHyoBhUtbyXyOTWPsC59odOkXuwXQ8rT+OW2q6WzJSioyiB80SmYj73k1zdvpWo7yj9GvUovNrIbcGZcw8cgQqGdD96e+qJpu/+Vd2lNijKhCseARPdMN7HWidpnKWWLFGq9wdflLAb57Mc4ULUVyA3x4MkYS/MP/ltJmpJdU55UshiBzwWGdvhKZzFypczUrfCrmsfzjo2KL2PW0wkHTfAs5vjiWXz6jgfLTrQmUweqiUum2/mO0SfLEtjZlHgoULLQQGdc/93sePQ7RGRh/BWBAC+5s2l9srfkIHL8lduxnf+mUvqTxiutpavG58koeIt1D3lzkz7A== 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=UE8LtiZ/ryjnSO+BD4NvQFGi7B922RCDxh76ApGR0to=; b=5ME+wXnqybohCH6ql/OvFV2rupaq/yIucYAgcZv37lp/jsiaV6ppp/SbvnhCCa4E0f5uw2QV1QRvdGaFPOMlOgiPbjSH15SL8hETAkFzyZ37XSTEivL0wA57TffvPlS4H2Cyla+eTTL9aqIP5YrYF130mHqIXndLr8m+PnVaXJmeO3T0/bxqa9QgyWApKCHpxdafWeyfsC7l0N+7QwiuNtMd6C2AlHPSgaZktjGvSpi02ITVMfmF3mUJszZTuf20MR9Z6z2X+TB0ifYk4o9A+p+AoRnuEl6iHmfcyGJo3G3LkHvAXdg2WiMITSxDTKL4t/3fVT654WTkwDw0W+FHJQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) by DU0PR04MB9695.eurprd04.prod.outlook.com (2603:10a6:10:321::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.34; Mon, 28 Aug 2023 06:17:47 +0000 Received: from DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::f749:b27f:2187:6654]) by DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::f749:b27f:2187:6654%5]) with mapi id 15.20.6699.034; Mon, 28 Aug 2023 06:17:47 +0000 Message-ID: <3a591c4f-806b-4c40-f127-46bd9a065206@suse.com> Date: Mon, 28 Aug 2023 08:17:47 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: P.S. Follow up to my last post To: jacob navia Cc: Palmer Dabbelt , binutils@sourceware.org, Paul Koning References: <502E2019-6C30-45ED-9EE4-A5ABAABBB750@jacob.remcomp.fr> <8C7981E4-01DE-4C70-92DB-6C711D95D710@comcast.net> <44B3B136-BE36-4D9C-AF87-B39228860B27@jacob.remcomp.fr> Content-Language: en-US From: Jan Beulich In-Reply-To: <44B3B136-BE36-4D9C-AF87-B39228860B27@jacob.remcomp.fr> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: FR2P281CA0020.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:14::7) To DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DU0PR04MB9695:EE_ X-MS-Office365-Filtering-Correlation-Id: b33209c3-ab1c-4942-eda0-08dba78e7fc6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vY4hL4q4JAR5oFUFW3UhonHYBFbDUnFdBs2NmKo+Ndm6mG4eVq1BJwJun//QEX4bXprLc/KM4b15TvkGXGR7OPNWsOt1MX5LYrfVA/M7+q4PaVYy0uTGyXamMRg+lgoVF0Db5ikMVe6Hwflv9QKIzPZKHzKaRLL/KYlZB/boA4zApwn3nj6++UaiY5mcwPRjxrIhkCEidIs1hENL0dU5aIhu07mZ3FKsUZLGGNPN8V7e5poTRNDt7oYde4oFBkdZyQIl6YsBFiCukfSvvhbXG1HGll1P6sqVK9cZcLFfhyt3mt5tRHAccqn+2PDlwgSzn4nFUsgqbWX6cCATOmzytGPiDq/rLqybvCw3OHq7hQB+fhS2FpxOKg8pv+RjHltiL82eHg4R8oO3JmcNMK6cCcDa5EKGC4iLnTxDB2cg7hADm3sUtTzbVQ2dJVQk35D2rM+Xr8oNv1sWdRpHQtCYr1pUFEPTFTp+HmX6aROouFa9uXtp9+P9xONxFr+JMp62cv1ncjfevASVfRhaPaJHMRZsLDM3MakyjvRUHl7dIOe9vpPTmdUNB88Byfpoo/XlpcGlZsUNloVk8EG1yHfI+ohDuGfrKupKkKFCZC/aP0V+JAO0jcYA6wXcyDc88lRMgBln/ypgkSZT3ImSHC58rg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(39850400004)(366004)(346002)(136003)(376002)(186009)(451199024)(1800799009)(5660300002)(2906002)(4326008)(31696002)(38100700002)(86362001)(478600001)(83380400001)(2616005)(26005)(36756003)(6506007)(53546011)(66476007)(6512007)(6486002)(41300700001)(54906003)(66556008)(316002)(66946007)(31686004)(6916009)(8936002)(8676002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZHZ0M0hBTDlZQzRzbGZwTm1NbGhaMytCdmVYZk1wVUYyOEMyQUVBT2xzMEY0?= =?utf-8?B?T1RzZEZqcmRTbWxOU0pyWlJtYzVPWlNjZmRnOS81dFZ1R3lheHdaWHlIaCtV?= =?utf-8?B?Zm9vNlUwSkFJNXlyMXM2dS9LQm5sTFR0YmVJTXJFU0NaVkFSUzhCSWZXUzUz?= =?utf-8?B?OEpIRk92VXZKdzIybzVUb04xOEkwckdGQnh6akYwM0dpWmQxK3plbFF3S09Q?= =?utf-8?B?WExUUXp6bmp4V0VSUjMwK0RIel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SUxqTmg1MVJhS0x2Y3dxZUlYeUpQT0x1eUxjQ3krMDh0ekwrVzI1ZmlV?= =?utf-8?Q?fud8Qzy47KmyBzDMQI1SkeSon?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: b33209c3-ab1c-4942-eda0-08dba78e7fc6 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2023 06:17:47.5984 (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: 6EAameHapuK0unYK15dOG/K0CYAHtWFUDVujCEYDa5Izn9y0oQqgUBoIA72E0DgnvhXKCEAa4i9mvv+RuwnMUA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9695 X-Spam-Status: No, score=-3028.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,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: On 25.08.2023 21:44, jacob navia wrote: > I am just invoking the assembler with its default settings: > > ~/star64 $ as -o test.o test.s > > The assembler is testing the default architecture here: > Function: riscv_ip > > for (; insn && insn->name && strcmp(insn->name,str) == 0; insn++) { > #if 0 > if ((insn->xlen_requirement != 0) && (xlen != insn->xlen_requirement)) > continue; > > if (!riscv_multi_subset_supports(&riscv_rps_as,insn->insn_class)) { > error.missing_ext = riscv_multi_subset_supports_ext(&riscv_rps_as, > insn->insn_class); > continue; > } > #endif > > The #if 0/#endif were added by me. I think those tests do not belong here. The assembler should assemble and not test if the instruction is legal. If the instruction is illegal the program will crash at run-time, something not that unusual if you are programming in assembler! Having a program crash at runtime when this can be avoided at build time is deemed undesirable by many people, including me. I did point out before that there are two approaches for assemblers - default-enabling everything and default-disabling everything except the base architecture insns. To a large part this is a decision to be taken by the people writing an assembler. But there are technical constraints as well: As soon as you have two conflicting extensions (which RISC-V was always allowing for, and which it now actively has), the former model won't work very well anymore. Of course you're free to propose a patch allowing the alternative model (via command line option and/or directive). Obviously whether that'll be approved is unknown up front. > And if you are assembling compiler output, it is up to the compiler to furnish the correct instructions. Yes. Plus, with an assembler following the former model, the necessary directives. (As an aside, compilers aren't bug-free, and hence the assembler still applying some sanity checks makes some sense.) > Tiny-asm doesn’t test any instruction compliance and that is why it works out of the box! As said, which model to use is up to the writers of any particular assembler. Jan