diff options
author | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2019-09-26 19:58:01 +0100 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2019-10-04 19:08:21 +1000 |
commit | f6d4c423a222f02bfa84a49c3d306d7341ec9bab (patch) | |
tree | d2360b563baa958167f7df39496ba61225a0a391 /target/ppc/dfp_helper.c | |
parent | 1ea80bf7f4398099b6818f574cda8b4089c62340 (diff) |
target/ppc: remove unnecessary if() around calls to set_dfp{64,128}() in DFP macros
Now that the parameters to both set_dfp64() and set_dfp128() are exactly the
same, there is no need for an explicit if() statement to determine which
function should be called based upon size. Instead we can simply use the
preprocessor to generate the call to set_dfp##size() directly.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20190926185801.11176-8-mark.cave-ayland@ilande.co.uk>
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 | 60 |
1 files changed, 10 insertions, 50 deletions
diff --git a/target/ppc/dfp_helper.c b/target/ppc/dfp_helper.c index c2bb458a78..2c65badae4 100644 --- a/target/ppc/dfp_helper.c +++ b/target/ppc/dfp_helper.c @@ -427,11 +427,7 @@ void helper_##op(CPUPPCState *env, ppc_fprp_t *t, ppc_fprp_t *a, \ dnop(&dfp.t, &dfp.a, &dfp.b, &dfp.context); \ dfp_finalize_decimal##size(&dfp); \ postprocs(&dfp); \ - if (size == 64) { \ - set_dfp64(t, &dfp.vt); \ - } else if (size == 128) { \ - set_dfp128(t, &dfp.vt); \ - } \ + set_dfp##size(t, &dfp.vt); \ } static void ADD_PPs(struct PPC_DFP *dfp) @@ -747,11 +743,7 @@ void helper_##op(CPUPPCState *env, ppc_fprp_t *t, ppc_fprp_t *b, \ dfp_finalize_decimal##size(&dfp); \ QUA_PPs(&dfp); \ \ - if (size == 64) { \ - set_dfp64(t, &dfp.vt); \ - } else if (size == 128) { \ - set_dfp128(t, &dfp.vt); \ - } \ + set_dfp##size(t, &dfp.vt); \ } DFP_HELPER_QUAI(dquai, 64) @@ -769,11 +761,7 @@ void helper_##op(CPUPPCState *env, ppc_fprp_t *t, ppc_fprp_t *a, \ dfp_finalize_decimal##size(&dfp); \ QUA_PPs(&dfp); \ \ - if (size == 64) { \ - set_dfp64(t, &dfp.vt); \ - } else if (size == 128) { \ - set_dfp128(t, &dfp.vt); \ - } \ + set_dfp##size(t, &dfp.vt); \ } DFP_HELPER_QUA(dqua, 64) @@ -851,11 +839,7 @@ void helper_##op(CPUPPCState *env, ppc_fprp_t *t, ppc_fprp_t *a, \ dfp_finalize_decimal##size(&dfp); \ QUA_PPs(&dfp); \ \ - if (size == 64) { \ - set_dfp64(t, &dfp.vt); \ - } else if (size == 128) { \ - set_dfp128(t, &dfp.vt); \ - } \ + set_dfp##size(t, &dfp.vt); \ } DFP_HELPER_RRND(drrnd, 64) @@ -874,11 +858,7 @@ void helper_##op(CPUPPCState *env, ppc_fprp_t *t, ppc_fprp_t *b, \ dfp_finalize_decimal##size(&dfp); \ postprocs(&dfp); \ \ - if (size == 64) { \ - set_dfp64(t, &dfp.vt); \ - } else if (size == 128) { \ - set_dfp128(t, &dfp.vt); \ - } \ + set_dfp##size(t, &dfp.vt); \ } static void RINTX_PPs(struct PPC_DFP *dfp) @@ -978,11 +958,7 @@ void helper_##op(CPUPPCState *env, ppc_fprp_t *t, ppc_fprp_t *b) \ dfp_finalize_decimal##size(&dfp); \ CFFIX_PPs(&dfp); \ \ - if (size == 64) { \ - set_dfp64(t, &dfp.vt); \ - } else if (size == 128) { \ - set_dfp128(t, &dfp.vt); \ - } \ + set_dfp##size(t, &dfp.vt); \ } static void CFFIX_PPs(struct PPC_DFP *dfp) @@ -1088,11 +1064,7 @@ void helper_##op(CPUPPCState *env, ppc_fprp_t *t, ppc_fprp_t *b, \ dfp_set_sign_##size(&dfp.vt, sgn); \ } \ \ - if (size == 64) { \ - set_dfp64(t, &dfp.vt); \ - } else if (size == 128) { \ - set_dfp128(t, &dfp.vt); \ - } \ + set_dfp##size(t, &dfp.vt); \ } DFP_HELPER_DEDPD(ddedpd, 64) @@ -1160,11 +1132,7 @@ void helper_##op(CPUPPCState *env, ppc_fprp_t *t, ppc_fprp_t *b, \ } \ dfp_finalize_decimal##size(&dfp); \ dfp_set_FPRF_from_FRT(&dfp); \ - if ((size) == 64) { \ - set_dfp64(t, &dfp.vt); \ - } else if ((size) == 128) { \ - set_dfp128(t, &dfp.vt); \ - } \ + set_dfp##size(t, &dfp.vt); \ } DFP_HELPER_ENBCD(denbcd, 64) @@ -1264,11 +1232,7 @@ void helper_##op(CPUPPCState *env, ppc_fprp_t *t, ppc_fprp_t *a, \ dfp.t.exponent = exp - bias; \ dfp_finalize_decimal##size(&dfp); \ } \ - if (size == 64) { \ - set_dfp64(t, &dfp.vt); \ - } else if (size == 128) { \ - set_dfp128(t, &dfp.vt); \ - } \ + set_dfp##size(t, &dfp.vt); \ } DFP_HELPER_IEX(diex, 64) @@ -1356,11 +1320,7 @@ void helper_##op(CPUPPCState *env, ppc_fprp_t *t, ppc_fprp_t *a, \ } \ } \ \ - if ((size) == 64) { \ - set_dfp64(t, &dfp.vt); \ - } else { \ - set_dfp128(t, &dfp.vt); \ - } \ + set_dfp##size(t, &dfp.vt); \ } DFP_HELPER_SHIFT(dscli, 64, 1) |