From patchwork Tue Oct 23 12:04:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 149442 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp609905ljp; Tue, 23 Oct 2018 05:08:03 -0700 (PDT) X-Google-Smtp-Source: AJdET5e3u5eYBMfx27yakqHP2pN4/O3aswBu5xVmmq6lxqx+Q1sRaDdIahPVEjL8K1FADWbtmjZn X-Received: by 2002:a37:a016:: with SMTP id j22-v6mr11610772qke.74.1540296483705; Tue, 23 Oct 2018 05:08:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540296483; cv=none; d=google.com; s=arc-20160816; b=nxGnCmf7dHr9Zie/e+RRWs9zENfxbnD7UrHHWS7UZwSR7b18hyZz12NX7GOgPGEYmF 2stl3fuBpDMs2waCWLxfvWMl87Bdd6VFGXUrHlM2xW6jR9cSzsyD/SArfOWntEK28Ivu pe+xj888/DT5UIyGlw0ZV35VZ9ycsmnyF7Gm0ynHBehLPG2nXgVf5p4ZcQlwFJl5nx/t FAn8itKOySZRD2luFsZ+75KCQhLTgR8QbT3N1HJIkHqJGC99roaK85MCXVzjiYJH7h49 qrjgsKTn3yCBO6LtbtRQUOJqMz0Df4XQ8Urik1AUBksvIBM5kqT9scmDuBtuLI+ploVz 5ZDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=GaDwWC7gIyxvSl0HiXJxwOUuJTh/hTQlKPlyDGbbtZo=; b=UM2Q+wNDaKo2RCBxzHewwHAOPgmVxkCkEJLgK/tBNYYK8zYgdQ/FBAAjtNUI8F0Nui 6C1++FuuD9OkMB+Aeew77/mELiw2qbNp9mO9Qz73Zvu/+sbIBEmnqCdKfYuijtQu0sw1 zsehI1NCoMqVgwgnzZ01V/g4QJPCfU68AMBpPLWPeLc0Ck+VwjRu5FgidqW7/6Bczk9s OBSOronzpx8aLzikM0TXud+WEhj5bi+EQ286IQ3Bmz3l1Fzz1NHQm6NhIoBbKifaowBr fD1CPCbKpMMhYIAT/5K2+5tFYCoRjB6BaiRTXdd7RbxfhdY7U1MLyFXaqonMwLouTSw2 QZ+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KdOcrIWK; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id w14-v6si927980qtw.313.2018.10.23.05.08.03 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 23 Oct 2018 05:08:03 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KdOcrIWK; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:40712 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEvTf-0001T6-3j for patch@linaro.org; Tue, 23 Oct 2018 08:08:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54131) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEvQt-0005al-Li for qemu-devel@nongnu.org; Tue, 23 Oct 2018 08:05:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gEvQs-0007dL-EX for qemu-devel@nongnu.org; Tue, 23 Oct 2018 08:05:11 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:35218) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gEvQr-0007ZX-DR for qemu-devel@nongnu.org; Tue, 23 Oct 2018 08:05:10 -0400 Received: by mail-wr1-x432.google.com with SMTP id w5-v6so1415721wrt.2 for ; Tue, 23 Oct 2018 05:05:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GaDwWC7gIyxvSl0HiXJxwOUuJTh/hTQlKPlyDGbbtZo=; b=KdOcrIWKrQGk+AZihDT+ZPux+ySpTd3F7Oix/OoenpEIgUf/+F9aueAs3sIscoeBEG mvDh0RP92nJiphLOxk5bDqqncipRHlIHPkrOItX+YLo91GzFIcJAbmgz2RnnpmDna5ln JljOQ3l/ONVulANKps8NLNoCYPQzFj7MKKQoU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GaDwWC7gIyxvSl0HiXJxwOUuJTh/hTQlKPlyDGbbtZo=; b=q3X1t1IvWA50Z/fpHGgvHVe34XRF2aPGRZh4xMANvRjNqoREBzBuHfa7iQSIrzTqUx erKEMnYnwLk4kTXMQRP87x+TddbA/ei0ysem2HbLG5xE/rkPNMW8kwoE0Kyej6ZeKpfG 5rICnwgrQh8z0opBjan+jGTteLo1kQif2FTxbybAub8ixkyVhj/hRcASQkU34tpFeYPs /n2plGJ9iWFQpmMrx6IxnGzcmcHqY48+iOtLz9sSRR50dmpwZbxsajj0lxn2VC2FvlVu myklcEPzMo9wf5s57VHsHje4vwNXiQoCQFqB1/CKRS7c6hqtkDC+wM697eI2qVji3IVz T9wg== X-Gm-Message-State: ABuFfojD0xRXnyxnQlyU/FAYtrwl6PD29ablGVTP5EtE4Bgwto/OaE0M QNFyUSn/EFADQ6/gzAQh8WLr2BewPAE= X-Received: by 2002:adf:c748:: with SMTP id b8-v6mr50565861wrh.134.1540296307998; Tue, 23 Oct 2018 05:05:07 -0700 (PDT) Received: from cloudburst.twiddle.net.net ([185.7.230.213]) by smtp.gmail.com with ESMTPSA id a1-v6sm1009200wrt.79.2018.10.23.05.05.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Oct 2018 05:05:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 23 Oct 2018 13:04:51 +0100 Message-Id: <20181023120454.28553-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181023120454.28553-1-richard.henderson@linaro.org> References: <20181023120454.28553-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::432 Subject: [Qemu-devel] [PATCH 4/7] target/riscv: Rename some argument sets in insn32.decode X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sagark@eecs.berkeley.edu, kbastian@mail.uni-paderborn.de, palmer@sifive.com, peer.adelt@hni.uni-paderborn.de, Alistair.Francis@wdc.com, mjc@sifive.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" For format x, use &x for the argument set and @x for the extract. This is less confusing than e.g. "arith" for format R. --- target/riscv/insn_trans/trans_rvi.inc.c | 2 +- target/riscv/translate.c | 10 +++++----- target/riscv/insn32.decode | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) -- 2.17.2 Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Bastian Koppelmann diff --git a/target/riscv/insn_trans/trans_rvi.inc.c b/target/riscv/insn_trans/trans_rvi.inc.c index 2ef355019d..7e676fe2e4 100644 --- a/target/riscv/insn_trans/trans_rvi.inc.c +++ b/target/riscv/insn_trans/trans_rvi.inc.c @@ -72,7 +72,7 @@ static bool trans_jalr(DisasContext *ctx, arg_jalr *a) return true; } -static bool gen_branch(DisasContext *ctx, arg_branch *a, TCGCond cond) +static bool gen_branch(DisasContext *ctx, arg_b *a, TCGCond cond) { TCGLabel *l = gen_new_label(); TCGv source1, source2; diff --git a/target/riscv/translate.c b/target/riscv/translate.c index ece163e69f..e7fe8720ac 100644 --- a/target/riscv/translate.c +++ b/target/riscv/translate.c @@ -326,7 +326,7 @@ bool decode_insn32(DisasContext *ctx, uint32_t insn); /* Include the auto-generated decoder for 32 bit insn */ #include "decode_insn32.inc.c" -static bool gen_arith_imm(DisasContext *ctx, arg_arith_imm *a, +static bool gen_arith_imm(DisasContext *ctx, arg_i *a, void(*func)(TCGv, TCGv, TCGv)) { TCGv source1, source2; @@ -344,7 +344,7 @@ static bool gen_arith_imm(DisasContext *ctx, arg_arith_imm *a, return true; } -static bool gen_arith(DisasContext *ctx, arg_arith *a, +static bool gen_arith(DisasContext *ctx, arg_r *a, void(*func)(TCGv, TCGv, TCGv)) { TCGv source1, source2; @@ -363,7 +363,7 @@ static bool gen_arith(DisasContext *ctx, arg_arith *a, } #ifdef TARGET_RISCV64 -static bool gen_arith_w(DisasContext *ctx, arg_arith *a, +static bool gen_arith_w(DisasContext *ctx, arg_r *a, void(*func)(TCGv, TCGv, TCGv)) { TCGv source1, source2; @@ -384,8 +384,8 @@ static bool gen_arith_w(DisasContext *ctx, arg_arith *a, } #endif -static bool gen_shift(DisasContext *ctx, arg_arith *a, - void(*func)(TCGv, TCGv, TCGv)) +static bool gen_shift(DisasContext *ctx, arg_r *a, + void(*func)(TCGv, TCGv, TCGv)) { TCGv source1 = tcg_temp_new(); TCGv source2 = tcg_temp_new(); diff --git a/target/riscv/insn32.decode b/target/riscv/insn32.decode index 1541c254df..77e093a060 100644 --- a/target/riscv/insn32.decode +++ b/target/riscv/insn32.decode @@ -38,17 +38,17 @@ %imm_u 12:s20 !function=ex_shift_12 # Argument sets: -&branch imm rs2 rs1 -&arith_imm imm rs1 rd -&arith rd rs1 rs2 +&b imm rs2 rs1 +&i imm rs1 rd +&r rd rs1 rs2 &shift shamt rs1 rd &atomic aq rl rs2 rs1 rd # Formats 32: -@r ....... ..... ..... ... ..... ....... &arith %rs2 %rs1 %rd -@i ............ ..... ... ..... ....... &arith_imm imm=%imm_i %rs1 %rd -@b ....... ..... ..... ... ..... ....... &branch imm=%imm_b %rs2 %rs1 +@r ....... ..... ..... ... ..... ....... &r %rs2 %rs1 %rd +@i ............ ..... ... ..... ....... &i imm=%imm_i %rs1 %rd +@b ....... ..... ..... ... ..... ....... &b imm=%imm_b %rs2 %rs1 @s ....... ..... ..... ... ..... ....... imm=%imm_s %rs2 %rs1 @u .................... ..... ....... imm=%imm_u %rd @j .................... ..... ....... imm=%imm_j %rd