diff options
author | Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> | 2017-03-04 19:32:09 +0530 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2017-03-06 13:17:28 +1100 |
commit | 182fe2cf19e829e34f63443ee1ccd9f799715c2c (patch) | |
tree | 4f3a201780c93a1e5fa3123594fc14bcd6dbe18c /target/ppc/fpu_helper.c | |
parent | 3e5b26cf57a28c2e33655205d8f49e633a75fa8c (diff) |
target/ppc: use helper for excp handling
Use the helper routine float[32,64]_maddsub_update_excp() in VSX_MADD
macro.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'target/ppc/fpu_helper.c')
-rw-r--r-- | target/ppc/fpu_helper.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/target/ppc/fpu_helper.c b/target/ppc/fpu_helper.c index 13bd6ce35c..c4dab159e4 100644 --- a/target/ppc/fpu_helper.c +++ b/target/ppc/fpu_helper.c @@ -773,6 +773,7 @@ static void NAME(CPUPPCState *env, TP arg1, TP arg2, TP arg3, \ } \ } \ } +FPU_MADDSUB_UPDATE(float32_maddsub_update_excp, float32) FPU_MADDSUB_UPDATE(float64_maddsub_update_excp, float64) #define FPU_FMADD(op, madd_flags) \ @@ -2239,24 +2240,7 @@ void helper_##op(CPUPPCState *env, uint32_t opcode) \ env->fp_status.float_exception_flags |= tstat.float_exception_flags; \ \ if (unlikely(tstat.float_exception_flags & float_flag_invalid)) { \ - if (tp##_is_signaling_nan(xa.fld, &tstat) || \ - tp##_is_signaling_nan(b->fld, &tstat) || \ - tp##_is_signaling_nan(c->fld, &tstat)) { \ - float_invalid_op_excp(env, POWERPC_EXCP_FP_VXSNAN, sfprf); \ - tstat.float_exception_flags &= ~float_flag_invalid; \ - } \ - if ((tp##_is_infinity(xa.fld) && tp##_is_zero(b->fld)) || \ - (tp##_is_zero(xa.fld) && tp##_is_infinity(b->fld))) { \ - xt_out.fld = float64_to_##tp(float_invalid_op_excp(env, \ - POWERPC_EXCP_FP_VXIMZ, sfprf), &env->fp_status); \ - tstat.float_exception_flags &= ~float_flag_invalid; \ - } \ - if ((tstat.float_exception_flags & float_flag_invalid) && \ - ((tp##_is_infinity(xa.fld) || \ - tp##_is_infinity(b->fld)) && \ - tp##_is_infinity(c->fld))) { \ - float_invalid_op_excp(env, POWERPC_EXCP_FP_VXISI, sfprf); \ - } \ + tp##_maddsub_update_excp(env, xa.fld, b->fld, c->fld, maddflgs); \ } \ \ if (r2sp) { \ |