qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: matheus.ferst@eldorado.org.br, qemu-devel@nongnu.org,
	qemu-ppc@nongnu.org
Cc: groug@kaod.org, danielhb413@gmail.com, clg@kaod.org,
	david@gibson.dropbear.id.au
Subject: Re: [PATCH v3 14/37] target/ppc: implement vstri[bh][lr]
Date: Fri, 11 Feb 2022 16:00:46 +1100	[thread overview]
Message-ID: <fdd3b7cf-163f-d728-af0d-c1d958e48329@linaro.org> (raw)
In-Reply-To: <20220210123447.3933301-15-matheus.ferst@eldorado.org.br>

On 2/10/22 23:34, matheus.ferst@eldorado.org.br wrote:
> +#define VSTRI(NAME, ELEM, NUM_ELEMS, LEFT) \
> +void helper_##NAME(CPUPPCState *env, ppc_avr_t *t, ppc_avr_t *b,    \
> +                   target_ulong rc)                                 \
> +{                                                                   \
> +    bool null_found = false;                                        \
> +    int i, idx;                                                     \
> +                                                                    \
> +    for (i = 0; i < NUM_ELEMS; i++) {                               \
> +        idx = LEFT ? i : NUM_ELEMS - i - 1;                         \
> +        if (b->Vsr##ELEM(idx)) {                                    \
> +            t->Vsr##ELEM(idx) = b->Vsr##ELEM(idx);                  \
> +        } else {                                                    \
> +            null_found = true;                                      \
> +            break;                                                  \
> +        }                                                           \
> +    }                                                               \
> +                                                                    \
> +    for (; i < NUM_ELEMS; i++) {                                    \
> +        idx = LEFT ? i : NUM_ELEMS - i - 1;                         \
> +        t->Vsr##ELEM(idx) = 0;                                      \
> +    }                                                               \
> +                                                                    \
> +    if (rc) {                                                       \
> +        env->crf[6] = null_found ? 0b0010 : 0;                      \
> +    }                                                               \
> +}

The only reason you're passing in env is for crf[6], which requires you to pass in a 
second argument.  And you're not using the return value.

It would be better to always return the rc value, and only conditionally assign it.
E.g.

     if (a->rc) {
         gen_helper(cpu_crf[6], vrt, vrb);
     } else {
         TCGv_i32 discard = tcg_temp_new_i32();
         gen_helper(discard, vrt, vrb);
         tcg_temp_free_i32(discard);
     }

r~


  reply	other threads:[~2022-02-11  5:35 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-10 12:34 [PATCH v3 00/37] target/ppc: PowerISA Vector/VSX instruction batch matheus.ferst
2022-02-10 12:34 ` [PATCH v3 01/37] target/ppc: Introduce TRANS*FLAGS macros matheus.ferst
2022-02-10 12:34 ` [PATCH v3 02/37] target/ppc: moved vector even and odd multiplication to decodetree matheus.ferst
2022-02-11  3:39   ` Richard Henderson
2022-02-10 12:34 ` [PATCH v3 03/37] target/ppc: Moved vector multiply high and low " matheus.ferst
2022-02-11  3:41   ` Richard Henderson
2022-02-10 12:34 ` [PATCH v3 04/37] target/ppc: vmulh* instructions use gvec matheus.ferst
2022-02-11  3:51   ` Richard Henderson
2022-02-10 12:34 ` [PATCH v3 05/37] target/ppc: Implement vmsumcud instruction matheus.ferst
2022-02-11  4:05   ` Richard Henderson
2022-02-10 12:34 ` [PATCH v3 06/37] target/ppc: Implement vmsumudm instruction matheus.ferst
2022-02-11  4:07   ` Richard Henderson
2022-02-10 12:34 ` [PATCH v3 07/37] target/ppc: Move vexts[bhw]2[wd] to decodetree matheus.ferst
2022-02-11  4:14   ` Richard Henderson
2022-02-10 12:34 ` [PATCH v3 08/37] target/ppc: Implement vextsd2q matheus.ferst
2022-02-11  4:15   ` Richard Henderson
2022-02-10 12:34 ` [PATCH v3 09/37] target/ppc: Move Vector Compare Equal/Not Equal/Greater Than to decodetree matheus.ferst
2022-02-11  4:27   ` Richard Henderson
2022-02-10 12:34 ` [PATCH v3 10/37] target/ppc: Move Vector Compare Not Equal or Zero " matheus.ferst
2022-02-11  4:41   ` Richard Henderson
2022-02-17 12:45     ` Matheus K. Ferst
2022-02-10 12:34 ` [PATCH v3 11/37] target/ppc: Implement Vector Compare Equal Quadword matheus.ferst
2022-02-11  4:51   ` Richard Henderson
2022-02-10 12:34 ` [PATCH v3 12/37] target/ppc: Implement Vector Compare Greater Than Quadword matheus.ferst
2022-02-11  4:53   ` Richard Henderson
2022-02-10 12:34 ` [PATCH v3 13/37] target/ppc: Implement Vector Compare Quadword matheus.ferst
2022-02-11  4:55   ` Richard Henderson
2022-02-10 12:34 ` [PATCH v3 14/37] target/ppc: implement vstri[bh][lr] matheus.ferst
2022-02-11  5:00   ` Richard Henderson [this message]
2022-02-10 12:34 ` [PATCH v3 15/37] target/ppc: implement vclrlb matheus.ferst
2022-02-11  5:20   ` Richard Henderson
2022-02-10 12:34 ` [PATCH v3 16/37] target/ppc: implement vclrrb matheus.ferst
2022-02-10 12:34 ` [PATCH v3 17/37] target/ppc: implement vcntmb[bhwd] matheus.ferst
2022-02-11  5:28   ` Richard Henderson
2022-02-10 12:34 ` [PATCH v3 18/37] target/ppc: implement vgnb matheus.ferst
2022-02-11  6:15   ` Richard Henderson
2022-02-10 12:34 ` [PATCH v3 19/37] target/ppc: Move vsel and vperm/vpermr to decodetree matheus.ferst
2022-02-10 12:34 ` [PATCH v3 20/37] target/ppc: Move xxsel " matheus.ferst
2022-02-10 12:34 ` [PATCH v3 21/37] target/ppc: move xxperm/xxpermr " matheus.ferst
2022-02-10 12:34 ` [PATCH v3 22/37] target/ppc: Move xxpermdi " matheus.ferst
2022-02-10 12:34 ` [PATCH v3 23/37] target/ppc: Implement xxpermx instruction matheus.ferst
2022-02-10 12:34 ` [PATCH v3 24/37] tcg/tcg-op-gvec.c: Introduce tcg_gen_gvec_4i matheus.ferst
2022-02-10 12:34 ` [PATCH v3 25/37] target/ppc: Implement xxeval matheus.ferst
2022-02-10 12:34 ` [PATCH v3 26/37] target/ppc: Implement xxgenpcv[bhwd]m instruction matheus.ferst
2022-02-10 12:34 ` [PATCH v3 27/37] target/ppc: move xs[n]madd[am][ds]p/xs[n]msub[am][ds]p to decodetree matheus.ferst
2022-02-10 12:34 ` [PATCH v3 28/37] target/ppc: implement xs[n]maddqp[o]/xs[n]msubqp[o] matheus.ferst
2022-02-10 12:34 ` [PATCH v3 29/37] target/ppc: Implement xvtlsbb instruction matheus.ferst
2022-02-10 12:34 ` [PATCH v3 30/37] target/ppc: Remove xscmpnedp instruction matheus.ferst
2022-02-10 12:34 ` [PATCH v3 31/37] target/ppc: Refactor VSX_SCALAR_CMP_DP matheus.ferst
2022-02-10 12:34 ` [PATCH v3 32/37] target/ppc: Implement xscmp{eq,ge,gt}qp matheus.ferst
2022-02-10 12:34 ` [PATCH v3 33/37] target/ppc: Move xscmp{eq,ge,gt}dp to decodetree matheus.ferst
2022-02-10 12:34 ` [PATCH v3 34/37] target/ppc: Move xs{max, min}[cj]dp to use do_helper_XX3 matheus.ferst
2022-02-10 12:34 ` [PATCH v3 35/37] target/ppc: Refactor VSX_MAX_MINC helper matheus.ferst
2022-02-10 12:34 ` [PATCH v3 36/37] target/ppc: Implement xs{max,min}cqp matheus.ferst
2022-02-10 12:34 ` [PATCH v3 37/37] target/ppc: Implement xvcvbf16spn and xvcvspbf16 instructions matheus.ferst

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=fdd3b7cf-163f-d728-af0d-c1d958e48329@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=matheus.ferst@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).