qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: "Lucas Mateus Castro(alqotel)" <lucas.araujo@eldorado.org.br>,
	qemu-ppc@nongnu.org
Cc: "Cédric Le Goater" <clg@kaod.org>,
	"Daniel Henrique Barboza" <danielhb413@gmail.com>,
	"David Gibson" <david@gibson.dropbear.id.au>,
	"Greg Kurz" <groug@kaod.org>,
	"open list:All patches CC here" <qemu-devel@nongnu.org>
Subject: Re: [PATCH v3 5/8] target/ppc: Implemented xvf16ger*
Date: Tue, 17 May 2022 12:40:27 -0700	[thread overview]
Message-ID: <fe1da3e7-16d4-460d-13d1-87fc02561142@linaro.org> (raw)
In-Reply-To: <20220517183735.110342-6-lucas.araujo@eldorado.org.br>

On 5/17/22 11:37, Lucas Mateus Castro(alqotel) wrote:
> +static inline float32 bfp32_negate(float32 a)
> +{
> +    if (unlikely(((a & 0x7f800000) == 0x7f800000) && (a & 0x007fffff))) {

float32_is_any_nan.

> +                    if (neg_mul) {
> +                        msum = bfp32_negate(msum);
> +                    }
> +                    if (neg_acc) {
> +                        at[i].VsrSF(j) = float32_sub(msum, aux_acc, excp_ptr);
> +                    } else {
> +                        at[i].VsrSF(j) = float32_add(msum, aux_acc, excp_ptr);
> +                    }

Hmm.  Since we're using negate once, perhaps just go ahead and use it twice.

Or go all the way with

     if (!neg_mul && !neg_acc) {
         r = float32_add(msum, aux_acc, excp_ptr);
     } else if (!neg_mul) {
         r = float32_sub(msum, aux_acc, excp_ptr);
     } else if (!neg_acc) {
         r = float32_sub(aux_acc, msum, excp_ptr);
     } else {
         r = float32_add(bfp32_neg(msum), bfp32_neg(aux_acc), excp_ptr);
     }

Otherwise, the logic seems sane.


r~


  reply	other threads:[~2022-05-17 19:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-17 18:37 [PATCH v3 0/8] VSX MMA Implementation Lucas Mateus Castro(alqotel)
2022-05-17 18:37 ` [PATCH v3 1/8] target/ppc: Implement xxm[tf]acc and xxsetaccz Lucas Mateus Castro(alqotel)
2022-05-17 18:37 ` [PATCH v3 2/8] target/ppc: Implemented xvi*ger* instructions Lucas Mateus Castro(alqotel)
2022-05-17 18:37 ` [PATCH v3 3/8] target/ppc: Implemented pmxvi*ger* instructions Lucas Mateus Castro(alqotel)
2022-05-17 19:17   ` Richard Henderson
2022-05-17 18:37 ` [PATCH v3 4/8] target/ppc: Implemented xvf*ger* Lucas Mateus Castro(alqotel)
2022-05-17 19:22   ` Richard Henderson
2022-05-17 18:37 ` [PATCH v3 5/8] target/ppc: Implemented xvf16ger* Lucas Mateus Castro(alqotel)
2022-05-17 19:40   ` Richard Henderson [this message]
2022-05-17 18:37 ` [PATCH v3 6/8] target/ppc: Implemented pmxvf*ger* Lucas Mateus Castro(alqotel)
2022-05-17 18:37 ` [PATCH v3 7/8] target/ppc: Implemented [pm]xvbf16ger2* Lucas Mateus Castro(alqotel)
2022-05-17 18:37 ` [PATCH v3 8/8] linux-user: Add PowerPC ISA 3.1 and MMA to hwcap Lucas Mateus Castro(alqotel)
2022-05-17 19:41   ` Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fe1da3e7-16d4-460d-13d1-87fc02561142@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=clg@kaod.org \
    --cc=danielhb413@gmail.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=groug@kaod.org \
    --cc=lucas.araujo@eldorado.org.br \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).