From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCNML-00048q-R9 for qemu-devel@nongnu.org; Mon, 13 Jun 2016 04:36:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCNME-0004X9-V9 for qemu-devel@nongnu.org; Mon, 13 Jun 2016 04:36:34 -0400 Received: from 1.mo178.mail-out.ovh.net ([178.33.251.53]:50986) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCNME-0004X3-Ox for qemu-devel@nongnu.org; Mon, 13 Jun 2016 04:36:30 -0400 Received: from player791.ha.ovh.net (b9.ovh.net [213.186.33.59]) by mo178.mail-out.ovh.net (Postfix) with ESMTP id DC83C100CCBD for ; Mon, 13 Jun 2016 10:36:29 +0200 (CEST) References: <1465795496-15071-1-git-send-email-clg@kaod.org> <1465795496-15071-10-git-send-email-clg@kaod.org> <575E6443.5060005@redhat.com> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= Message-ID: <575E7088.9010900@kaod.org> Date: Mon, 13 Jun 2016 10:36:24 +0200 MIME-Version: 1.0 In-Reply-To: <575E6443.5060005@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 09/10] ppc: Move exception generation code out of line List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth , David Gibson Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org On 06/13/2016 09:44 AM, Thomas Huth wrote: > On 13.06.2016 07:24, C=C3=A9dric Le Goater wrote: >> From: Benjamin Herrenschmidt >> >> There's no point inlining this, if you hit the exception case you exit >> anyway, and not inlining saves about 100K of code size (and cache >> footprint). >> >> Signed-off-by: Benjamin Herrenschmidt >> --- >> target-ppc/translate.c | 9 ++++++--- >> 1 file changed, 6 insertions(+), 3 deletions(-) >> >> diff --git a/target-ppc/translate.c b/target-ppc/translate.c >> index f211d175c09c..600d5db2bb9a 100644 >> --- a/target-ppc/translate.c >> +++ b/target-ppc/translate.c >> @@ -283,7 +283,8 @@ void gen_update_current_nip(void *opaque) >> tcg_gen_movi_tl(cpu_nip, ctx->nip); >> } >> =20 >> -static inline void gen_exception_err(DisasContext *ctx, uint32_t excp= , uint32_t error) >> +static void __attribute__((noinline)) >> +gen_exception_err(DisasContext *ctx, uint32_t excp, uint32_t error) >> { >> TCGv_i32 t0, t1; >> if (ctx->exception =3D=3D POWERPC_EXCP_NONE) { >> @@ -297,7 +298,8 @@ static inline void gen_exception_err(DisasContext = *ctx, uint32_t excp, uint32_t >> ctx->exception =3D (excp); >> } >> =20 >> -static inline void gen_exception(DisasContext *ctx, uint32_t excp) >> +static void __attribute__((noinline)) >> +gen_exception(DisasContext *ctx, uint32_t excp) >> { >> TCGv_i32 t0; >> if (ctx->exception =3D=3D POWERPC_EXCP_NONE) { >> @@ -309,7 +311,8 @@ static inline void gen_exception(DisasContext *ctx= , uint32_t excp) >> ctx->exception =3D (excp); >> } >> =20 >> -static inline void gen_debug_exception(DisasContext *ctx) >> +static void __attribute__((noinline)) >> +gen_debug_exception(DisasContext *ctx) >> { >> TCGv_i32 t0; >=20 > Do you get the same results if you just remove the "inline" keyword, > without adding the "__attribute__((noinline))" ? If yes, I'd suggest to > do this patch without the "__attribute__((noinline))" - that's easier t= o > read, and the compiler can still decide to inline something in case it'= s > better one a certain architecture. Yes. They are no differences.=20 The interesting part though is that the .text is about the same size.=20 There is even a slight increase of ~2K with gcc 4.9.2 (intel host) and=20 a slight decrease of ~1K with gcc 5.3.1 (ppc64le host). I guess we can just drop that patch. It does not seem to bring much. Thanks, C.