From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50064) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCMXb-00073O-O5 for qemu-devel@nongnu.org; Mon, 13 Jun 2016 03:44:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCMXX-00029y-J9 for qemu-devel@nongnu.org; Mon, 13 Jun 2016 03:44:10 -0400 References: <1465795496-15071-1-git-send-email-clg@kaod.org> <1465795496-15071-10-git-send-email-clg@kaod.org> From: Thomas Huth Message-ID: <575E6443.5060005@redhat.com> Date: Mon, 13 Jun 2016 09:44:03 +0200 MIME-Version: 1.0 In-Reply-To: <1465795496-15071-10-git-send-email-clg@kaod.org> 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: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= , David Gibson Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org On 13.06.2016 07:24, C=C3=A9dric Le Goater wrote: > From: Benjamin Herrenschmidt >=20 > 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). >=20 > Signed-off-by: Benjamin Herrenschmidt > --- > target-ppc/translate.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) >=20 > 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; 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 to read, and the compiler can still decide to inline something in case it's better one a certain architecture. Thomas