qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 2/5] target/ppc: change xs[n]madd[am]sp to use float64r32_


From: Matheus K. Ferst
Subject: Re: [PATCH v2 2/5] target/ppc: change xs[n]madd[am]sp to use float64r32_muladd
Date: Thu, 3 Mar 2022 17:53:08 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

On 03/03/2022 15:49, Richard Henderson wrote:
On 3/3/22 07:20, matheus.ferst@eldorado.org.br wrote:
From: Matheus Ferst <matheus.ferst@eldorado.org.br>

Change VSX Scalar Multiply-Add/Subtract Type-A/M Single Precision
helpers to use float64r32_muladd. This method should correctly handle
all rounding modes, so the workaround for float_round_nearest_even can
be dropped.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
---
  target/ppc/fpu_helper.c | 93 ++++++++++++++++-------------------------
  1 file changed, 35 insertions(+), 58 deletions(-)

diff --git a/target/ppc/fpu_helper.c b/target/ppc/fpu_helper.c
index 8f970288f5..c973968ed6 100644
--- a/target/ppc/fpu_helper.c
+++ b/target/ppc/fpu_helper.c
@@ -1916,22 +1916,19 @@ void helper_xsdivqp(CPUPPCState *env, uint32_t opcode,
   *   fld   - vsr_t field (VsrD(*) or VsrW(*))
   *   sfprf - set FPRF
   */
-#define VSX_RE(op, nels, tp, fld, sfprf, r2sp)                                \ +#define VSX_RE(op, nels, tp, op_tp, fld, sfprf)                               \   void helper_##op(CPUPPCState *env, ppc_vsr_t *xt, ppc_vsr_t *xb)              \ { \       ppc_vsr_t t = { };                                                        \ -    int i;                                                                    \ +    int i, flags;                                                             \ \ helper_reset_fpstatus(env); \ \       for (i = 0; i < nels; i++) {                                              \ -        if (unlikely(tp##_is_signaling_nan(xb->fld, &env->fp_status))) {      \ +        t.fld = op_tp##_div(tp##_one, xb->fld, &env->fp_status);              \ +        flags = get_float_exception_flags(&env->fp_status);                   \
+        if (unlikely(flags & float_flag_invalid_snan)) {

You seem to have squashed the change to recip-estimate into the same patch as muladd.


-#define VSX_RSQRTE(op, nels, tp, fld, sfprf, r2sp)                           \ +#define VSX_RSQRTE(op, nels, tp, op_tp, fld, sfprf)                          \

And recip-sqrt-estimate.

I guess it's ok to squash, since it's all related, but you should update the patch
description if you leave it this way.


Sorry, I cherry-picked the wrong branch. This patch should just be a rebase of v1. I'll send the changes to VSX_{ADD_SUB,MUL,DIV,RE,SQRT,RSQRTE} in a separate patch series since it's not test-related.

Thanks,
Matheus K. Ferst
Instituto de Pesquisas ELDORADO <http://www.eldorado.org.br/>
Analista de Software
Aviso Legal - Disclaimer <https://www.eldorado.org.br/disclaimer.html>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]