On 06/20/2018 05:05 AM, Yongbok Kim wrote:
> +static void gen_restore(DisasContext *ctx, uint8_t rt, uint8_t count,
> +                        uint8_t gp, uint16_t u)
> +{
> +    int counter = 0;
> +    TCGv va = tcg_temp_new();
> +    TCGv t0 = tcg_temp_new();
> +
> +    while (counter != count) {

Better written as a for loop?

> +        bool use_gp = gp && (counter == count - 1);
> +        int this_rt = use_gp ? 28 : (rt & 0x10) | ((rt + counter) & 0x1f);
> +        int this_offset = u - ((counter + 1) << 2);
> +        gen_base_offset_addr(ctx, va, 29, this_offset);
> +        tcg_gen_qemu_ld_tl(t0, va, ctx->mem_idx, MO_TESL |
> +                        ctx->default_tcg_memop_mask);

Indentation.

> +        tcg_gen_ext32s_tl(t0, t0);

You do not need to sign-extend; you've just loaded a sign-extended 32-bit value
via MO_TESL.


r~

Reply via email to