qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: qemu-devel@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org,
	 qemu-riscv@nongnu.org, qemu-s390x@nongnu.org
Subject: Re: [PATCH 12/24] tcg/aarch64: Implement negsetcond_*
Date: Thu, 10 Aug 2023 17:39:08 +0100	[thread overview]
Message-ID: <CAFEAcA9dqnaqGrLz804UB8zHSnbCEWwhv1nzvdt_j0CS3=mCSg@mail.gmail.com> (raw)
In-Reply-To: <20230808031143.50925-13-richard.henderson@linaro.org>

On Tue, 8 Aug 2023 at 04:13, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Trivial, as aarch64 has an instruction for this: CSETM.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  tcg/aarch64/tcg-target.h     |  4 ++--
>  tcg/aarch64/tcg-target.c.inc | 12 ++++++++++++
>  2 files changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/tcg/aarch64/tcg-target.h b/tcg/aarch64/tcg-target.h
> index 6080fddf73..e3faa9cff4 100644
> --- a/tcg/aarch64/tcg-target.h
> +++ b/tcg/aarch64/tcg-target.h
> @@ -94,7 +94,7 @@ typedef enum {
>  #define TCG_TARGET_HAS_mulsh_i32        0
>  #define TCG_TARGET_HAS_extrl_i64_i32    0
>  #define TCG_TARGET_HAS_extrh_i64_i32    0
> -#define TCG_TARGET_HAS_negsetcond_i32   0
> +#define TCG_TARGET_HAS_negsetcond_i32   1
>  #define TCG_TARGET_HAS_qemu_st8_i32     0
>
>  #define TCG_TARGET_HAS_div_i64          1
> @@ -130,7 +130,7 @@ typedef enum {
>  #define TCG_TARGET_HAS_muls2_i64        0
>  #define TCG_TARGET_HAS_muluh_i64        1
>  #define TCG_TARGET_HAS_mulsh_i64        1
> -#define TCG_TARGET_HAS_negsetcond_i64   0
> +#define TCG_TARGET_HAS_negsetcond_i64   1
>
>  /*
>   * Without FEAT_LSE2, we must use LDXP+STXP to implement atomic 128-bit load,
> diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc
> index 35ca80cd56..7d8d114c9e 100644
> --- a/tcg/aarch64/tcg-target.c.inc
> +++ b/tcg/aarch64/tcg-target.c.inc
> @@ -2262,6 +2262,16 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
>                       TCG_REG_XZR, tcg_invert_cond(args[3]));
>          break;
>
> +    case INDEX_op_negsetcond_i32:
> +        a2 = (int32_t)a2;
> +        /* FALLTHRU */

I see this is what we already do for setcond and movcond,
but how does it work when the 2nd input is a register?
Or is reg-reg guaranteed to always use the _i64 op?

> +    case INDEX_op_negsetcond_i64:
> +        tcg_out_cmp(s, ext, a1, a2, c2);
> +        /* Use CSETM alias of CSINV Wd, WZR, WZR, invert(cond).  */
> +        tcg_out_insn(s, 3506, CSINV, ext, a0, TCG_REG_XZR,
> +                     TCG_REG_XZR, tcg_invert_cond(args[3]));
> +        break;
> +
>      case INDEX_op_movcond_i32:
>          a2 = (int32_t)a2;
>          /* FALLTHRU */
> @@ -2868,6 +2878,8 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op)
>      case INDEX_op_sub_i64:
>      case INDEX_op_setcond_i32:
>      case INDEX_op_setcond_i64:
> +    case INDEX_op_negsetcond_i32:
> +    case INDEX_op_negsetcond_i64:
>          return C_O1_I2(r, r, rA);
>
>      case INDEX_op_mul_i32:

thanks
-- PMM


  reply	other threads:[~2023-08-10 16:40 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-08  3:11 [PATCH for-8.2 00/24] tcg: Introduce negsetcond opcodes Richard Henderson
2023-08-08  3:11 ` [PATCH 01/24] " Richard Henderson
2023-08-10 16:12   ` Peter Maydell
2023-08-10 16:39     ` Richard Henderson
2023-08-08  3:11 ` [PATCH 02/24] tcg: Use tcg_gen_negsetcond_* Richard Henderson
2023-08-08 15:55   ` Peter Maydell
2023-08-08 16:04     ` Richard Henderson
2023-08-10 16:13   ` Peter Maydell
2023-08-08  3:11 ` [PATCH 03/24] target/alpha: Use tcg_gen_movcond_i64 in gen_fold_mzero Richard Henderson
2023-08-10 16:19   ` Peter Maydell
2023-08-08  3:11 ` [PATCH 04/24] target/arm: Use tcg_gen_negsetcond_* Richard Henderson
2023-08-10 16:22   ` Peter Maydell
2023-08-08  3:11 ` [PATCH 05/24] target/m68k: " Richard Henderson
2023-08-10 16:24   ` Peter Maydell
2023-08-08  3:11 ` [PATCH 06/24] target/openrisc: " Richard Henderson
2023-08-10 16:24   ` Peter Maydell
2023-08-08  3:11 ` [PATCH 07/24] target/ppc: " Richard Henderson
2023-08-08 16:51   ` Daniel Henrique Barboza
2023-08-15 12:54   ` Nicholas Piggin
2023-08-08  3:11 ` [PATCH 08/24] target/sparc: Use tcg_gen_movcond_i64 in gen_edge Richard Henderson
2023-08-10 16:29   ` Peter Maydell
2023-08-08  3:11 ` [PATCH 09/24] target/tricore: Replace gen_cond_w with tcg_gen_negsetcond_tl Richard Henderson
2023-08-08 15:42   ` Bastian Koppelmann
2023-08-08  3:11 ` [PATCH 10/24] tcg/ppc: Implement negsetcond_* Richard Henderson
2023-08-08 16:55   ` Daniel Henrique Barboza
2023-08-08  3:11 ` [PATCH 11/24] tcg/ppc: Use the Set Boolean Extension Richard Henderson
2023-08-08 16:56   ` Daniel Henrique Barboza
2023-08-15 13:16   ` Nicholas Piggin
2023-08-08  3:11 ` [PATCH 12/24] tcg/aarch64: Implement negsetcond_* Richard Henderson
2023-08-10 16:39   ` Peter Maydell [this message]
2023-08-10 16:55     ` Richard Henderson
2023-08-10 16:58       ` Peter Maydell
2023-08-10 17:01         ` Richard Henderson
2023-08-08  3:11 ` [PATCH 13/24] tcg/arm: Implement negsetcond_i32 Richard Henderson
2023-08-10 16:41   ` Peter Maydell
2023-08-08  3:11 ` [PATCH 14/24] tcg/riscv: Implement negsetcond_* Richard Henderson
2023-08-08 16:47   ` Daniel Henrique Barboza
2023-08-08  3:11 ` [PATCH 15/24] tcg/s390x: " Richard Henderson
2023-08-08  3:11 ` [PATCH 16/24] tcg/sparc64: " Richard Henderson
2023-08-11 12:24   ` Peter Maydell
2023-08-08  3:11 ` [PATCH 17/24] tcg/i386: Merge tcg_out_brcond{32,64} Richard Henderson
2023-08-11 10:20   ` Peter Maydell
2023-08-08  3:11 ` [PATCH 18/24] tcg/i386: Merge tcg_out_setcond{32,64} Richard Henderson
2023-08-11 10:21   ` Peter Maydell
2023-08-08  3:11 ` [PATCH 19/24] tcg/i386: Merge tcg_out_movcond{32,64} Richard Henderson
2023-08-11 10:22   ` Peter Maydell
2023-08-08  3:11 ` [PATCH 20/24] tcg/i386: Add cf parameter to tcg_out_cmp Richard Henderson
2023-08-11 10:26   ` Peter Maydell
2023-08-11 10:45     ` Peter Maydell
2023-08-11 15:06       ` Richard Henderson
2023-08-12 17:21         ` Richard Henderson
2023-08-08  3:11 ` [PATCH 21/24] tcg/i386: Use CMP+SBB in tcg_out_setcond Richard Henderson
2023-08-11 12:07   ` Peter Maydell
2023-08-08  3:11 ` [PATCH 22/24] tcg/i386: Clear dest first in tcg_out_setcond if possible Richard Henderson
2023-08-11 12:09   ` Peter Maydell
2023-08-08  3:11 ` [PATCH 23/24] tcg/i386: Use shift in tcg_out_setcond Richard Henderson
2023-08-11 12:10   ` Peter Maydell
2023-08-08  3:11 ` [PATCH 24/24] tcg/i386: Implement negsetcond_* Richard Henderson
2023-08-11 12:13   ` Peter Maydell

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='CAFEAcA9dqnaqGrLz804UB8zHSnbCEWwhv1nzvdt_j0CS3=mCSg@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.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).