From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id DB89538582AB for ; Fri, 16 Dec 2022 18:56:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DB89538582AB 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-pf1-x433.google.com with SMTP id 21so2398627pfw.4 for ; Fri, 16 Dec 2022 10:56:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:from:to:cc:subject:date:message-id :reply-to; bh=ikrjNGxXNNlgssSU5mzuNPvAj1MKuY1VnURVYCMRFpY=; b=dJStELChwQUrdS0Bu5EQwOijgWxU6VXwtIRCpMMtMLQL8gGM2LXra0CA/62On3c4/A HZL4Kth0CNvL+gQpC+UhISZu9uYaE52ljDmN+8HfBjqvEaldiuhs5gR/UY3AXUsf0KNN YXheInrJf0cCr06KwmZs0ba3r/S1rI8CTz8kNd6MSI0mIzJdVBhefuDoaGd2HYiRAC8k KCbhy6G7gn0FM5whYh3+p2PauLvRkQB7EKpzuP3/p24vGs4eENLiREsYxkDwP2LGq1rr JHXSyLPGndIaMngrAyCiYM3rA4iweqy9kT3lSAooWm9F/Rs4xnLo2IN6NLohaq9gM1p/ pbFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ikrjNGxXNNlgssSU5mzuNPvAj1MKuY1VnURVYCMRFpY=; b=Tw15Frr/ErYerCtPAkkB831ICnLJ9ZYF2rP30M17o0OempEivt/y3c8JTLBdyU/bw6 2fnItiqinXPbuIC+pYKX+kU0/OlknvSm3Z0Ltk+seB0Fh9ovUg+J3noQA2bw9dQ/zDn2 UkBI8YOZQPro5+zKY3aTdPUAhE3o6jUwrKTpq7HEvkUeLyl4c3XjUdXe+pqSjq6XlEKQ naA99Af0O20PGisruv5nQQ+m4n+T1L0iLAx/wkGobOBvhQSuq5SU4eY+Da29/QYI9FOU HILKMeUg80jcYGUne7x14GU9ctFzxCc3e/aLDTyuJCPzoNubF40SMXxI4M3v8psC0qIk s00w== X-Gm-Message-State: ANoB5pnuErBn77t7Ya1ID4nEZnnGrc5Sl+8uH2oWyLqt8mNIt0HCNewy S6NNyZXvYIRWv7NeRqSpHrmFxAuiohZB6O9f X-Google-Smtp-Source: AA0mqf6EOh1NyEqEvWdMTTp54xDMr4Xr0CXwapToohkQg14sST4OJifta422WpuJJAAEfr90epHXPQ== X-Received: by 2002:aa7:8518:0:b0:576:cda4:16c4 with SMTP id v24-20020aa78518000000b00576cda416c4mr32263390pfn.10.1671217016437; Fri, 16 Dec 2022 10:56:56 -0800 (PST) Received: from localhost ([50.221.140.188]) by smtp.gmail.com with ESMTPSA id s7-20020a625e07000000b0057691fb0d37sm1799681pfb.193.2022.12.16.10.56.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 10:56:55 -0800 (PST) Date: Fri, 16 Dec 2022 10:56:55 -0800 (PST) X-Google-Original-Date: Fri, 16 Dec 2022 10:56:40 PST (-0800) Subject: Re: [PATCH] RISC-V: Fix T-Head Fmv vendor extension encoding In-Reply-To: <20221216185133.1342022-1-christoph.muellner@vrull.eu> 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, christoph.muellner@vrull.eu From: Palmer Dabbelt To: christoph.muellner@vrull.eu 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=-10.8 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.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, 16 Dec 2022 10:51:33 PST (-0800), christoph.muellner@vrull.eu wrote: > From: Christoph Müllner > > 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 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üllner > --- > 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