[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 5/5] target-arm/translate.c: Don't pass CPUARMSt
From: |
Alex Bennée |
Subject: |
Re: [Qemu-devel] [PATCH 5/5] target-arm/translate.c: Don't pass CPUARMState * to disas_arm_insn() |
Date: |
Fri, 31 Oct 2014 13:47:18 +0000 |
Peter Maydell <address@hidden> writes:
> Refactor to avoid passing a CPUARMState * to disas_arm_insn(). To do this
> we move the "read insn from memory" code to the callsite and pass the
> insn to the function instead.
>
<snip>
>
> -static void disas_arm_insn(CPUARMState * env, DisasContext *s)
> +static void disas_arm_insn(DisasContext *s, unsigned int insn)
I note that in the aarch64 code we used the unambiguous uint32_t for the
insn type. I'm hard pressed to imagine it actually breaking anything
though.
> {
> - unsigned int cond, insn, val, op1, i, shift, rm, rs, rn, rd, sh;
> + unsigned int cond, val, op1, i, shift, rm, rs, rn, rd, sh;
> TCGv_i32 tmp;
> TCGv_i32 tmp2;
> TCGv_i32 tmp3;
> TCGv_i32 addr;
> TCGv_i64 tmp64;
>
> - insn = arm_ldl_code(env, s->pc, s->bswap_code);
> - s->pc += 4;
> -
> /* M variants do not implement ARM mode. */
> if (arm_dc_feature(s, ARM_FEATURE_M)) {
> goto illegal_op;
> @@ -11199,7 +11196,9 @@ static inline void
> gen_intermediate_code_internal(ARMCPU *cpu,
> }
> }
> } else {
> - disas_arm_insn(env, dc);
> + unsigned int insn = arm_ldl_code(env, dc->pc, dc->bswap_code);
> + dc->pc += 4;
> + disas_arm_insn(dc, insn);
> }
>
> if (dc->condjmp && !dc->is_jmp) {
Anyway looks fine:
Reviewed-by: Alex Bennée <address@hidden>
--
Alex Bennée
- [Qemu-devel] [PATCH 0/5] target-arm: Avoid passing CPUARMState around the decoder, Peter Maydell, 2014/10/28
- [Qemu-devel] [PATCH 5/5] target-arm/translate.c: Don't pass CPUARMState * to disas_arm_insn(), Peter Maydell, 2014/10/28
- Re: [Qemu-devel] [PATCH 5/5] target-arm/translate.c: Don't pass CPUARMState * to disas_arm_insn(),
Alex Bennée <=
- [Qemu-devel] [PATCH 1/5] target-arm/translate.c: Use arm_dc_feature() in ENABLE_ARCH_ macros, Peter Maydell, 2014/10/28
- [Qemu-devel] [PATCH 2/5] target-arm/translate.c: Use arm_dc_feature() rather than arm_feature(), Peter Maydell, 2014/10/28
- [Qemu-devel] [PATCH 3/5] target-arm/translate.c: Don't use IS_M(), Peter Maydell, 2014/10/28
- [Qemu-devel] [PATCH 4/5] target-arm/translate.c: Don't pass CPUARMState around in the decoder, Peter Maydell, 2014/10/28