From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2065.outbound.protection.outlook.com [40.107.20.65]) by sourceware.org (Postfix) with ESMTPS id 32BE93858D28 for ; Wed, 25 Jan 2023 15:02:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 32BE93858D28 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=NlQe9lPdJ08eLxvHtHNxTocfstA8IG1XEmMpl/KateM42BW7utlHx3t0xsf9cJ5QWBRG3jPUZSAXH/maDsL260SVeff2SIbUMgNlNsp/pRzKkHr8CkqXUpXZgQ9lmnUUPjjyyJY46iScj7/EVCO57Z2NO3jUox2WuzrEHAXIcrTLtuDEnHKVYdFEPIWUhl3be6Ew85XgkqK+5w8xmIeC8oQPzNOfibzcBEUnIdnHFdxlCjaqwJYe07l9M14EVadcA2AWTXAr+R88xctERJiTUTffnQd41Z2PNzNu8MT4bJndgOPNdpD7CE024Xt4+/wzMzsfmOJcIMYnFX/oDu/sNA== 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=xxON6X47PQxqqxbpdhqlQg0oQBA2jHlIYa0Jy80p6M8=; b=S+q4HcrRVTipS3HfuG2ZnimNBlb+BmbiwtIDhLjaashLaL6tTqYfawriStjHFgqkI2/ONjejyd2PWwO4zDyyUuG0M2on47jUtEx0e8aGtb9wmYCA8itBZ9vhTKjxSPVrubFh9Wsz/ikaIN3e2DNHpwQ4xBp6HlP0HELIoZnVzZOCrNI7XU6WB4umnHftNUV3EhFsbokl5ttnToNtM7OUw5nbuAmCTvLLfppYh3ztxRy4uim/YH6Zqnt8IbujTJdLtZ2XEIWzfRlCoSTOd9agyHGY2bPB96E+LdsGx0vggOmlycony0I6Ahbno8fnB07mfXD1m17usC//x1rtBSu8OA== 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=xxON6X47PQxqqxbpdhqlQg0oQBA2jHlIYa0Jy80p6M8=; b=K7AuNyrnwFBQNJGgEhfRe44YK7STsc0xU+JrzgABx9EhSVQyEpiitFQZnoYuf89D4mzQ/mDTagq5PwCfrNQ+1NzFNZNYykAWRIz0yVlVHiSX09VwQQ/EWFP5F6Ym6nzqjn0Cv6q9zp6ivxbdMWb30EVNjqgEEeHf6Uffq9rWRyK9qd42joYCLBgMRyTHi4GpvW8xahFD33WzzL9OYW8GQtdmX16Xrh5PlFXJnyg4C/XPNsoim0XUrGRlJ6QF7R5dyNEp03MkdYo2DcY9vjRO0WM/3HitFizE0DLBK4DezeuqDwG3tSchHZh89YDlF6UIbSS5WTiO9TnDCawvF03B2w== 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 AS8PR04MB7557.eurprd04.prod.outlook.com (2603:10a6:20b:294::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.33; Wed, 25 Jan 2023 15:02:52 +0000 Received: from VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::2991:58a4:e308:4389]) by VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::2991:58a4:e308:4389%7]) with mapi id 15.20.6002.033; Wed, 25 Jan 2023 15:02:52 +0000 Message-ID: <54e213db-3268-e7b5-6f11-09dc14a1a49e@suse.com> Date: Wed, 25 Jan 2023 16:02:50 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH 1/3] RISC-V: prefer SLT{,U} aliases for SLTI{,U} Content-Language: en-US To: "Maciej W. Rozycki" Cc: Binutils , Palmer Dabbelt , Andrew Waterman , Jim Wilson , Nelson Chu References: <678b275f-1930-4a59-dfba-fe21cd548fca@suse.com> <95936261-d824-9128-1be9-ba7dfe12b042@suse.com> From: Jan Beulich In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR0P281CA0122.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:97::12) To VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6560:EE_|AS8PR04MB7557:EE_ X-MS-Office365-Filtering-Correlation-Id: 5785a013-ec0d-4631-f274-08dafee53b3a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: USfmoGCQ35MRDLWag9MAwPyVjigp4KyE+xFXM1gxH1pw9mIraLJYLhYoJ68Hkp2U/jkvYu2FZ5C4UaeMRQyIAfIJvthxweNNOk/d+Z5gMJoVVctcpMiU3+kcRF3DEJr13sFDppcfHIDf3W9XcCyJO3pVUYUK1t457I8RLSjFOZ9mBN1jLVBWMZss3DMMCmSOl80kQM32n+a8cGkRtfEfqZVtmccOMFbTLZxockgLW5QM3LkE6yhGyPbouKxTWidfQ5CixWjZCdiqAGjFVg2zoiq1qACFvh1CPn++k/pMGyWnUcXxlH+apT37Nod8tKyopGIbA4MNbTHxZd0P/3wCQMOJKRtG06bOFOxQuKx/ZnNNhQtFlAvyrECoQ2utm3oL4wSYpXc8D6PKcZnFKH0VGINtysWGnkuhOwZP4tq2BFvB/NHJUS8/E2TohSoRBIcdxg5SFsjOYEcerP7n1o4dPJDVELjd8UfV42K/1gq39Jz79ec7aFfHh0PcRsqdW7owrvTx1O/meLOsuhH2ht5amqcdLuWk7lt0eFFshPRyA9hs3C4Bjl8LiUy4RTTEDkQUsnZKHRLdUvsa+lpRRMVJoA0RjzUNjZNFN/Zb7tYJAQTYh5dG6HICe1xEmZmMcjAbjud5aeZYa3eyN8G7mHbiczcMayz0CqTPCfphj0SnN0FO+Sck3rbpJXFl+utLvYF024DN808heZQGNaQo2Ud1G8xGv2i6jo9IuYMq3GCDQSo= 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)(396003)(376002)(136003)(39850400004)(346002)(366004)(451199018)(36756003)(38100700002)(53546011)(6512007)(86362001)(8936002)(41300700001)(6506007)(5660300002)(26005)(66946007)(186003)(66556008)(316002)(8676002)(66476007)(31696002)(2906002)(6486002)(6916009)(54906003)(31686004)(478600001)(4326008)(2616005)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?cGRPbUlWUDJNclVzNUFvZmczQml6TjdwWHp1UXpISDVRa3lrb0RwQnpnRkZt?= =?utf-8?B?b2JPWXU1Q3oxcURHM0IrRS9FWkh2ZStST010VG5JdzRjYVB0MEIzeU5pd3JL?= =?utf-8?B?MHN2QTZYeFpTOW5MbGxLOW1HOFdkMm9vQ0JLSHlMRnduRE5Cd25La0E1cFJt?= =?utf-8?B?UWl4WEU0SHBxVnN2bERYZ0VKV0JpNUtkNktsYVFocmVtNnJ3NGVGWWNCMjZR?= =?utf-8?B?e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RrVjdVU3NIQk5UVmxJTFhoWnc5?= =?utf-8?B?Z1BTbUxmZWEwVjhkYkhWTUFIMUxTUHdmcE9KWG1XOFYyWExWazdMY3RUY29D?= =?utf-8?Q?vTIvsK93txngnoEjf49tTFNPP?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5785a013-ec0d-4631-f274-08dafee53b3a X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6560.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2023 15:02:52.6030 (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: C3baqrX19KxENXdgNOmg58kEUsE1Rq3DcYw/lstL0i7RK9mKMGdJZpfO2S5gdQX4zweuDUK3YgYiuPLsDMxauQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7557 X-Spam-Status: No, score=-3029.2 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.01.2023 01:42, Maciej W. Rozycki wrote: > On Mon, 16 Jan 2023, Jan Beulich wrote: > >>> I think this is going backwards. Aliases are used in disassembly to >>> improve readability, e.g. to show `nop', rather than `c.addi zero,0' which >>> would make anyone scratch their head, at least initially. >>> >>> In this case there's no improvement, but obfuscation, as you're losing >>> the clear distinction between the register and the immediate instructions >>> and one will have to examine the operands to spot the difference. >> >> I can see this as a way to look at things, but then there need to be >> changes in the other direction (after all patches 1 and 3 here merely >> follow existing practice). Plus, perhaps more importantly, if you >> don't strictly prefer aliases over "real" insns, then first of all it >> needs establishing (and writing down) where to draw the boundary. >> >> My view is that the "i" in the name is needlessly distinguishing the >> mnemonics from their non-immediate counterparts (i.e. I view >> "improvement" vs "obfuscation the other way around"). I'm surely >> biased from architectures like x86, IA-64, or Arm, where mnemonic >> names don't try to duplicate what's expressed by operands. Much like >> you ... > > This is however what these instructions have been named in the ISA and > the assembly dialect. In the case of NOP, MOVE, etc. mnemonics they are > significant assembly idioms (usually mentioned in the ISA manual) and > there are sometimes thousands of alternative encodings that could be used > to effect the same operation, but only the chosen canonical encoding is > disassembled this way. Aren't you changing topics? Being able to use alternative encodings to achieve the same effect isn't what we were talking about. >>> The alternative mnemonic forms for immediate machine instructions are >>> there (NB pinched from the MIPS assembly dialect) to make it easier for >>> people to write handcoded assembly, especially where macros are involved, >>> either GAS or C preprocessor ones, and not for disassembly. Conceptually >>> they're assembly macros that expand to a single instruction rather than >>> aliases. IOW it's not a bug that those are not considered aliases for >>> disassembly. >> >> ... may be biased by your MIPS experience. > > It's rather how the assembly language has been designed (FWIW the RISC-V > ISA and assembly dialect have been largely inspired by the MIPS approach). Well, such a design imo ought to include a clear statement on uses of aliases. Iirc at least the 32-bit Arm ARM is very precise about what aliases exist, and it effectively mandates for at least some of them that they should be use in disassembly. As said before, I'd be happy to see things move in about any direction, just as long as the result is consistent and hence observable behavior is predictable for users of the assembler and disassembler. > NB the POWER ISA also uses different mnemonics in its assembly dialect for > immediate ALU ("i") or indexed memory ("x") machine operations vs their > register or displacement variants. Of course, as they're permitting plain numbers to represent register operands. Jan