From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52958) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSzY3-0002yN-1l for qemu-devel@nongnu.org; Fri, 29 Jul 2016 00:37:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSzXy-0000FU-Nd for qemu-devel@nongnu.org; Fri, 29 Jul 2016 00:37:21 -0400 Message-ID: <1469767027.5978.242.camel@kernel.crashing.org> From: Benjamin Herrenschmidt Date: Fri, 29 Jul 2016 14:37:07 +1000 In-Reply-To: <20160729024416.GF2588@voom.fritz.box> References: <1469745225.5978.236.camel@kernel.crashing.org> <20160729024416.GF2588@voom.fritz.box> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] ppc: Some FPU helper functions must be inline List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Richard Henderson On Fri, 2016-07-29 at 12:44 +1000, David Gibson wrote: > On Fri, Jul 29, 2016 at 08:33:45AM +1000, Benjamin Herrenschmidt > wrote: > >=20 > > float_invalid_op_excp() and float_check_status() must be inline > > due to their use of GETPC(). > >=20 > > Use __attribute__((__always_inline__)) to enforce it > >=20 > > Signed-off-by: Benjamin Herrenschmidt >=20 > Do you want me to fold this into the patch it fixes? Feel free, sure Cheers, Ben. > >=20 > > --- > > =C2=A0target-ppc/fpu_helper.c | 7 ++++--- > > =C2=A01 file changed, 4 insertions(+), 3 deletions(-) > >=20 > > diff --git a/target-ppc/fpu_helper.c b/target-ppc/fpu_helper.c > > index 65dc170..b0760f0 100644 > > --- a/target-ppc/fpu_helper.c > > +++ b/target-ppc/fpu_helper.c > > @@ -117,8 +117,8 @@ void helper_compute_fprf(CPUPPCState *env, > > uint64_t arg) > > =C2=A0} > > =C2=A0 > > =C2=A0/* Floating-point invalid operations exception */ > > -static inline uint64_t float_invalid_op_excp(CPUPPCState *env, int > > op, > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0int set_fpcc) > > +static inline __attribute__((__always_inline__)) > > +uint64_t float_invalid_op_excp(CPUPPCState *env, int op, int > > set_fpcc) > > =C2=A0{ > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0CPUState *cs =3D CPU(ppc_env_get_cpu(en= v)); > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0uint64_t ret =3D 0; > > @@ -519,7 +519,8 @@ static void do_float_check_status(CPUPPCState > > *env, uintptr_t raddr) > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0} > > =C2=A0} > > =C2=A0 > > -static inline void float_check_status(CPUPPCState *env) > > +static inline=C2=A0=C2=A0__attribute__((__always_inline__)) > > +void float_check_status(CPUPPCState *env) > > =C2=A0{ > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* GETPC() works here because this is i= nline */ > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0do_float_check_status(env, GETPC()); > >=20 >=20