|
From: | Bastian Koppelmann |
Subject: | Re: [Qemu-devel] [PATCH 16/28] target/riscv: Convert quadrant 1 of RVXC insns to decodetree |
Date: | Fri, 19 Oct 2018 17:28:38 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 |
On 10/13/18 8:53 PM, Richard Henderson wrote:
On 10/12/18 10:30 AM, Bastian Koppelmann wrote:+static bool trans_c_addi(DisasContext *ctx, arg_c_addi *a, uint16_t insn) +{ + if (a->imm == 0) { + return true; + }return false, I think.
Those are HINTS, which means the instruction in valid, but does not affect state, so true is correct. If I do return false, then Linux does not boot anymore :)
+ arg_jal arg = { .rd = 1, .imm = a->imm }; + return trans_jal(ctx, &arg, insn); +#else + /* C.ADDIW */ + arg_addiw arg = { .rd = a->rd, .rs1 = a->rd, .imm = a->imm }; + return trans_addiw(ctx, &arg, insn); +#endif +} + +static bool trans_c_li(DisasContext *ctx, arg_c_li *a, uint16_t insn) +{ + if (a->rd == 0) { + return true; + }return false.
Likewise.
+static bool trans_c_addi16sp_lui(DisasContext *ctx, arg_c_addi16sp_lui *a, + uint16_t insn) +{ + if (a->rd == 2) { + /* C.ADDI16SP */ + arg_addi arg = { .rd = 2, .rs1 = 2, .imm = a->imm_addi16sp }; + return trans_addi(ctx, &arg, insn); + } else if (a->imm_lui != 0) { + if (a->rd == 0) { + return true; + }I think it should be } else if (a->imm_lui != 0 && a->rd != 0) {
Likewise. Cheers, Bastian
[Prev in Thread] | Current Thread | [Next in Thread] |