[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [Qemu-devel] [PATCH] target/ppc: Use tcg_gen_lookup_and_g
From: |
Thomas Huth |
Subject: |
Re: [Qemu-ppc] [Qemu-devel] [PATCH] target/ppc: Use tcg_gen_lookup_and_goto_ptr |
Date: |
Fri, 22 Sep 2017 16:33:40 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
On 30.06.2017 20:37, Richard Henderson wrote:
> Cc: address@hidden
> Signed-off-by: Richard Henderson <address@hidden>
> ---
> target/ppc/translate.c | 23 ++++++++---------------
> 1 file changed, 8 insertions(+), 15 deletions(-)
>
> diff --git a/target/ppc/translate.c b/target/ppc/translate.c
> index c0cd64d..9aa66f5 100644
> --- a/target/ppc/translate.c
> +++ b/target/ppc/translate.c
> @@ -3419,7 +3419,7 @@ static inline bool use_goto_tb(DisasContext *ctx,
> target_ulong dest)
> }
>
> /*** Branch
> ***/
> -static inline void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest)
> +static void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest)
> {
> if (NARROW_MODE(ctx)) {
> dest = (uint32_t) dest;
> @@ -3441,7 +3441,7 @@ static inline void gen_goto_tb(DisasContext *ctx, int
> n, target_ulong dest)
> gen_debug_exception(ctx);
> }
> }
> - tcg_gen_exit_tb(0);
> + tcg_gen_lookup_and_goto_ptr(cpu_nip);
> }
> }
>
> @@ -3479,7 +3479,7 @@ static void gen_b(DisasContext *ctx)
> #define BCOND_CTR 2
> #define BCOND_TAR 3
>
> -static inline void gen_bcond(DisasContext *ctx, int type)
> +static void gen_bcond(DisasContext *ctx, int type)
> {
> uint32_t bo = BO(ctx->opcode);
> TCGLabel *l1;
> @@ -3543,26 +3543,19 @@ static inline void gen_bcond(DisasContext *ctx, int
> type)
> } else {
> gen_goto_tb(ctx, 0, li);
> }
> - if ((bo & 0x14) != 0x14) {
> - gen_set_label(l1);
> - gen_goto_tb(ctx, 1, ctx->nip);
> - }
> } else {
> if (NARROW_MODE(ctx)) {
> tcg_gen_andi_tl(cpu_nip, target, (uint32_t)~3);
> } else {
> tcg_gen_andi_tl(cpu_nip, target, ~3);
> }
> - tcg_gen_exit_tb(0);
> - if ((bo & 0x14) != 0x14) {
> - gen_set_label(l1);
> - gen_update_nip(ctx, ctx->nip);
> - tcg_gen_exit_tb(0);
> - }
> - }
> - if (type == BCOND_LR || type == BCOND_CTR || type == BCOND_TAR) {
> + tcg_gen_lookup_and_goto_ptr(cpu_nip);
> tcg_temp_free(target);
> }
> + if ((bo & 0x14) != 0x14) {
> + gen_set_label(l1);
> + gen_goto_tb(ctx, 1, ctx->nip);
> + }
> }
>
> static void gen_bc(DisasContext *ctx)
>
Using this patch increases the speed of the SLOF firmware boot quite a
bit! The following simple test finishes at least 4 seconds faster when
I've got this patch applied:
time ppc64-softmmu/qemu-system-ppc64 -nographic -vga none \
-prom-env 'boot-command=power-off'
I also can still run my big endian and my little endian pseries guest
images successfully, so feel free to add my:
Tested-by: Thomas Huth <address@hidden>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-ppc] [Qemu-devel] [PATCH] target/ppc: Use tcg_gen_lookup_and_goto_ptr,
Thomas Huth <=