From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id AAF343851894 for ; Fri, 16 Dec 2022 19:00:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AAF343851894 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=vrull.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=vrull.eu Received: by mail-wr1-x42d.google.com with SMTP id i7so3409218wrv.8 for ; Fri, 16 Dec 2022 11:00:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Fjq5jy7DN/mEeB8Xb8MIppotE6iSTOEBg+Ez1FTnrlI=; b=HC3uaPGTeRsLhxRHfRBtSWFVaRVYP7BNwwOf+ruzwneufS5iDgrBnqxIAz3BXcIFQZ bMa9Gv92vpVvxJq7gi9rS8R0KvXhKSh+W2RaJO2hDpLUNIpXorqXoPZ4L55di/yx0xDR Vud6JE6VtR2EmYMd/zdPY4SZ88I74QVegHiGIOHq1XxLjCYNMmxyCRM4VRIrS2jSUTMk 9DYeOboB4OgFBNXsHfYhQfTSheffAMB7zKsrn0WgEqvAfD/w6udpL7R9bzvI3ZStFfet PveZ2wfFVI5pYrweM8+rPF7whITBZBnsCYENabBdDEXkkDOY7q2hHEDMXl8c8VLaFjZR BeJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Fjq5jy7DN/mEeB8Xb8MIppotE6iSTOEBg+Ez1FTnrlI=; b=kxXJrANvOid8Bl2ENYKIGC/YTw+lFeFVhnRNEGYI9nUa/75gkCrNKUWU1ZaoGa49/f woKSGGD4zHhD5GSfMqd6GrsLVW7jn50EjtN70eVNBaiqRQkxfqCUMO7nUoBDIbdPvukY IZcx2WtYwYP5osQAN4OPdY+2WCXe5amynsZotHKwmPtw2GyyOqC4QOkyS60xqpFew6lO FSaN4u6DO3KXxhrd/DgcDcRszKcAtVmcrkjk6FHlQdvuZU9rlrWa8R8Q4R2rUJXEzUlj 8NMF5FmIPSPfhCxmdNMS11w0T174HZpq4CuRBvgHy+jMHr7D/fN8bsft4D/SmlhAp186 9JRA== X-Gm-Message-State: ANoB5pnobRDoKOXnOLVfywLBEWcPtrq4s88P4rWu1kB6ztWnQTDdlTex 0ZMHehdBONPeFFTsPgrTUralD+0cz65jhJAYBzI3bA== X-Google-Smtp-Source: AA0mqf5e2khTk7ubjN03l6/pvdmrMjE8W2YzBFKOfi33Byj6dQDmw4EmWu1lMj1JDViThR8RVNvVFav4Nfh9kRY3LvU= X-Received: by 2002:a5d:58d1:0:b0:242:a3a:69cf with SMTP id o17-20020a5d58d1000000b002420a3a69cfmr34112789wrf.159.1671217205439; Fri, 16 Dec 2022 11:00:05 -0800 (PST) MIME-Version: 1.0 References: <20221216185133.1342022-1-christoph.muellner@vrull.eu> In-Reply-To: From: =?UTF-8?Q?Christoph_M=C3=BCllner?= Date: Fri, 16 Dec 2022 19:59:53 +0100 Message-ID: Subject: Re: [PATCH] RISC-V: Fix T-Head Fmv vendor extension encoding To: Palmer Dabbelt Cc: binutils@sourceware.org, nelson@rivosinc.com, Andrew Waterman , Jim Wilson , research_trasio@irq.a4lg.com, philipp.tomsich@vrull.eu, cooper.qu@linux.alibaba.com, lifang_xia@linux.alibaba.com, yunhai@linux.alibaba.com, zhiwei_liu@linux.alibaba.com Content-Type: multipart/alternative; boundary="000000000000df7f6905eff693ab" X-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,HTML_MESSAGE,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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: --000000000000df7f6905eff693ab Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Dec 16, 2022 at 7:56 PM Palmer Dabbelt wrote: > On Fri, 16 Dec 2022 10:51:33 PST (-0800), christoph.muellner@vrull.eu > wrote: > > From: Christoph M=C3=BCllner > > > > A recent change in the XTheadFmv spec fixed an encoding bug in the > > document. This patch changes the code to follow this bugfix. > > > > Spec patch can be found here: > > https://github.com/T-head-Semi/thead-extension-spec/pull/11 > > There's not much info in there. Was this just a bug in the ISA manual? > In other words, does the existing hardware (I know of at least C906s and > C910s in the wild) behave the new way already? In that case > Yes, this was just a bug in the ISA manual, which slipped through the review. The manual now matches the implementation. > > Reviewed-by: Palmer Dabbelt > > but if the hardware has the old behavior then we'll need to do something > more complicated to avoid breaking compatibility. > > > > > Signed-off-by: Christoph M=C3=BCllner > > --- > > gas/testsuite/gas/riscv/x-thead-fmv.d | 4 ++-- > > include/opcode/riscv-opc.h | 4 ++-- > > 2 files changed, 4 insertions(+), 4 deletions(-) > > > > diff --git a/gas/testsuite/gas/riscv/x-thead-fmv.d > b/gas/testsuite/gas/riscv/x-thead-fmv.d > > index f2bbe010beb..af8ce0c8ee0 100644 > > --- a/gas/testsuite/gas/riscv/x-thead-fmv.d > > +++ b/gas/testsuite/gas/riscv/x-thead-fmv.d > > @@ -7,5 +7,5 @@ > > Disassembly of section .text: > > > > 0+000 : > > -[ ]+[0-9a-f]+:[ ]+6005950b[ ]+th.fmv.hw.x[ ]+a0,fa1 > > -[ ]+[0-9a-f]+:[ ]+5005158b[ ]+th.fmv.x.hw[ ]+a1,fa0 > > +[ ]+[0-9a-f]+:[ ]+5005950b[ ]+th.fmv.hw.x[ ]+a0,fa1 > > +[ ]+[0-9a-f]+:[ ]+6005158b[ ]+th.fmv.x.hw[ ]+a1,fa0 > > diff --git a/include/opcode/riscv-opc.h b/include/opcode/riscv-opc.h > > index 06e3df0f5a6..5420bfac91b 100644 > > --- a/include/opcode/riscv-opc.h > > +++ b/include/opcode/riscv-opc.h > > @@ -2209,9 +2209,9 @@ > > #define MATCH_TH_FSURW 0x5000700b > > #define MASK_TH_FSURW 0xf800707f > > /* Vendor-specific (T-Head) XTheadFmv instructions. */ > > -#define MATCH_TH_FMV_HW_X 0x6000100b > > +#define MATCH_TH_FMV_HW_X 0x5000100b > > #define MASK_TH_FMV_HW_X 0xfff0707f > > -#define MATCH_TH_FMV_X_HW 0x5000100b > > +#define MATCH_TH_FMV_X_HW 0x6000100b > > #define MASK_TH_FMV_X_HW 0xfff0707f > > /* Vendor-specific (T-Head) XTheadInt instructions. */ > > #define MATCH_TH_IPOP 0x0050000b > --000000000000df7f6905eff693ab--