From nobody Sat Jun 29 02:18:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=mail.uni-paderborn.de Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1550847462254730.8613500294741; Fri, 22 Feb 2019 06:57:42 -0800 (PST) Received: from localhost ([127.0.0.1]:52158 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gxCGd-0007z8-8T for importer@patchew.org; Fri, 22 Feb 2019 09:57:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41586) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gxBZr-0006Y0-EJ for qemu-devel@nongnu.org; Fri, 22 Feb 2019 09:13:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gxBZi-0000vT-BX for qemu-devel@nongnu.org; Fri, 22 Feb 2019 09:13:18 -0500 Received: from mail.uni-paderborn.de ([131.234.142.9]:42188) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gxBZI-0007Bn-E9; Fri, 22 Feb 2019 09:12:52 -0500 Received: from magmaria.uni-paderborn.de ([131.234.189.24] helo=localhost.localdomain) by mail.uni-paderborn.de with esmtp (Exim 4.89 telepax) id 1gxBYS-000201-3p; Fri, 22 Feb 2019 15:11:56 +0100 Received: from mail.uni-paderborn.de by magmaria with queue id 3163444-3; Fri, 22 Feb 2019 14:11:55 GMT X-Envelope-From: From: Bastian Koppelmann To: sagark@eecs.berkeley.edu, palmer@sifive.com, kbastian@mail.uni-paderborn.de Date: Fri, 22 Feb 2019 15:10:21 +0100 Message-Id: <20190222141024.22217-32-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190222141024.22217-1-kbastian@mail.uni-paderborn.de> References: <20190222141024.22217-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-PMX-Version: 6.4.6.2792898, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2019.2.22.140315, AntiVirus-Engine: 5.58.0, AntiVirus-Data: 2019.2.19.5580002 X-IMT-Spam-Score: 0.0 () X-IMT-Authenticated-Sender: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 131.234.142.9 Subject: [Qemu-devel] [PATCH v8 31/34] target/riscv: Convert @cl_d, @cl_w, @cs_d, @cs_w insns 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: qemu-riscv@nongnu.org, peer.adelt@hni.uni-paderborn.de, richard.henderson@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann --- 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 c7a58d80e5..c215867ff9 100644 --- a/target/riscv/insn16.decode +++ b/target/riscv/insn16.decode @@ -43,14 +43,14 @@ =20 # Argument sets imported from insn32.decode: &r rd rs1 rs2 !extern +&i imm rs1 rd !extern +&s imm rs1 rs2 !extern =20 # 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=3D%rs2_5 %rd @ci ... . ..... ..... .. &ci imm=3D%imm_ci %rd @ciw ... ........ ... .. &ciw nzuimm=3D%nzuimm_ciw rd= =3D%rs2_3 -@cl_d ... ... ... .. ... .. &cl_dw uimm=3D%uimm_cl_d rs1=3D%rs1_3 = rd=3D%rs2_3 -@cl_w ... ... ... .. ... .. &cl_dw uimm=3D%uimm_cl_w rs1=3D%rs1_3 = rd=3D%rs2_3 +@cl_d ... ... ... .. ... .. &i imm=3D%uimm_cl_d rs1=3D%rs1_3 rd=3D= %rs2_3 +@cl_w ... ... ... .. ... .. &i imm=3D%uimm_cl_w rs1=3D%rs1_3 rd=3D= %rs2_3 @cl ... ... ... .. ... .. &cl rs1=3D%rs1_3 rd= =3D%rs2_3 @cs ... ... ... .. ... .. &cs rs1=3D%rs1_3 rs= 2=3D%rs2_3 @cs_2 ... ... ... .. ... .. &r rd=3D%rs1_3 rs1=3D%rs1_3 rs2=3D%r= s2_3 -@cs_d ... ... ... .. ... .. &cs_dw uimm=3D%uimm_cl_d rs1=3D%rs1_3 = rs2=3D%rs2_3 -@cs_w ... ... ... .. ... .. &cs_dw uimm=3D%uimm_cl_w rs1=3D%rs1_3 = rs2=3D%rs2_3 +@cs_d ... ... ... .. ... .. &s imm=3D%uimm_cl_d rs1=3D%rs1_3 rs2= =3D%rs2_3 +@cs_w ... ... ... .. ... .. &s imm=3D%uimm_cl_w rs1=3D%rs1_3 rs2= =3D%rs2_3 @cb ... ... ... .. ... .. &cb imm=3D%imm_cb rs1=3D%rs1_3 @cj ... ........... .. &c_j imm=3D%imm_cj =20 @@ -95,11 +95,11 @@ =20 # *** 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 man= ually -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 man= ually =20 # *** RV64C Standard Extension (Quadrant 1) *** diff --git a/target/riscv/insn32.decode b/target/riscv/insn32.decode index 6f3ab7aa52..b59a00cc42 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 =20 @@ -44,7 +45,7 @@ @r ....... ..... ..... ... ..... ....... &r %rs2 %r= s1 %rd @i ............ ..... ... ..... ....... &i imm=3D%imm_i = %rs1 %rd @b ....... ..... ..... ... ..... ....... &b imm=3D%imm_b %rs2= %rs1 -@s ....... ..... ..... ... ..... ....... imm=3D%imm_s %rs2= %rs1 +@s ....... ..... ..... ... ..... ....... &s imm=3D%imm_s %rs2= %rs1 @u .................... ..... ....... imm=3D%imm_u = %rd @j .................... ..... ....... imm=3D%imm_j = %rd =20 diff --git a/target/riscv/insn_trans/trans_rvc.inc.c b/target/riscv/insn_tr= ans/trans_rvc.inc.c index 639c381edf..d932bfd3e0 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_ad= di4spn *a) return trans_addi(ctx, &arg); } =20 -static bool trans_c_fld(DisasContext *ctx, arg_c_fld *a) -{ - arg_fld arg =3D { .rd =3D a->rd, .rs1 =3D a->rs1, .imm =3D a->uimm }; - return trans_fld(ctx, &arg); -} - -static bool trans_c_lw(DisasContext *ctx, arg_c_lw *a) -{ - arg_lw arg =3D { .rd =3D a->rd, .rs1 =3D a->rs1, .imm =3D 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 } =20 -static bool trans_c_fsd(DisasContext *ctx, arg_c_fsd *a) -{ - arg_fsd arg =3D { .rs1 =3D a->rs1, .rs2 =3D a->rs2, .imm =3D a->uimm }; - return trans_fsd(ctx, &arg); -} - -static bool trans_c_sw(DisasContext *ctx, arg_c_sw *a) -{ - arg_sw arg =3D { .rs1 =3D a->rs1, .rs2 =3D a->rs2, .imm =3D a->uimm }; - return trans_sw(ctx, &arg); -} - static bool trans_c_fsw_sd(DisasContext *ctx, arg_c_fsw_sd *a) { #ifdef TARGET_RISCV32 --=20 2.20.1