diff options
| author | Nikunj A Dadhania | 2017-02-23 20:56:26 +0100 |
|---|---|---|
| committer | David Gibson | 2017-03-01 01:23:39 +0100 |
| commit | f32899de97fc35d0de5f66e762d1a05707f104cd (patch) | |
| tree | 068c00961d2799396721f2b9a6a45e8bfc9926e5 /target/ppc | |
| parent | spapr: generate DT node names (diff) | |
| download | qemu-f32899de97fc35d0de5f66e762d1a05707f104cd.tar.gz qemu-f32899de97fc35d0de5f66e762d1a05707f104cd.tar.xz qemu-f32899de97fc35d0de5f66e762d1a05707f104cd.zip | |
target/ppc: introduce helper_update_ov_legacy
Removes duplicate code and will be useful for consolidating flags
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')
| -rw-r--r-- | target/ppc/int_helper.c | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c index dd0a8929b3..da4e1a62c9 100644 --- a/target/ppc/int_helper.c +++ b/target/ppc/int_helper.c @@ -28,6 +28,15 @@ /*****************************************************************************/ /* Fixed point operations helpers */ +static inline void helper_update_ov_legacy(CPUPPCState *env, int ov) +{ + if (unlikely(ov)) { + env->so = env->ov = 1; + } else { + env->ov = 0; + } +} + target_ulong helper_divweu(CPUPPCState *env, target_ulong ra, target_ulong rb, uint32_t oe) { @@ -49,11 +58,7 @@ target_ulong helper_divweu(CPUPPCState *env, target_ulong ra, target_ulong rb, } if (oe) { - if (unlikely(overflow)) { - env->so = env->ov = 1; - } else { - env->ov = 0; - } + helper_update_ov_legacy(env, overflow); } return (target_ulong)rt; @@ -81,11 +86,7 @@ target_ulong helper_divwe(CPUPPCState *env, target_ulong ra, target_ulong rb, } if (oe) { - if (unlikely(overflow)) { - env->so = env->ov = 1; - } else { - env->ov = 0; - } + helper_update_ov_legacy(env, overflow); } return (target_ulong)rt; @@ -105,11 +106,7 @@ uint64_t helper_divdeu(CPUPPCState *env, uint64_t ra, uint64_t rb, uint32_t oe) } if (oe) { - if (unlikely(overflow)) { - env->so = env->ov = 1; - } else { - env->ov = 0; - } + helper_update_ov_legacy(env, overflow); } return rt; @@ -127,12 +124,7 @@ uint64_t helper_divde(CPUPPCState *env, uint64_t rau, uint64_t rbu, uint32_t oe) } if (oe) { - - if (unlikely(overflow)) { - env->so = env->ov = 1; - } else { - env->ov = 0; - } + helper_update_ov_legacy(env, overflow); } return rt; |
