|
From: | Bastian Koppelmann |
Subject: | Re: [Qemu-devel] [PATCH v4 24/35] target/riscv: Move gen_arith_imm() decoding into trans_* functions |
Date: | Mon, 21 Jan 2019 10:07:40 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 |
On 1/20/19 2:24 AM, Richard Henderson wrote:
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.
Oh, that is a very good catch. Thanks. Cheers, Bastian
[Prev in Thread] | Current Thread | [Next in Thread] |