From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57378) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfCjI-0001Cq-26 for qemu-devel@nongnu.org; Thu, 24 Sep 2015 16:02:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZfCjH-0001yW-0C for qemu-devel@nongnu.org; Thu, 24 Sep 2015 16:02:55 -0400 Received: from hall.aurel32.net ([2001:bc8:30d7:100::1]:59400) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfCjG-0001yP-R0 for qemu-devel@nongnu.org; Thu, 24 Sep 2015 16:02:54 -0400 Date: Thu, 24 Sep 2015 22:02:52 +0200 From: Aurelien Jarno Message-ID: <20150924200252.GG12978@aurel32.net> References: <1442953507-4074-1-git-send-email-rth@twiddle.net> <1442953507-4074-19-git-send-email-rth@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1442953507-4074-19-git-send-email-rth@twiddle.net> Subject: Re: [Qemu-devel] [PATCH v3 18/25] tcg: Add TCG_MAX_INSNS List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: peter.maydell@linaro.org, alex.bennee@linaro.org, qemu-devel@nongnu.org On 2015-09-22 13:25, Richard Henderson wrote: > Adjust all translators to respect it. > > Reviewed-by: Peter Maydell > Signed-off-by: Richard Henderson > --- > 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 -- Aurelien Jarno GPG: 4096R/1DDD8C9B aurelien@aurel32.net http://www.aurel32.net