qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: "Philippe Mathieu-Daudé" <philmd@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 09:15:51 -0800	[thread overview]
Message-ID: <4863b4e6-8ce3-4f37-b339-837faf759efb@linaro.org> (raw)
In-Reply-To: <59d1bd38-2b0f-413a-a6ff-28f8a055dad0@linaro.org>

On 2/13/25 07:45, Philippe Mathieu-Daudé wrote:
> 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.

Indeed, this was not grammatical.  Fixed as

... the constraint '``z``' is defined generically
to map constant 0 to the hardware zero register.

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

Thanks.

r~


  reply	other threads:[~2025-02-13 17:16 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é
2025-02-13 17:15     ` Richard Henderson [this message]
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=4863b4e6-8ce3-4f37-b339-837faf759efb@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@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).