diff mbox series

[1/2] fixup! target/ppc: Honor fpscr_ze semantics and tidy fdiv

Message ID 20180806012723.5639-2-richard.henderson@linaro.org
State New
Headers show
Series target/ppc: Fixes for my fpu cleanups | expand

Commit Message

Richard Henderson Aug. 6, 2018, 1:27 a.m. UTC
---
 target/ppc/fpu_helper.c | 6 ++++++
 1 file changed, 6 insertions(+)

-- 
2.17.1
diff mbox series

Patch

diff --git a/target/ppc/fpu_helper.c b/target/ppc/fpu_helper.c
index cb82e6e842..faea64020b 100644
--- a/target/ppc/fpu_helper.c
+++ b/target/ppc/fpu_helper.c
@@ -1965,6 +1965,9 @@  void helper_##op(CPUPPCState *env, uint32_t opcode)                           \
                 tp##_is_signaling_nan(xb.fld, &tstat)) {                      \
                 float_invalid_op_excp(env, POWERPC_EXCP_FP_VXSNAN, sfprf);    \
             }                                                                 \
+        }                                                                     \
+        if (unlikely(tstat.float_exception_flags & float_flag_divbyzero)) {   \
+            float_zero_divide_excp(env, GETPC());                             \
         }                                                                     \
                                                                               \
         if (r2sp) {                                                           \
@@ -2015,6 +2018,9 @@  void helper_xsdivqp(CPUPPCState *env, uint32_t opcode)
             float_invalid_op_excp(env, POWERPC_EXCP_FP_VXSNAN, 1);
         }
     }
+    if (unlikely(tstat.float_exception_flags & float_flag_divbyzero)) {
+        float_zero_divide_excp(env, GETPC());
+    }
 
     helper_compute_fprf_float128(env, xt.f128);
     putVSR(rD(opcode) + 32, &xt, env);