diff mbox series

[v3,27/50] target/ppc: fetch code with translator_ld

Message ID 20190614171200.21078-28-alex.bennee@linaro.org
State Superseded
Headers show
Series tcg plugin support | expand

Commit Message

Alex Bennée June 14, 2019, 5:11 p.m. UTC
From: "Emilio G. Cota" <cota@braap.org>


Signed-off-by: Emilio G. Cota <cota@braap.org>

---
 target/ppc/translate.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

-- 
2.20.1

Comments

Richard Henderson June 17, 2019, 10:30 p.m. UTC | #1
On 6/14/19 10:11 AM, Alex Bennée wrote:
> -    if (unlikely(need_byteswap(ctx))) {

> -        ctx->opcode = bswap32(cpu_ldl_code(env, ctx->base.pc_next));

> -    } else {

> -        ctx->opcode = cpu_ldl_code(env, ctx->base.pc_next);

> -    }

> +    ctx->opcode = translator_ldl_swap(env, ctx->base.pc_next,

> +                                      need_byteswap(ctx));

> +


Reviewed-by: Richard Henderson <richard.henderson@linaro.org>



r~
David Gibson June 19, 2019, 9:39 a.m. UTC | #2
On Fri, Jun 14, 2019 at 06:11:37PM +0100, Alex Bennée wrote:
> From: "Emilio G. Cota" <cota@braap.org>

> 

> Signed-off-by: Emilio G. Cota <cota@braap.org>


Acked-by: David Gibson <david@gibson.dropbear.id.au>


> ---

>  target/ppc/translate.c | 8 +++-----

>  1 file changed, 3 insertions(+), 5 deletions(-)

> 

> diff --git a/target/ppc/translate.c b/target/ppc/translate.c

> index 4a5de28036..a27b5659f4 100644

> --- a/target/ppc/translate.c

> +++ b/target/ppc/translate.c

> @@ -7864,11 +7864,9 @@ static void ppc_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs)

>      LOG_DISAS("nip=" TARGET_FMT_lx " super=%d ir=%d\n",

>                ctx->base.pc_next, ctx->mem_idx, (int)msr_ir);

>  

> -    if (unlikely(need_byteswap(ctx))) {

> -        ctx->opcode = bswap32(cpu_ldl_code(env, ctx->base.pc_next));

> -    } else {

> -        ctx->opcode = cpu_ldl_code(env, ctx->base.pc_next);

> -    }

> +    ctx->opcode = translator_ldl_swap(env, ctx->base.pc_next,

> +                                      need_byteswap(ctx));

> +

>      LOG_DISAS("translate opcode %08x (%02x %02x %02x %02x) (%s)\n",

>                ctx->opcode, opc1(ctx->opcode), opc2(ctx->opcode),

>                opc3(ctx->opcode), opc4(ctx->opcode),


-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
diff mbox series

Patch

diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index 4a5de28036..a27b5659f4 100644
--- a/target/ppc/translate.c
+++ b/target/ppc/translate.c
@@ -7864,11 +7864,9 @@  static void ppc_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs)
     LOG_DISAS("nip=" TARGET_FMT_lx " super=%d ir=%d\n",
               ctx->base.pc_next, ctx->mem_idx, (int)msr_ir);
 
-    if (unlikely(need_byteswap(ctx))) {
-        ctx->opcode = bswap32(cpu_ldl_code(env, ctx->base.pc_next));
-    } else {
-        ctx->opcode = cpu_ldl_code(env, ctx->base.pc_next);
-    }
+    ctx->opcode = translator_ldl_swap(env, ctx->base.pc_next,
+                                      need_byteswap(ctx));
+
     LOG_DISAS("translate opcode %08x (%02x %02x %02x %02x) (%s)\n",
               ctx->opcode, opc1(ctx->opcode), opc2(ctx->opcode),
               opc3(ctx->opcode), opc4(ctx->opcode),