Skip to contentSkip to conversation

ppc: Some FPU helper functions must be inline

PATCH In review Benjamin Herrenschmidt 2 participants 4 messages Jul 28, 2016 – Jul 29, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ppc: Some FPU helper functions must be inline

float_invalid_op_excp() and float_check_status() must be inline due to their use of GETPC().

Use __attribute__((__always_inline__)) to enforce it

---
 target-ppc/fpu_helper.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
target-ppc/fpu_helper.c +4 -3
index 65dc170..b0760f0 100644
@@ -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());
#1 lore raw
Quoted 6 lines · Benjamin Herrenschmidt

float_invalid_op_excp() and float_check_status() must be inline due to their use of GETPC().

Use __attribute__((__always_inline__)) to enforce it

Do you want me to fold this into the patch it fixes?

Quoted 30 lines
---
 target-ppc/fpu_helper.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
target-ppc/fpu_helper.c +4 -3
index 65dc170..b0760f0 100644
@@ -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());
Signature · 4 lines
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
#2 lore raw
Quoted 11 lines · David Gibson
Quoted 7 lines · Benjamin Herrenschmidt

float_invalid_op_excp() and float_check_status() must be inline due to their use of GETPC().

Use __attribute__((__always_inline__)) to enforce it

Do you want me to fold this into the patch it fixes?

Feel free, sure

Cheers,
Ben.

Quoted 36 lines
Quoted 35 lines

---
 target-ppc/fpu_helper.c | 7 ++++---

 1 file changed, 4 insertions(+), 3 deletions(-)
target-ppc/fpu_helper.c +0 -0
index 65dc170..b0760f0 100644
@@ -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)

target-ppc/fpu_helper.c +2 -0
+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;

target-ppc/fpu_helper.c +0 -0
@@ -519,7 +519,8 @@ static void do_float_check_status(CPUPPCState
 *env, uintptr_t raddr)
      }
  }

target-ppc/fpu_helper.c +2 -1
-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());

#3 lore raw
Quoted 7 lines · Benjamin Herrenschmidt
Quoted 6 lines · David Gibson
Quoted 4 lines · Benjamin Herrenschmidt

float_invalid_op_excp() and float_check_status() must be inline due to their use of GETPC().

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Use __attribute__((__always_inline__)) to enforce it

Do you want me to fold this into the patch it fixes?

Feel free, sure

Ok, done.

Signature · 4 lines
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