From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2089.outbound.protection.outlook.com [40.107.7.89]) by sourceware.org (Postfix) with ESMTPS id 2A21F3858CDA for ; Tue, 10 Jan 2023 09:25:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2A21F3858CDA 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=gle8lvkilHhcHxIgCDS3RpLQcl5THzRYg6brEQ2pBBiJ8Kx8+lPwqwoRa9LOD5tE1puitX5ojeNuRCUkKlascR/wG4AUEFadP+z9yggfkJoQQimkIREdbS+81aiGVkB+ubrPhLpC/mLpllTVFfFV2VwUTKt2+xtPUByPiePY2xFlgGCvph0i9EqP5azTtg4IRZVDE7Y0+JevYR9PQkHYVV5hv/YoWcMS8W0CzVMczoUPBHnn056oXYk8uCG5OLppPvxUjgI6VpIij7trtHJNytuczz5sChuJlRotpNKT0ABHrSOEe6gk08Rh/yHXmnmueEFHF28zqwXFNsDJwgEK+A== 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=YuyA5qYs+eK09PxUG9kMntr6OphBD9BRni8dpfrP1yc=; b=KDn+h8ewyUdlY7wdODABL5cIT4CGsYQWsk2pup4fGtcRozb/zyOFKdAkAB7nAU1mGy7yfooNO4zq1Atv+mhAg/DUS57T+A0D/WZrL0wepoMcJcZd7v5MHBO6z1tpBFKoa9835fVHi85rqhB1xYyIYKUMv5LSyxJdSkAtWIJC/+VgXvkOrgG0NNjaTLLSOrJPMi2fEHZUFPjeyr/hGAYrSgYRM1GjYxYKknukNz7vwUeSUuxBs4cVS/Ff1K4PjO0mcNb5w3ZBd25w5KIre4lzAyGpmv1gZPr7CT+dRzL6E7tutdu99YLCR3BDJOCvjiBKucDHSEbvYB3OAPTONE0PnQ== 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=YuyA5qYs+eK09PxUG9kMntr6OphBD9BRni8dpfrP1yc=; b=CahMKjzRDQX6bf9W5yLmjGcYvWJWVtKRY0lP5ZI01AVYRBPbWoXw3Dtw50QblGHFYnlL9Fc3zxrwL5e4c0i+eti/oDJlijiE3/NCc/DqfSatySw1+ulxJAV7NfaIyHcNoM/F8bzMEeQzgEmyoKDlAEhpAGskKYaTUpUBNR7BExo9TqP2AqyO9tQyZ/kQZ1eHax5yTkP/gq6mFQ1z4gh+zX6IaEqUZl8vtWKCwzEAjInOUeL1Elr7T9AUDAvb0APLDNTZ8O2BETelsVQbgfjyAY9GciLpxIA4UNJUid0ywKoGcwHKM+OTPCbXHbZfTY4iu4o6l5yR5HJ/PG3CpvMRfg== 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 DB8PR04MB6777.eurprd04.prod.outlook.com (2603:10a6:10:11f::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.19; Tue, 10 Jan 2023 09:25:06 +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.5986.018; Tue, 10 Jan 2023 09:25:06 +0000 Message-ID: <4a67f41c-3473-3833-c0fc-ed4f69a062e9@suse.com> Date: Tue, 10 Jan 2023 10:25:04 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH] gas/RISC-V: adjust assembler for opcode table re-ordering Content-Language: en-US To: "Maciej W. Rozycki" Cc: Andrew Waterman , Jim Wilson , nelson@rivosinc.com, Nick Clifton , binutils@sourceware.org, Palmer Dabbelt References: From: Jan Beulich In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR3P281CA0064.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:4b::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_|DB8PR04MB6777:EE_ X-MS-Office365-Filtering-Correlation-Id: bbf53ca0-0a8a-456e-dedb-08daf2ec8f5e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dwpIVdOBNS1XuYy1CAQWknOfBNMrYvgV8ekNEiF2CglrNYCcY5WS9OaZw1RYHUNCHpkjdp4QeNNFDvK35mR0oZMySfnrn+wt87R2PFa6zXFoyjo32R51cUEYknO73Zeol2dDxRtZmcR3/flW257bVYySwu8sGz0IHYzZKjNmBb/T29a4MV2PRAfA/n2V/MMtvpkoilFo+PzWs/bpqYFFj3pvj2+mkUrcisucDKP+XpDxeoVGeIfSyzt9Mo5PxCHr4uy4zMe7l56nzts4FvZO5dF8Dws7dactbeCvj+zHj9WZ6/A78KLSQolsKagu9QrLsDiYr5v6rrxoFvn6HpHN5bS066WVRlVFoZ0/anaoOvJpzdSHKtPy0q5FCnFV2Rtw8jGL7gxJZ7PlNOrY6RXyg0iplDZFuNgUuls3o5NPv/qrpZQsop60wFRSVdjV8GpEGnbKyIBW++1brlz6odRuSCxkII2yKFfwHAB3P71PpWXUlbbLU3zaJ+ZR68gfvZjk57SHDCaWN8ktxb7rcfX8I7LfzbBrcX30WQi84uoP2RvnQDXN5OeQnkjBlA55hnojVc8+aj+jgenaIe5r/SoWEFYAZWxGcAXTVFKK754Ngv+yy3ZHSlISxlTR2wJSt7tvPHVavnA/Oz6Ldf+eCQgdqzLWvuKHK/pn0nppAJn/7oNqes5bIZdJg7JVfeQk7bH6J/sEKcw+dU9dPnCa+rhtFSoiCqEMsxS8tFsNZJJ6pL4= 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:(13230022)(366004)(136003)(396003)(376002)(39860400002)(346002)(451199015)(186003)(53546011)(26005)(83380400001)(6506007)(2616005)(31696002)(36756003)(38100700002)(6512007)(86362001)(31686004)(54906003)(41300700001)(66899015)(2906002)(5660300002)(8936002)(6486002)(8676002)(4326008)(6916009)(66476007)(66556008)(316002)(66946007)(478600001)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RHJyWHNmUXJ2SmhkS1RleTI0SVBMRUtNN3VQdk5nTHdJL1gzaVdoVi84THpY?= =?utf-8?B?ckdpbEV5YVdESGw4OWJVNmFvaU9rOGJDNXVZcllsQUdlQmszbzJic2FxQmRj?= =?utf-8?B?b2gzV1Npc2dIT3g1dWQwVDd6RTVCd1JZQUNGWDBSRVMraXFqcXFxcWJyYUhk?= =?utf-8?B?T0RZd2tSb0tObmIzRHZCK3hSbEdpZEhrbmVZVERSdkFsS1VDSTZ6SkROM1h3?= =?utf-8?B?eE8vZW8yd0owM2V0SW1Eai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XdmtvK2t2WWVs?= =?utf-8?B?bTdEanVFRno3SmFVaDkzRVc3WmM1amVLdml5Y3MyT3h6N0RNR1prWVRUMlBB?= =?utf-8?Q?kjp9862zSbK6SleJY/V37XI+z?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: bbf53ca0-0a8a-456e-dedb-08daf2ec8f5e X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6560.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2023 09:25:06.5409 (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: 4zlOiqMqMT3Ycbyy+T54VzNEE5UBxP+RuhHzW4QAiluW5jd6pohHXvq8PVUzsGLJUDMwFhpI7KeuflqO0wCllA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6777 X-Spam-Status: No, score=-3028.8 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 09.01.2023 22:59, Maciej W. Rozycki wrote: > On Mon, 9 Jan 2023, Palmer Dabbelt wrote: > >>>>> The similar workaround in my_getSmallExpression() actually looks >>>>> suspicious to me: I expect that it would get in the way of using equates >>>>> "shadowing" names of GPRs. >>>>> >>>>> --- a/gas/config/tc-riscv.c >>>>> +++ b/gas/config/tc-riscv.c >>>>> @@ -3266,6 +3266,17 @@ riscv_ip (char *str, struct riscv_cl_ins >>>>> continue; >>>>> >>>>> case 'a': /* 20-bit PC-relative offset. */ >>>>> + /* Like in my_getSmallExpression() we need to avoid emitting >>>>> + a stray undefined symbol if the 1st JAL entry doesn't match, >>>>> + but the 2nd (with 2 operands) might. */ >>>>> + if (oparg == insn->args) >>>>> + { >>>>> + asargStart = asarg; >>>>> + if (reg_lookup (&asarg, RCLASS_GPR, NULL) >>>>> + && (*asarg == ',' || (ISSPACE (*asarg) && asarg[1] == >>>>> ','))) >>>>> + break; >>>>> + asarg = asargStart; >>>>> + } >>>>> jump: >>>>> my_getExpression (imm_expr, asarg); >>>>> asarg = expr_end; >>>> >>>> Thanks for the patch. I have tested it and confirmed it fix the problem >>>> I reported. >>> >>> With 2.40 scheduled to be cut in less than a week, may I ask for an arch >>> maintainer's view here? >> >> Thanks for fixing this. I don't have any issues with what's there, but looks >> like I'm also getting some failures (glibc/multilib errno related stuff). I'm >> trying to bisect those so I can't really get a proper test up now, I'll try to >> do so ASAP as it's really late to have stuff broken. > > I wonder why the RISC-V port needs such a hack while the MIPS one > doesn't. Perhaps I misunderstood your earlier reply then. There you said you deal with this by carefully ordering the opcode table. Here restoring the original order would only be a temporary workaround, as it would re-introduce the disassembler issue that was fixed by altering the order: Alias entries need to come ahead of "real" ones, or else respective alias mnemonics would never be emitted by the disassembler. Hence a solution is needed here which retains the order, and which also respects that insn operands may be parsed - more than once, - with identical names having different meaning depending on context. I realize what I'm doing is a hack, but I cannot think of anything better. Jan