On Wed, Aug 18, 2021 at 7:23 AM Richard Henderson
wrote:
>
> Introduce get_gpr, dest_gpr, temp_new -- new helpers that do not force
> tcg globals into temps, returning a constant 0 for $zero as source and
> a new temp for $zero as destination.
>
> Introduce ctx->w for simplifying word operations,
On 8/18/21 12:58 AM, Bin Meng wrote:
+TCGv temp[4];
Why is 4? Is it enough? Perhaps a comment here is needed here?
It's a round number that will cover three operands plus an extra for address
computation.
r~
On 8/18/21 12:58 AM, Bin Meng wrote:
+static void gen_set_gpr(DisasContext *ctx, int reg_num, TCGv t)
+{
+if (reg_num != 0) {
+if (ctx->w) {
+tcg_gen_ext32s_tl(cpu_gpr[reg_num], t);
What about zero extension?
All of the RV64 word instructions sign-extend the result.
On Wed, Aug 18, 2021 at 5:22 AM Richard Henderson
wrote:
>
> Introduce get_gpr, dest_gpr, temp_new -- new helpers that do not force
> tcg globals into temps, returning a constant 0 for $zero as source and
> a new temp for $zero as destination.
>
> Introduce ctx->w for simplifying word operations,
Introduce get_gpr, dest_gpr, temp_new -- new helpers that do not force
tcg globals into temps, returning a constant 0 for $zero as source and
a new temp for $zero as destination.
Introduce ctx->w for simplifying word operations, such as addw.
Signed-off-by: Richard Henderson
---
target/riscv/tr