From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-xe32.google.com (mail-vs1-xe32.google.com [IPv6:2607:f8b0:4864:20::e32]) by sourceware.org (Postfix) with ESMTPS id 2B87E385625E for ; Thu, 19 May 2022 03:40:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2B87E385625E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=sifive.com Received: by mail-vs1-xe32.google.com with SMTP id o2so3916731vsd.13 for ; Wed, 18 May 2022 20:40:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mXiIjGvoRLy/mB45ujU82WpfVX/AYPieFbfCNUbDIXM=; b=c21K+MrjoX7rtstDFlktthpF0nTFHghkOXhga15gIZt8ZdiebdMn14pFiB8u2sc9/U 6Qz2TdlTY50edIRDt1bYXYaDjmn2R6sJQEoBVcokheLYV0qWz3uo3OxBfsyAwjRf4h1H 8wxRD6kybqBXx5WUfIw7+OnWMI5qlRB/E7y4DThWbvKG52m35+2GeDthSIhphkG0P1OI a21Rc1qngjeY4D316EF/TdjL+4JS92CQzPT28Zh6qAX3KXezMywGc2wStfId2HcuOxWN AY6pVQPZ32tr59rrxrUNSQi0IR0ONp52ZcV8SdE5NO990Tz42xs2Z8kwhiF2DMxK3EF2 Zd7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mXiIjGvoRLy/mB45ujU82WpfVX/AYPieFbfCNUbDIXM=; b=6U2DuJ+PhPAHAC+RDC9P67kSQh4O2KdRE7PkssmJGeaX6eDx5Ep5Lj8mBQU+idcP1w FF1B0CZcS8UEZtaULLOlA5iimi2mXt6N6SJxjonlf93sKVuE1Xl4GGitnn63QR6FfMH0 Q+7QN3eTCva0ZRwbVqV7Sezy7NSfwgGjPMKafTVcpJBGqFvmypr/dkT9+S89WnGDSEWe RnvNlP8fy00+rj9nqnz7VWmWOBT9Te/vJCJrM/E3yRoxzjHkuBC020iEEF0XoYTGRejG vqzFC6ZJkvqFRJCLpD6UScNV1CvNO6ERXBNryKEu2/shcMAUG+oz4aRiOfnbcGEOYHyL d3Mw== X-Gm-Message-State: AOAM5335pROZ1rSKnfi2dPCEIEKBq/VCtqHV7BBQ44Nno4heX8GYCHAX EAdiOpQlErHS0/yRxrruH1XmjBndJeSh9hm+hV2rKISmIZ8= X-Google-Smtp-Source: ABdhPJw9cDaJOgQ0eU1enFv6+gIk09s4UIryssJcpX8eMk++niUHzMD6QXMK+4x8HToQi8G10poBdG3gqOFmEZS3G+g= X-Received: by 2002:a05:6102:548a:b0:32d:8c72:ee18 with SMTP id bk10-20020a056102548a00b0032d8c72ee18mr1321740vsb.70.1652931658523; Wed, 18 May 2022 20:40:58 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Nelson Chu Date: Thu, 19 May 2022 11:40:49 +0800 Message-ID: Subject: Re: [PATCH 1/1] RISC-V: Fix canonical extension order (K and J) To: Palmer Dabbelt Cc: Binutils Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2022 03:41:01 -0000 Seems like gcc and llvm have already committed this patch, so LGTM, committed. Thanks Nelson On Mon, Apr 25, 2022 at 11:53 AM Palmer Dabbelt wrote: > > On Mon, 28 Mar 2022 17:12:55 PDT (-0700), Palmer Dabbelt wrote: > > On Mon, 28 Mar 2022 06:12:01 PDT (-0700), binutils@sourceware.org wrote: > >> This commit fixes canonical extension order to follow the RISC-V ISA > >> Manual draft-20210402-1271737 or later. > >> > >> bfd/ChangeLog: > >> > >> * elfxx-riscv.c (riscv_recognized_prefixed_ext): Fix "K" extension > >> prefix to be placed before "J". > >> --- > >> bfd/elfxx-riscv.c | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c > >> index cb2cc146c04..1219a7b44d4 100644 > >> --- a/bfd/elfxx-riscv.c > >> +++ b/bfd/elfxx-riscv.c > >> @@ -1338,7 +1338,7 @@ riscv_recognized_prefixed_ext (const char *ext) > >> } > >> > >> /* Canonical order for single letter extensions. */ > >> -static const char riscv_ext_canonical_order[] = "eigmafdqlcbjktpvn"; > >> +static const char riscv_ext_canonical_order[] = "eigmafdqlcbkjtpvn"; > >> > >> /* Array is used to compare the orders of standard extensions quickly. */ > >> static int riscv_ext_order[26] = {0}; > > > > Looks like this was just a bug in binutils: K went from being > > unspecified to specified in 271737 ("Define canonical location of K > > extension in ISA string"), thus it was never allowed at that other bit > > position. > > > > It looks like GCC also has this wrong, which sort of doubles the > > headache: now we've got this odd coupling between the GCC version and > > binutils version. I'm not sure what the right thing is to do here: > > certainly rejecting the valid ISA string should be fixed, but I think we > > might need to accept the invalid one for compatibility reasons. That'll > > be a headache to implement, though, so I'm not sure it's worth it. > > > > Maybe someone has a clever solution to this one? > > After seeing the GCC patch go by, I think the clever solution here is to > just say that we never accepted any J stuff in the first place so it's > not a compatibility break.