From patchwork Thu Jun 27 15:20:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 11020037 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 499181398 for ; Thu, 27 Jun 2019 16:11:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 399C32853E for ; Thu, 27 Jun 2019 16:11:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2E0192846C; Thu, 27 Jun 2019 16:11:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9745F2853E for ; Thu, 27 Jun 2019 16:11:56 +0000 (UTC) Received: from localhost ([::1]:52134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgX07-00061f-OO for patchwork-qemu-devel@patchwork.kernel.org; Thu, 27 Jun 2019 12:11:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33430) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgWHw-0003Po-Hr for qemu-devel@nongnu.org; Thu, 27 Jun 2019 11:26:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hgWHr-0000WU-3a for qemu-devel@nongnu.org; Thu, 27 Jun 2019 11:26:14 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:44969) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hgWHo-0007H5-Qo for qemu-devel@nongnu.org; Thu, 27 Jun 2019 11:26:10 -0400 Received: by mail-pg1-f194.google.com with SMTP id n2so1167863pgp.11 for ; Thu, 27 Jun 2019 08:24:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:cc:from:to; bh=jNAXnuen/EqceGboq9jqUh/HLce5kvK8361K7LpbToc=; b=VMXj/XPwCHnXeqVfc3JqwHOnBYRuWa7EeJVZwwgE0OMSMFSMC8QLxn03gzo9gLBLhr Yiyio/nONXIesWXb/jZFt3UJqcbLtGz2uobXPtUQxhrOFHhpkK/d6aE7dp3EydqYkO+y oCP3WbC4w9LK2g34uJIbcj/gsu9OE7zny7h06tQhw7IQvxLfMLSn4b7CS0v/R7Mb1OfP mZ1ss3BjFSlzNEtBVAnStQNp9gZxbu/tqPq/4k1Hsi06HoeWzEBrk9Kgq0DbZVawYkCP 6Y9bJdkS6GcRv7gj3sTsSfLHCO3jAvNnsot/0kDaFeEDXCuJv59mAlf7E/dASj5Knvuz CLcQ== X-Gm-Message-State: APjAAAVV/Tf6iQk1MXsroA/xOJsgVQZ9ZNkf07bFR37uGANiLPbanR19 dzdg8yy0z2BpdZyHG1wstBdWVw== X-Google-Smtp-Source: APXvYqzWMlnaE1X5C4yiofYhLiuqPsrEf8BZb+R6LZa9V7v6zwnulh0AdTxVJXGYiVDMXNA1xiNb8Q== X-Received: by 2002:a17:90a:71cb:: with SMTP id m11mr6419278pjs.40.1561649068364; Thu, 27 Jun 2019 08:24:28 -0700 (PDT) Received: from localhost (220-132-236-182.HINET-IP.hinet.net. [220.132.236.182]) by smtp.gmail.com with ESMTPSA id k3sm2637153pgo.81.2019.06.27.08.24.27 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 27 Jun 2019 08:24:27 -0700 (PDT) Date: Thu, 27 Jun 2019 08:20:04 -0700 Message-Id: <20190627152011.18686-28-palmer@sifive.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190627152011.18686-1-palmer@sifive.com> References: <20190627152011.18686-1-palmer@sifive.com> MIME-Version: 1.0 From: Palmer Dabbelt To: Peter Maydell X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.215.194 Subject: [Qemu-devel] [PULL 27/34] disas/riscv: Fix `rdinstreth` constraint X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Wladimir J. van der Laan" , Palmer Dabbelt , qemu-devel@nongnu.org, Michael Clark , Alistair Francis , qemu-riscv@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: "Wladimir J. van der Laan" The constraint for `rdinstreth` was comparing the csr number to 0xc80, which is `cycleh` instead. Fix this. Signed-off-by: Wladimir J. van der Laan Signed-off-by: Michael Clark Signed-off-by: Alistair Francis Reviewed-by: Palmer Dabbelt Signed-off-by: Palmer Dabbelt --- disas/riscv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/disas/riscv.c b/disas/riscv.c index d37312705516..278d9be9247e 100644 --- a/disas/riscv.c +++ b/disas/riscv.c @@ -614,7 +614,8 @@ static const rvc_constraint rvcc_rdtime[] = { rvc_rs1_eq_x0, rvc_csr_eq_0xc01, r static const rvc_constraint rvcc_rdinstret[] = { rvc_rs1_eq_x0, rvc_csr_eq_0xc02, rvc_end }; static const rvc_constraint rvcc_rdcycleh[] = { rvc_rs1_eq_x0, rvc_csr_eq_0xc80, rvc_end }; static const rvc_constraint rvcc_rdtimeh[] = { rvc_rs1_eq_x0, rvc_csr_eq_0xc81, rvc_end }; -static const rvc_constraint rvcc_rdinstreth[] = { rvc_rs1_eq_x0, rvc_csr_eq_0xc80, rvc_end }; +static const rvc_constraint rvcc_rdinstreth[] = { rvc_rs1_eq_x0, + rvc_csr_eq_0xc82, rvc_end }; static const rvc_constraint rvcc_frcsr[] = { rvc_rs1_eq_x0, rvc_csr_eq_0x003, rvc_end }; static const rvc_constraint rvcc_frrm[] = { rvc_rs1_eq_x0, rvc_csr_eq_0x002, rvc_end }; static const rvc_constraint rvcc_frflags[] = { rvc_rs1_eq_x0, rvc_csr_eq_0x001, rvc_end }; @@ -1038,7 +1039,7 @@ const rv_opcode_data opcode_data[] = { { "c.srai", rv_codec_cb_sh6, rv_fmt_rd_rs1_imm, NULL, rv_op_srai, rv_op_srai, rv_op_srai, rvcd_imm_nz }, { "c.andi", rv_codec_cb_imm, rv_fmt_rd_rs1_imm, NULL, rv_op_andi, - rv_op_andi, rv_op_andi, rvcd_imm_nz }, + rv_op_andi, rv_op_andi }, { "c.sub", rv_codec_cs, rv_fmt_rd_rs1_rs2, NULL, rv_op_sub, rv_op_sub, rv_op_sub }, { "c.xor", rv_codec_cs, rv_fmt_rd_rs1_rs2, NULL, rv_op_xor, rv_op_xor, rv_op_xor }, { "c.or", rv_codec_cs, rv_fmt_rd_rs1_rs2, NULL, rv_op_or, rv_op_or, rv_op_or },