From: Richard Henderson <richard.henderson@linaro.org>
To: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>,
sagark@eecs.berkeley.edu, palmer@sifive.com,
Alistair.Francis@wdc.com
Cc: qemu-riscv@nongnu.org, peer.adelt@hni.uni-paderborn.de,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v4 24/35] target/riscv: Move gen_arith_imm() decoding into trans_* functions
Date: Sun, 20 Jan 2019 12:24:44 +1100 [thread overview]
Message-ID: <50d95ed2-d8a4-0a05-f67c-0c18b5e87a33@linaro.org> (raw)
In-Reply-To: <20190118131456.32451-25-kbastian@mail.uni-paderborn.de>
On 1/19/19 12:14 AM, Bastian Koppelmann wrote:
> static bool trans_slli(DisasContext *ctx, arg_slli *a)
> {
> - gen_arith_imm(ctx, OPC_RISC_SLLI, a->rd, a->rs1, a->shamt);
> + if (a->rd != 0) {
> + TCGv t = tcg_temp_new();
> + gen_get_gpr(t, a->rs1);
> +
> + if (a->shamt >= TARGET_LONG_BITS) {
> + return false;
> + }
I think the shmat test should be first, so that
slli r0, r1, 99
produces SIGILL instead of translating to a nop.
> static bool trans_sraiw(DisasContext *ctx, arg_sraiw *a)
> {
> - gen_arith_imm(ctx, OPC_RISC_SHIFT_RIGHT_IW , a->rd, a->rs1,
> - a->shamt | 0x400);
> + TCGv t = tcg_temp_new();
> + gen_get_gpr(t, a->rs1);
> + tcg_gen_sextract_tl(t, t, a->shamt, 32 - a->shamt);
> + /* sign-extend for W instructions */
> + tcg_gen_ext32s_tl(t, t);
Sign extension of a sign-extracted value?
r~
next prev parent reply other threads:[~2019-01-20 1:24 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-18 13:14 [Qemu-devel] [PATCH v4 00/35] target/riscv: Convert to decodetree Bastian Koppelmann
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 01/35] target/riscv: Move CPURISCVState pointer to DisasContext Bastian Koppelmann
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 02/35] target/riscv: Activate decodetree and implemnt LUI & AUIPC Bastian Koppelmann
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 03/35] target/riscv: Convert RVXI branch insns to decodetree Bastian Koppelmann
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 04/35] target/riscv: Convert RV32I load/store " Bastian Koppelmann
2019-01-19 21:20 ` Richard Henderson
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 05/35] target/riscv: Convert RV64I " Bastian Koppelmann
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 06/35] target/riscv: Convert RVXI arithmetic " Bastian Koppelmann
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 07/35] target/riscv: Convert RVXI fence " Bastian Koppelmann
2019-01-19 21:29 ` Richard Henderson
2019-01-21 9:05 ` Bastian Koppelmann
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 08/35] target/riscv: Convert RVXI csr " Bastian Koppelmann
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 09/35] target/riscv: Convert RVXM " Bastian Koppelmann
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 10/35] target/riscv: Convert RV32A " Bastian Koppelmann
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 11/35] target/riscv: Convert RV64A " Bastian Koppelmann
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 12/35] target/riscv: Convert RV32F " Bastian Koppelmann
2019-01-19 21:51 ` Richard Henderson
2019-01-21 9:06 ` Bastian Koppelmann
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 13/35] target/riscv: Convert RV64F " Bastian Koppelmann
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 14/35] target/riscv: Convert RV32D " Bastian Koppelmann
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 15/35] target/riscv: Convert RV64D " Bastian Koppelmann
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 16/35] target/riscv: Convert RV priv " Bastian Koppelmann
2019-01-19 21:56 ` Richard Henderson
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 17/35] target/riscv: Convert quadrant 0 of RVXC " Bastian Koppelmann
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 18/35] target/riscv: Convert quadrant 1 " Bastian Koppelmann
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 19/35] target/riscv: Convert quadrant 2 " Bastian Koppelmann
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 20/35] target/riscv: Remove gen_jalr() Bastian Koppelmann
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 21/35] target/riscv: Remove manual decoding from gen_branch() Bastian Koppelmann
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 22/35] target/riscv: Remove manual decoding from gen_load() Bastian Koppelmann
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 23/35] target/riscv: Remove manual decoding from gen_store() Bastian Koppelmann
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 24/35] target/riscv: Move gen_arith_imm() decoding into trans_* functions Bastian Koppelmann
2019-01-20 1:24 ` Richard Henderson [this message]
2019-01-21 9:07 ` Bastian Koppelmann
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 25/35] target/riscv: make ADD/SUB/OR/XOR/AND insn use arg lists Bastian Koppelmann
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 26/35] target/riscv: Remove shift and slt insn manual decoding Bastian Koppelmann
2019-01-20 1:43 ` Richard Henderson
2019-01-21 9:10 ` Bastian Koppelmann
2019-01-21 23:22 ` Richard Henderson
2019-01-22 9:00 ` Bastian Koppelmann
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 27/35] target/riscv: Remove manual decoding of RV32/64M insn Bastian Koppelmann
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 28/35] target/riscv: Rename trans_arith to gen_arith Bastian Koppelmann
2019-01-20 1:48 ` Richard Henderson
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 29/35] target/riscv: Remove gen_system() Bastian Koppelmann
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 30/35] target/riscv: Remove decode_RV32_64G() Bastian Koppelmann
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 31/35] target/riscv: Convert @cs_2 insns to share translation functions<Paste> Bastian Koppelmann
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 32/35] target/riscv: Convert @cl_d, @cl_w, @cs_d, @cs_w insns Bastian Koppelmann
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 33/35] target/riscv: Splice fsw_sd and flw_ld for riscv32 vs riscv64 Bastian Koppelmann
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 34/35] target/riscv: Splice remaining compressed insn pairs " Bastian Koppelmann
2019-01-18 13:14 ` [Qemu-devel] [PATCH v4 35/35] target/riscv: Remaining rvc insn reuse 32 bit translators Bastian Koppelmann
2019-01-31 17:59 ` [Qemu-devel] [PATCH v4 00/35] target/riscv: Convert to decodetree no-reply
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=50d95ed2-d8a4-0a05-f67c-0c18b5e87a33@linaro.org \
--to=richard.henderson@linaro.org \
--cc=Alistair.Francis@wdc.com \
--cc=kbastian@mail.uni-paderborn.de \
--cc=palmer@sifive.com \
--cc=peer.adelt@hni.uni-paderborn.de \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=sagark@eecs.berkeley.edu \
/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).