From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by sourceware.org (Postfix) with ESMTPS id 7C3193858D33 for ; Mon, 25 Apr 2022 03:52:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7C3193858D33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dabbelt.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dabbelt.com Received: by mail-pl1-x631.google.com with SMTP id j8so24148555pll.11 for ; Sun, 24 Apr 2022 20:52:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20210112.gappssmtp.com; s=20210112; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=I+/1sKzoZ/F9I3Gv/CFa0eKn8ypHx0JnD+aH1pU4Q94=; b=5NjUefklsC0chRkceDA+WDz5K0WUm+CspghhwrhHabxW8ddUe7r3zqPVLpVJrZkbr7 pIg8NXH6V+syHqwArRTZVO12kBzpQgdxJo0Q/imapz3F0VdRmobdqV6Ezs8NCrrKLHc8 W97MyBQ1QdpfUqgzYc7xKih6Wljp278fWcH/1/DlWYXPw9UmHGE453y/FlW2FhCgrE4z knKeRGzWW3ImAAtdfT1fvW79PdSNTDQAArMaqO0cCCiBL6tyZ0XkYyBVW+ol+YRLTVW6 8PLsuGtNYQP3q+mrIME6x7csa68SNGBDIlyNhF2U57H7aKK387nEFnST81ggBxBMU2kb hSRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=I+/1sKzoZ/F9I3Gv/CFa0eKn8ypHx0JnD+aH1pU4Q94=; b=SEm/vVw8wYQpKvwnOE2YTnShNw1e94CbHzR1ujX0EwH19GinzJh9lG0lF4wYModr4L xJKk+/aN7guoN3c03v8FA78Xo/U27khpcALLRm9YmfSUeUVTzpNM/dIEGaWr0scgXEun ICrOPAdRGBwsK5QhPAzUDcMaiPFDgYt63FFGt1Lih510zjZlxRUKOaDvgKkBFVfY4QwQ y9f1AX9B9D+UiU3cw0pTjqiRtbhyrTgFbNCKHuVpAzyLjwsvu80r5T/l3hIeIuFDskCe /L4sqC+QxnJsDO9bFQIQavdBuokDn2ytabdBMjvb5/GJlySKKaMJao5Gydm/bdQBznIe ZScw== X-Gm-Message-State: AOAM5326g5h+5FHuabIzQ8xFYKsyTTSfDd/ppu249lPHmB4wFRWcNlXE s0a4Jj8eusiFNb3nfESYtHZ+AuX2JLeYoQ== X-Google-Smtp-Source: ABdhPJw904Hhc14HOcH40UZEfBkat35ltVO9pnLsRBg1rVXbG+E3+l4/D4/fJYarqdinkjlNYH3wJQ== X-Received: by 2002:a17:902:7d81:b0:14f:e18b:2b9e with SMTP id a1-20020a1709027d8100b0014fe18b2b9emr15822141plm.160.1650858769155; Sun, 24 Apr 2022 20:52:49 -0700 (PDT) Received: from localhost (76-210-143-223.lightspeed.sntcca.sbcglobal.net. [76.210.143.223]) by smtp.gmail.com with ESMTPSA id y19-20020a17090ad71300b001d967248885sm1766125pju.29.2022.04.24.20.52.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Apr 2022 20:52:48 -0700 (PDT) Date: Sun, 24 Apr 2022 20:52:48 -0700 (PDT) X-Google-Original-Date: Sun, 24 Apr 2022 20:52:44 PDT (-0700) Subject: Re: [PATCH 1/1] RISC-V: Fix canonical extension order (K and J) In-Reply-To: CC: binutils@sourceware.org From: Palmer Dabbelt To: binutils@sourceware.org Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Mon, 25 Apr 2022 03:52:52 -0000 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.