[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 07/35] target/mips: Add nanoMIPS save and restor
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH 07/35] target/mips: Add nanoMIPS save and restore |
Date: |
Thu, 21 Jun 2018 22:11:00 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 |
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~
- Re: [Qemu-devel] [PATCH 02/35] target/mips: Fix microMIPS on reset, (continued)
- [Qemu-devel] [PATCH 03/35] target/mips: Add nanoMIPS OPCODE table, Yongbok Kim, 2018/06/20
- [Qemu-devel] [PATCH 04/35] target/mips: Add decode_nanomips_opc(), Yongbok Kim, 2018/06/20
- [Qemu-devel] [PATCH 05/35] target/mips: Add nanoMIPS 16bit ld/st instructions, Yongbok Kim, 2018/06/20
- [Qemu-devel] [PATCH 06/35] target/mips: Add nanoMIPS pool16c instructions, Yongbok Kim, 2018/06/20
- [Qemu-devel] [PATCH 07/35] target/mips: Add nanoMIPS save and restore, Yongbok Kim, 2018/06/20
- Re: [Qemu-devel] [PATCH 07/35] target/mips: Add nanoMIPS save and restore,
Richard Henderson <=
- [Qemu-devel] [PATCH 08/35] target/mips: Add nanoMIPS 32bit instructions, Yongbok Kim, 2018/06/20
- [Qemu-devel] [PATCH 09/35] target/mips: Add nanoMIPS 48bit instructions, Yongbok Kim, 2018/06/20
- [Qemu-devel] [PATCH 10/35] target/mips: Add nanoMIPS pool32f instructions, Yongbok Kim, 2018/06/20
- [Qemu-devel] [PATCH 11/35] target/mips: Add nanoMIPS pool32a0 instructions, Yongbok Kim, 2018/06/20
- [Qemu-devel] [PATCH 12/35] target/mips: Add nanoMIPS pool32axf instructions, Yongbok Kim, 2018/06/20
- [Qemu-devel] [PATCH 13/35] target/mips: Update gen_flt_ldst(), Yongbok Kim, 2018/06/20