* [Qemu-devel] [PATCH] ppc: Some FPU helper functions must be inline
@ 2016-07-28 22:33 Benjamin Herrenschmidt
2016-07-29 2:44 ` David Gibson
0 siblings, 1 reply; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2016-07-28 22:33 UTC (permalink / raw)
To: qemu-ppc; +Cc: qemu-devel, david, Richard Henderson
float_invalid_op_excp() and float_check_status() must be inline
due to their use of GETPC().
Use __attribute__((__always_inline__)) to enforce it
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
target-ppc/fpu_helper.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
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)
}
/* Floating-point invalid operations exception */
-static inline uint64_t float_invalid_op_excp(CPUPPCState *env, int op,
- int set_fpcc)
+static inline __attribute__((__always_inline__))
+uint64_t float_invalid_op_excp(CPUPPCState *env, int op, int set_fpcc)
{
CPUState *cs = CPU(ppc_env_get_cpu(env));
uint64_t ret = 0;
@@ -519,7 +519,8 @@ static void do_float_check_status(CPUPPCState *env, uintptr_t raddr)
}
}
-static inline void float_check_status(CPUPPCState *env)
+static inline __attribute__((__always_inline__))
+void float_check_status(CPUPPCState *env)
{
/* GETPC() works here because this is inline */
do_float_check_status(env, GETPC());
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] ppc: Some FPU helper functions must be inline
2016-07-28 22:33 [Qemu-devel] [PATCH] ppc: Some FPU helper functions must be inline Benjamin Herrenschmidt
@ 2016-07-29 2:44 ` David Gibson
2016-07-29 4:37 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 4+ messages in thread
From: David Gibson @ 2016-07-29 2:44 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: qemu-ppc, qemu-devel, Richard Henderson
[-- Attachment #1: Type: text/plain, Size: 1703 bytes --]
On Fri, Jul 29, 2016 at 08:33:45AM +1000, Benjamin Herrenschmidt wrote:
> float_invalid_op_excp() and float_check_status() must be inline
> due to their use of GETPC().
>
> Use __attribute__((__always_inline__)) to enforce it
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Do you want me to fold this into the patch it fixes?
> ---
> target-ppc/fpu_helper.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> 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)
> }
>
> /* Floating-point invalid operations exception */
> -static inline uint64_t float_invalid_op_excp(CPUPPCState *env, int op,
> - int set_fpcc)
> +static inline __attribute__((__always_inline__))
> +uint64_t float_invalid_op_excp(CPUPPCState *env, int op, int set_fpcc)
> {
> CPUState *cs = CPU(ppc_env_get_cpu(env));
> uint64_t ret = 0;
> @@ -519,7 +519,8 @@ static void do_float_check_status(CPUPPCState *env, uintptr_t raddr)
> }
> }
>
> -static inline void float_check_status(CPUPPCState *env)
> +static inline __attribute__((__always_inline__))
> +void float_check_status(CPUPPCState *env)
> {
> /* GETPC() works here because this is inline */
> do_float_check_status(env, GETPC());
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] ppc: Some FPU helper functions must be inline
2016-07-29 2:44 ` David Gibson
@ 2016-07-29 4:37 ` Benjamin Herrenschmidt
2016-07-29 5:32 ` David Gibson
0 siblings, 1 reply; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2016-07-29 4:37 UTC (permalink / raw)
To: David Gibson; +Cc: qemu-ppc, qemu-devel, 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:
> >
> > float_invalid_op_excp() and float_check_status() must be inline
> > due to their use of GETPC().
> >
> > Use __attribute__((__always_inline__)) to enforce it
> >
> > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>
> Do you want me to fold this into the patch it fixes?
Feel free, sure
Cheers,
Ben.
> >
> > ---
> > target-ppc/fpu_helper.c | 7 ++++---
> > 1 file changed, 4 insertions(+), 3 deletions(-)
> >
> > 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)
> > }
> >
> > /* Floating-point invalid operations exception */
> > -static inline uint64_t float_invalid_op_excp(CPUPPCState *env, int
> > op,
> > - int set_fpcc)
> > +static inline __attribute__((__always_inline__))
> > +uint64_t float_invalid_op_excp(CPUPPCState *env, int op, int
> > set_fpcc)
> > {
> > CPUState *cs = CPU(ppc_env_get_cpu(env));
> > uint64_t ret = 0;
> > @@ -519,7 +519,8 @@ static void do_float_check_status(CPUPPCState
> > *env, uintptr_t raddr)
> > }
> > }
> >
> > -static inline void float_check_status(CPUPPCState *env)
> > +static inline __attribute__((__always_inline__))
> > +void float_check_status(CPUPPCState *env)
> > {
> > /* GETPC() works here because this is inline */
> > do_float_check_status(env, GETPC());
> >
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] ppc: Some FPU helper functions must be inline
2016-07-29 4:37 ` Benjamin Herrenschmidt
@ 2016-07-29 5:32 ` David Gibson
0 siblings, 0 replies; 4+ messages in thread
From: David Gibson @ 2016-07-29 5:32 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: qemu-ppc, qemu-devel, Richard Henderson
[-- Attachment #1: Type: text/plain, Size: 772 bytes --]
On Fri, Jul 29, 2016 at 02:37:07PM +1000, Benjamin Herrenschmidt wrote:
> 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:
> > >
> > > float_invalid_op_excp() and float_check_status() must be inline
> > > due to their use of GETPC().
> > >
> > > Use __attribute__((__always_inline__)) to enforce it
> > >
> > > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> >
> > Do you want me to fold this into the patch it fixes?
>
> Feel free, sure
Ok, done.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-07-29 5:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-28 22:33 [Qemu-devel] [PATCH] ppc: Some FPU helper functions must be inline Benjamin Herrenschmidt
2016-07-29 2:44 ` David Gibson
2016-07-29 4:37 ` Benjamin Herrenschmidt
2016-07-29 5:32 ` David Gibson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).