diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2021-12-17 17:57:16 +0100 |
---|---|---|
committer | Cédric Le Goater <clg@kaod.org> | 2021-12-17 17:57:16 +0100 |
commit | 7f87214e3b9f0d562d75f9c7315bfa53b00d29a6 (patch) | |
tree | 77c8633576fbd602228d5ac425ba4d91e8935fe5 /target/ppc/fpu_helper.c | |
parent | d9e792a1c17020ea87f281b83d4d79a1fda3856f (diff) |
target/ppc: Add helper for fmuls
Use float64r32_mul. Fixes a double-rounding issue with performing
the compuation in float64 and then rounding afterward.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20211119160502.17432-32-richard.henderson@linaro.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Diffstat (limited to 'target/ppc/fpu_helper.c')
-rw-r--r-- | target/ppc/fpu_helper.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/target/ppc/fpu_helper.c b/target/ppc/fpu_helper.c index c36cf05d80..4acc557c08 100644 --- a/target/ppc/fpu_helper.c +++ b/target/ppc/fpu_helper.c @@ -581,6 +581,18 @@ float64 helper_fmul(CPUPPCState *env, float64 arg1, float64 arg2) return ret; } +/* fmuls - fmuls. */ +float64 helper_fmuls(CPUPPCState *env, float64 arg1, float64 arg2) +{ + float64 ret = float64r32_mul(arg1, arg2, &env->fp_status); + int flags = get_float_exception_flags(&env->fp_status); + + if (unlikely(flags & float_flag_invalid)) { + float_invalid_op_mul(env, flags, 1, GETPC()); + } + return ret; +} + static void float_invalid_op_div(CPUPPCState *env, int flags, bool set_fprc, uintptr_t retaddr) { |