qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 18/25] tcg: Add TCG_MAX_INSNS


From: Aurelien Jarno
Subject: Re: [Qemu-devel] [PATCH v3 18/25] tcg: Add TCG_MAX_INSNS
Date: Thu, 24 Sep 2015 22:02:52 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

On 2015-09-22 13:25, Richard Henderson wrote:
> Adjust all translators to respect it.
> 
> Reviewed-by: Peter Maydell <address@hidden>
> Signed-off-by: Richard Henderson <address@hidden>
> ---
>  target-alpha/translate.c      |  3 +++
>  target-arm/translate-a64.c    |  3 +++
>  target-arm/translate.c        |  6 +++++-
>  target-cris/translate.c       |  3 +++
>  target-i386/translate.c       |  6 +++++-
>  target-lm32/translate.c       |  3 +++
>  target-m68k/translate.c       |  6 +++++-
>  target-microblaze/translate.c |  6 +++++-
>  target-mips/translate.c       |  7 ++++++-
>  target-moxie/translate.c      | 13 +++++++++++--
>  target-openrisc/translate.c   |  3 +++
>  target-ppc/translate.c        |  6 +++++-
>  target-s390x/translate.c      |  3 +++
>  target-sh4/translate.c        |  7 ++++++-
>  target-sparc/translate.c      |  7 ++++++-
>  target-tilegx/translate.c     |  3 +++
>  target-tricore/translate.c    | 20 +++++++++++++-------
>  target-unicore32/translate.c  |  3 +++
>  target-xtensa/translate.c     |  3 +++
>  tcg/tcg.h                     |  1 +
>  20 files changed, 95 insertions(+), 17 deletions(-)
> 
> diff --git a/target-alpha/translate.c b/target-alpha/translate.c
> index c10193e..538e202 100644
> --- a/target-alpha/translate.c
> +++ b/target-alpha/translate.c
> @@ -2903,6 +2903,9 @@ static inline void 
> gen_intermediate_code_internal(AlphaCPU *cpu,
>      if (max_insns == 0) {
>          max_insns = CF_COUNT_MASK;
>      }

I guess you can change also change the value to TCG_MAX_INSNS, though I
guess the compiler will realize about that.

> +    if (max_insns > TCG_MAX_INSNS) {
> +        max_insns = TCG_MAX_INSNS;
> +    }
>  
>      if (in_superpage(&ctx, pc_start)) {
>          pc_mask = (1ULL << 41) - 1;

Given we have the same pattern in all targets, I do wonder if it
wouldn't be better to just setup (cflags & CF_COUNT_MASK) to
TCG_MAX_INSNS instead of 0 in translate-all.c when not using icount.

That said your code is correct, so:

Reviewed-by: Aurelien Jarno <address@hidden>

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
address@hidden                 http://www.aurel32.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]