|
From: | LIU Zhiwei |
Subject: | Re: [PATCH 13/13] target/riscv: Enable uxl field write |
Date: | Mon, 8 Nov 2021 20:10:07 +0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 |
On 2021/11/2 上午1:01, Richard Henderson wrote:
On 11/1/21 6:01 AM, LIU Zhiwei wrote:mask |= MSTATUS_MPV | MSTATUS_GVA; + if ((val ^ mstatus) & MSTATUS64_UXL) { + mask |= MSTATUS64_UXL; + }Why do you need the conditional here? Why is this not just mask |= MSTATUS_MPV | MSTATUS_GVA | MSTATUS64_UXL;
OK
static bool trans_csrrw(DisasContext *ctx, arg_csrrw *a) { - TCGv src = get_gpr(ctx, a->rs1, EXT_NONE); + TCGv src = get_gpr(ctx, a->rs1, EXT_ZERO);Hmm. Not sure about this.It looks like we should in fact change mask, just a few lines down, at which point the extension (or not) for the source would not matter. And likewise in trans_csrrwi.
It's better to use the mask. Thanks, Zhiwei
r~
[Prev in Thread] | Current Thread | [Next in Thread] |