diff options
author | Paul A. Clarke <pc@us.ibm.com> | 2019-09-18 09:32:49 -0500 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2019-10-04 10:25:23 +1000 |
commit | 5c94dd3806b6cd4a9540a818ee87c335804bdc38 (patch) | |
tree | 4979d236e97da725482ef8b55ea4a17d95f7539a /target/ppc/dfp_helper.c | |
parent | bc7a45ab88281bbced8ebe9fb87d518102b22519 (diff) |
ppc: Use FPSCR defines instead of constants
There are FPSCR-related defines in target/ppc/cpu.h which can be used in
place of constants and explicit shifts which arguably improve the code a
bit in places.
Signed-off-by: Paul A. Clarke <pc@us.ibm.com>
Message-Id: <1568817169-1721-1-git-send-email-pc@us.ibm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'target/ppc/dfp_helper.c')
-rw-r--r-- | target/ppc/dfp_helper.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/target/ppc/dfp_helper.c b/target/ppc/dfp_helper.c index da8e08a35c..753399177c 100644 --- a/target/ppc/dfp_helper.c +++ b/target/ppc/dfp_helper.c @@ -220,8 +220,8 @@ static void dfp_set_FPRF_from_FRT_with_context(struct PPC_DFP *dfp, default: assert(0); /* should never get here */ } - dfp->env->fpscr &= ~(0x1F << 12); - dfp->env->fpscr |= (fprf << 12); + dfp->env->fpscr &= ~FP_FPRF; + dfp->env->fpscr |= (fprf << FPSCR_FPRF); } static void dfp_set_FPRF_from_FRT(struct PPC_DFP *dfp) @@ -369,8 +369,8 @@ static void dfp_set_CRBF_from_T(struct PPC_DFP *dfp) static void dfp_set_FPCC_from_CRBF(struct PPC_DFP *dfp) { - dfp->env->fpscr &= ~(0xF << 12); - dfp->env->fpscr |= (dfp->crbf << 12); + dfp->env->fpscr &= ~FP_FPCC; + dfp->env->fpscr |= (dfp->crbf << FPSCR_FPCC); } static inline void dfp_makeQNaN(decNumber *dn) |