[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 038/101] target/ppc: Split out do_fmadd
From: |
Cédric Le Goater |
Subject: |
[PULL 038/101] target/ppc: Split out do_fmadd |
Date: |
Thu, 16 Dec 2021 21:25:11 +0100 |
From: Richard Henderson <richard.henderson@linaro.org>
Create a common function for all of the madd helpers.
Let the compiler tail call or inline as it chooses.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20211119160502.17432-20-richard.henderson@linaro.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
target/ppc/fpu_helper.c | 33 ++++++++++++++++++---------------
1 file changed, 18 insertions(+), 15 deletions(-)
diff --git a/target/ppc/fpu_helper.c b/target/ppc/fpu_helper.c
index f5d6bb4eba76..d7e0362e808e 100644
--- a/target/ppc/fpu_helper.c
+++ b/target/ppc/fpu_helper.c
@@ -693,23 +693,26 @@ static void float_invalid_op_madd(CPUPPCState *env, int
flags,
}
}
-#define FPU_FMADD(op, madd_flags) \
-uint64_t helper_##op(CPUPPCState *env, uint64_t arg1, \
- uint64_t arg2, uint64_t arg3) \
-{ \
- uint32_t flags; \
- float64 ret = float64_muladd(arg1, arg2, arg3, madd_flags, \
- &env->fp_status); \
- flags = get_float_exception_flags(&env->fp_status); \
- if (flags) { \
- if (flags & float_flag_invalid) { \
- float_invalid_op_madd(env, flags, 1, GETPC()); \
- } \
- do_float_check_status(env, GETPC()); \
- } \
- return ret; \
+static float64 do_fmadd(CPUPPCState *env, float64 a, float64 b,
+ float64 c, int madd_flags, uintptr_t retaddr)
+{
+ float64 ret = float64_muladd(a, b, c, madd_flags, &env->fp_status);
+ int flags = get_float_exception_flags(&env->fp_status);
+
+ if (flags) {
+ if (flags & float_flag_invalid) {
+ float_invalid_op_madd(env, flags, 1, retaddr);
+ }
+ do_float_check_status(env, retaddr);
+ }
+ return ret;
}
+#define FPU_FMADD(op, madd_flags) \
+ uint64_t helper_##op(CPUPPCState *env, uint64_t arg1, \
+ uint64_t arg2, uint64_t arg3) \
+ { return do_fmadd(env, arg1, arg2, arg3, madd_flags, GETPC()); }
+
#define MADD_FLGS 0
#define MSUB_FLGS float_muladd_negate_c
#define NMADD_FLGS float_muladd_negate_result
--
2.31.1
- [PULL 048/101] target/ppc: Add helper for fsqrts, (continued)
- [PULL 048/101] target/ppc: Add helper for fsqrts, Cédric Le Goater, 2021/12/16
- [PULL 051/101] target/ppc: Add helper for frsqrtes, Cédric Le Goater, 2021/12/16
- [PULL 046/101] softfloat: Add float64r32 arithmetic routines, Cédric Le Goater, 2021/12/16
- [PULL 055/101] target/ppc: Disable unused facilities in the e600 CPU, Cédric Le Goater, 2021/12/16
- [PULL 042/101] target/ppc: Use helper_todouble in do_frsp, Cédric Le Goater, 2021/12/16
- [PULL 052/101] target/ppc: Update fres to new flags and float64r32, Cédric Le Goater, 2021/12/16
- [PULL 061/101] ppc/ppc405: Change kernel load address, Cédric Le Goater, 2021/12/16
- [PULL 053/101] target/ppc: Use helper_todouble/tosingle in helper_xststdcsp, Cédric Le Goater, 2021/12/16
- [PULL 068/101] ppc/ppc405: Remove flash support, Cédric Le Goater, 2021/12/16
- [PULL 077/101] target/ppc: fix xscvqpdp register access, Cédric Le Goater, 2021/12/16
- [PULL 038/101] target/ppc: Split out do_fmadd,
Cédric Le Goater <=
- [PULL 040/101] target/ppc: Split out do_frsp, Cédric Le Goater, 2021/12/16
- [PULL 041/101] target/ppc: Update do_frsp for new flags, Cédric Le Goater, 2021/12/16
- [PULL 044/101] target/ppc: Update xsrqpi and xsrqpxp to new flags, Cédric Le Goater, 2021/12/16
- [PULL 045/101] target/ppc: Update fre to new flags, Cédric Le Goater, 2021/12/16
- [PULL 022/101] softfloat: Add flag specific to Inf * 0, Cédric Le Goater, 2021/12/16
- [PULL 032/101] target/ppc: Fix VXCVI return value, Cédric Le Goater, 2021/12/16
- [PULL 043/101] target/ppc: Update sqrt for new flags, Cédric Le Goater, 2021/12/16
- [PULL 050/101] target/ppc: Add helper for fmuls, Cédric Le Goater, 2021/12/16
- [PULL 047/101] target/ppc: Add helpers for fmadds et al, Cédric Le Goater, 2021/12/16
- [PULL 054/101] target/ppc: Disable software TLB for the 7450 family, Cédric Le Goater, 2021/12/16