qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Subject: Re: [PATCH 1/6] tcg: Introduce the 'z' constraint for a hardware zero register
Date: Thu, 13 Feb 2025 16:45:31 +0100	[thread overview]
Message-ID: <59d1bd38-2b0f-413a-a6ff-28f8a055dad0@linaro.org> (raw)
In-Reply-To: <20250212034617.1079324-2-richard.henderson@linaro.org>

On 12/2/25 04:46, Richard Henderson wrote:
> For loongarch, mips, riscv and sparc, a zero register is
> available all the time.  For aarch64, register index 31
> depends on context: sometimes it is the stack pointer,
> and sometimes it is the zero register.
> 
> Introduce a new general-purpose constraint which maps 0
> to TCG_REG_ZERO, if defined.  This differs from existing
> constant constraints in that const_arg[*] is recorded as
> false, indicating that the value is in a register.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   include/tcg/tcg.h            |  3 ++-
>   tcg/aarch64/tcg-target.h     |  2 ++
>   tcg/loongarch64/tcg-target.h |  2 ++
>   tcg/mips/tcg-target.h        |  2 ++
>   tcg/riscv/tcg-target.h       |  2 ++
>   tcg/sparc64/tcg-target.h     |  3 ++-
>   tcg/tcg.c                    | 29 ++++++++++++++++++++++-------
>   docs/devel/tcg-ops.rst       |  4 +++-
>   8 files changed, 37 insertions(+), 10 deletions(-)


> diff --git a/docs/devel/tcg-ops.rst b/docs/devel/tcg-ops.rst
> index 6608a29376..75acb4bd32 100644
> --- a/docs/devel/tcg-ops.rst
> +++ b/docs/devel/tcg-ops.rst
> @@ -927,7 +927,9 @@ operation uses a constant input constraint which does not allow all
>   constants, it must also accept registers in order to have a fallback.
>   The constraint '``i``' is defined generically to accept any constant.
>   The constraint '``r``' is not defined generically, but is consistently
> -used by each backend to indicate all registers.
> +used by each backend to indicate all registers.  If ``TCG_REG_ZERO``
> +is defined by the backend, the constraint '``z``' is defined generically

and/to?

> +map 0 to the hardware zero register.
>   
>   The movi_i32 and movi_i64 operations must accept any constants.
>   

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>



  reply	other threads:[~2025-02-13 15:45 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-12  3:46 [PATCH 0/6] tcg: Introduce constraint for zero register Richard Henderson
2025-02-12  3:46 ` [PATCH 1/6] tcg: Introduce the 'z' constraint for a hardware " Richard Henderson
2025-02-13 15:45   ` Philippe Mathieu-Daudé [this message]
2025-02-13 17:15     ` Richard Henderson
2025-02-12  3:46 ` [PATCH 2/6] tcg/aarch64: Use 'z' constraint Richard Henderson
2025-02-16 13:06   ` Philippe Mathieu-Daudé
2025-02-12  3:46 ` [PATCH 3/6] tcg/loongarch64: " Richard Henderson
2025-02-13 15:47   ` Philippe Mathieu-Daudé
2025-02-12  3:46 ` [PATCH 4/6] tcg/mips: " Richard Henderson
2025-02-13 15:47   ` Philippe Mathieu-Daudé
2025-02-12  3:46 ` [PATCH 5/6] tcg/riscv: " Richard Henderson
2025-02-13 15:50   ` Philippe Mathieu-Daudé
2025-02-13 15:54     ` Philippe Mathieu-Daudé
2025-02-12  3:46 ` [PATCH 6/6] tcg/sparc64: " Richard Henderson
2025-02-13 15:53   ` Philippe Mathieu-Daudé
2025-02-15 20:06 ` [PATCH 0/6] tcg: Introduce constraint for zero register 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=59d1bd38-2b0f-413a-a6ff-28f8a055dad0@linaro.org \
    --to=philmd@linaro.org \
    --cc=qemu-devel@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).