From: Palmer Dabbelt <palmer@sifive.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, qemu-riscv@nongnu.org,
Bastian Koppelmann <kbastian@mail.uni-paderborn.de>,
Palmer Dabbelt <palmer@sifive.com>
Subject: [Qemu-devel] [PULL 31/34] target/riscv: Convert @cl_d, @cl_w, @cs_d, @cs_w insns
Date: Fri, 1 Mar 2019 13:49:42 -0800 [thread overview]
Message-ID: <20190301214945.4353-32-palmer@sifive.com> (raw)
In-Reply-To: <20190301214945.4353-1-palmer@sifive.com>
From: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
target/riscv/insn16.decode | 20 ++++++++++----------
target/riscv/insn32.decode | 3 ++-
target/riscv/insn_trans/trans_rvc.inc.c | 24 ------------------------
3 files changed, 12 insertions(+), 35 deletions(-)
diff --git a/target/riscv/insn16.decode b/target/riscv/insn16.decode
index c7a58d80e5ae..c215867ff947 100644
--- a/target/riscv/insn16.decode
+++ b/target/riscv/insn16.decode
@@ -43,14 +43,14 @@
# Argument sets imported from insn32.decode:
&r rd rs1 rs2 !extern
+&i imm rs1 rd !extern
+&s imm rs1 rs2 !extern
# Argument sets:
&cl rs1 rd
-&cl_dw uimm rs1 rd
&ci imm rd
&ciw nzuimm rd
&cs rs1 rs2
-&cs_dw uimm rs1 rs2
&cb imm rs1
&cr rd rs2
&c_j imm
@@ -67,13 +67,13 @@
@cr .... ..... ..... .. &cr rs2=%rs2_5 %rd
@ci ... . ..... ..... .. &ci imm=%imm_ci %rd
@ciw ... ........ ... .. &ciw nzuimm=%nzuimm_ciw rd=%rs2_3
-@cl_d ... ... ... .. ... .. &cl_dw uimm=%uimm_cl_d rs1=%rs1_3 rd=%rs2_3
-@cl_w ... ... ... .. ... .. &cl_dw uimm=%uimm_cl_w rs1=%rs1_3 rd=%rs2_3
+@cl_d ... ... ... .. ... .. &i imm=%uimm_cl_d rs1=%rs1_3 rd=%rs2_3
+@cl_w ... ... ... .. ... .. &i imm=%uimm_cl_w rs1=%rs1_3 rd=%rs2_3
@cl ... ... ... .. ... .. &cl rs1=%rs1_3 rd=%rs2_3
@cs ... ... ... .. ... .. &cs rs1=%rs1_3 rs2=%rs2_3
@cs_2 ... ... ... .. ... .. &r rd=%rs1_3 rs1=%rs1_3 rs2=%rs2_3
-@cs_d ... ... ... .. ... .. &cs_dw uimm=%uimm_cl_d rs1=%rs1_3 rs2=%rs2_3
-@cs_w ... ... ... .. ... .. &cs_dw uimm=%uimm_cl_w rs1=%rs1_3 rs2=%rs2_3
+@cs_d ... ... ... .. ... .. &s imm=%uimm_cl_d rs1=%rs1_3 rs2=%rs2_3
+@cs_w ... ... ... .. ... .. &s imm=%uimm_cl_w rs1=%rs1_3 rs2=%rs2_3
@cb ... ... ... .. ... .. &cb imm=%imm_cb rs1=%rs1_3
@cj ... ........... .. &c_j imm=%imm_cj
@@ -95,11 +95,11 @@
# *** RV64C Standard Extension (Quadrant 0) ***
c_addi4spn 000 ........ ... 00 @ciw
-c_fld 001 ... ... .. ... 00 @cl_d
-c_lw 010 ... ... .. ... 00 @cl_w
+fld 001 ... ... .. ... 00 @cl_d
+lw 010 ... ... .. ... 00 @cl_w
c_flw_ld 011 --- ... -- ... 00 @cl #Note: Must parse uimm manually
-c_fsd 101 ... ... .. ... 00 @cs_d
-c_sw 110 ... ... .. ... 00 @cs_w
+fsd 101 ... ... .. ... 00 @cs_d
+sw 110 ... ... .. ... 00 @cs_w
c_fsw_sd 111 --- ... -- ... 00 @cs #Note: Must parse uimm manually
# *** RV64C Standard Extension (Quadrant 1) ***
diff --git a/target/riscv/insn32.decode b/target/riscv/insn32.decode
index 6f3ab7aa52d3..b59a00cc429f 100644
--- a/target/riscv/insn32.decode
+++ b/target/riscv/insn32.decode
@@ -37,6 +37,7 @@
&b imm rs2 rs1
&i imm rs1 rd
&r rd rs1 rs2
+&s imm rs2 rs1
&shift shamt rs1 rd
&atomic aq rl rs2 rs1 rd
@@ -44,7 +45,7 @@
@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
+@s ....... ..... ..... ... ..... ....... &s imm=%imm_s %rs2 %rs1
@u .................... ..... ....... imm=%imm_u %rd
@j .................... ..... ....... imm=%imm_j %rd
diff --git a/target/riscv/insn_trans/trans_rvc.inc.c b/target/riscv/insn_trans/trans_rvc.inc.c
index 639c381edfc0..d932bfd3e0cc 100644
--- a/target/riscv/insn_trans/trans_rvc.inc.c
+++ b/target/riscv/insn_trans/trans_rvc.inc.c
@@ -28,18 +28,6 @@ static bool trans_c_addi4spn(DisasContext *ctx, arg_c_addi4spn *a)
return trans_addi(ctx, &arg);
}
-static bool trans_c_fld(DisasContext *ctx, arg_c_fld *a)
-{
- arg_fld arg = { .rd = a->rd, .rs1 = a->rs1, .imm = a->uimm };
- return trans_fld(ctx, &arg);
-}
-
-static bool trans_c_lw(DisasContext *ctx, arg_c_lw *a)
-{
- arg_lw arg = { .rd = a->rd, .rs1 = a->rs1, .imm = a->uimm };
- return trans_lw(ctx, &arg);
-}
-
static bool trans_c_flw_ld(DisasContext *ctx, arg_c_flw_ld *a)
{
#ifdef TARGET_RISCV32
@@ -51,18 +39,6 @@ static bool trans_c_flw_ld(DisasContext *ctx, arg_c_flw_ld *a)
#endif
}
-static bool trans_c_fsd(DisasContext *ctx, arg_c_fsd *a)
-{
- arg_fsd arg = { .rs1 = a->rs1, .rs2 = a->rs2, .imm = a->uimm };
- return trans_fsd(ctx, &arg);
-}
-
-static bool trans_c_sw(DisasContext *ctx, arg_c_sw *a)
-{
- arg_sw arg = { .rs1 = a->rs1, .rs2 = a->rs2, .imm = a->uimm };
- return trans_sw(ctx, &arg);
-}
-
static bool trans_c_fsw_sd(DisasContext *ctx, arg_c_fsw_sd *a)
{
#ifdef TARGET_RISCV32
--
2.18.1
next prev parent reply other threads:[~2019-03-01 21:51 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-01 21:49 [Qemu-devel] [PULL] target/riscv: Convert to decodetree Palmer Dabbelt
2019-03-01 21:49 ` [Qemu-devel] [PULL 01/34] target/riscv: Activate decodetree and implemnt LUI & AUIPC Palmer Dabbelt
2019-03-01 21:49 ` [Qemu-devel] [PULL 02/34] target/riscv: Convert RVXI branch insns to decodetree Palmer Dabbelt
2019-03-01 21:49 ` [Qemu-devel] [PULL 03/34] target/riscv: Convert RV32I load/store " Palmer Dabbelt
2019-03-01 21:49 ` [Qemu-devel] [PULL 04/34] target/riscv: Convert RV64I " Palmer Dabbelt
2019-03-01 21:49 ` [Qemu-devel] [PULL 05/34] target/riscv: Convert RVXI arithmetic " Palmer Dabbelt
2019-03-01 21:49 ` [Qemu-devel] [PULL 06/34] target/riscv: Convert RVXI fence " Palmer Dabbelt
2019-03-01 21:49 ` [Qemu-devel] [PULL 07/34] target/riscv: Convert RVXI csr " Palmer Dabbelt
2019-03-01 21:49 ` [Qemu-devel] [PULL 08/34] target/riscv: Convert RVXM " Palmer Dabbelt
2019-03-01 21:49 ` [Qemu-devel] [PULL 09/34] target/riscv: Convert RV32A " Palmer Dabbelt
2019-03-01 21:49 ` [Qemu-devel] [PULL 10/34] target/riscv: Convert RV64A " Palmer Dabbelt
2019-03-01 21:49 ` [Qemu-devel] [PULL 11/34] target/riscv: Convert RV32F " Palmer Dabbelt
2019-03-01 21:49 ` [Qemu-devel] [PULL 12/34] target/riscv: Convert RV64F " Palmer Dabbelt
2019-03-01 21:49 ` [Qemu-devel] [PULL 13/34] target/riscv: Convert RV32D " Palmer Dabbelt
2019-03-01 21:49 ` [Qemu-devel] [PULL 14/34] target/riscv: Convert RV64D " Palmer Dabbelt
2019-03-01 21:49 ` [Qemu-devel] [PULL 15/34] target/riscv: Convert RV priv " Palmer Dabbelt
2019-03-01 21:49 ` [Qemu-devel] [PULL 16/34] target/riscv: Convert quadrant 0 of RVXC " Palmer Dabbelt
2019-03-01 21:49 ` [Qemu-devel] [PULL 17/34] target/riscv: Convert quadrant 1 " Palmer Dabbelt
2019-03-01 21:49 ` [Qemu-devel] [PULL 18/34] target/riscv: Convert quadrant 2 " Palmer Dabbelt
2019-03-01 21:49 ` [Qemu-devel] [PULL 19/34] target/riscv: Remove gen_jalr() Palmer Dabbelt
2019-03-01 21:49 ` [Qemu-devel] [PULL 20/34] target/riscv: Remove manual decoding from gen_branch() Palmer Dabbelt
2019-03-01 21:49 ` [Qemu-devel] [PULL 21/34] target/riscv: Remove manual decoding from gen_load() Palmer Dabbelt
2019-03-01 21:49 ` [Qemu-devel] [PULL 22/34] target/riscv: Remove manual decoding from gen_store() Palmer Dabbelt
2019-03-01 21:49 ` [Qemu-devel] [PULL 23/34] target/riscv: Move gen_arith_imm() decoding into trans_* functions Palmer Dabbelt
2019-03-01 21:49 ` [Qemu-devel] [PULL 24/34] target/riscv: make ADD/SUB/OR/XOR/AND insn use arg lists Palmer Dabbelt
2019-03-01 21:49 ` [Qemu-devel] [PULL 25/34] target/riscv: Remove shift and slt insn manual decoding Palmer Dabbelt
2019-03-01 21:49 ` [Qemu-devel] [PULL 26/34] target/riscv: Remove manual decoding of RV32/64M insn Palmer Dabbelt
2019-03-01 21:49 ` [Qemu-devel] [PULL 27/34] target/riscv: Rename trans_arith to gen_arith Palmer Dabbelt
2019-03-01 21:49 ` [Qemu-devel] [PULL 28/34] target/riscv: Remove gen_system() Palmer Dabbelt
2019-03-01 21:49 ` [Qemu-devel] [PULL 29/34] target/riscv: Remove decode_RV32_64G() Palmer Dabbelt
2019-03-01 21:49 ` [Qemu-devel] [PULL 30/34] target/riscv: Convert @cs_2 insns to share translation functions Palmer Dabbelt
2019-03-01 21:49 ` Palmer Dabbelt [this message]
2019-03-01 21:49 ` [Qemu-devel] [PULL 32/34] target/riscv: Splice fsw_sd and flw_ld for riscv32 vs riscv64 Palmer Dabbelt
2019-03-01 21:49 ` [Qemu-devel] [PULL 33/34] target/riscv: Splice remaining compressed insn pairs " Palmer Dabbelt
2019-03-01 21:49 ` [Qemu-devel] [PULL 34/34] target/riscv: Remaining rvc insn reuse 32 bit translators Palmer Dabbelt
2019-03-04 11:02 ` [Qemu-devel] [PULL] target/riscv: Convert to decodetree Peter Maydell
2019-03-04 12:52 ` Bastian Koppelmann
2019-03-04 15:25 ` Bastian Koppelmann
2019-03-04 19:30 ` Richard Henderson
2019-03-04 21:46 ` Palmer Dabbelt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190301214945.4353-32-palmer@sifive.com \
--to=palmer@sifive.com \
--cc=kbastian@mail.uni-paderborn.de \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).