From: Richard Henderson <richard.henderson@linaro.org>
To: Ilya Leoshkevich <iii@linux.ibm.com>,
David Hildenbrand <david@redhat.com>,
Thomas Huth <thuth@redhat.com>
Cc: qemu-s390x@nongnu.org, qemu-devel@nongnu.org,
Ido Plat <ido.plat@ibm.com>
Subject: Re: [PATCH 1/2] target/s390x: Use mutable temporary value for op_ts
Date: Mon, 18 Mar 2024 07:32:21 -1000 [thread overview]
Message-ID: <068a88ff-dfe0-4bbe-aa28-9ff3c6c61ea1@linaro.org> (raw)
In-Reply-To: <20240318162633.13017-1-iii@linux.ibm.com>
On 3/18/24 06:26, Ilya Leoshkevich wrote:
> From: Ido Plat <ido.plat@ibm.com>
>
> Otherwise TCG would assume the register that holds t1 would be constant
> and reuse whenever it needs the value within it.
>
> Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
> [iii: Adjust a newline and capitalization]
> Signed-off-by: Ido Plat <ido.plat@ibm.com>
> ---
> target/s390x/tcg/translate.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c
> index 0d0c672c959..3fdddac7684 100644
> --- a/target/s390x/tcg/translate.c
> +++ b/target/s390x/tcg/translate.c
> @@ -4781,8 +4781,9 @@ static DisasJumpType op_trXX(DisasContext *s, DisasOps *o)
>
> static DisasJumpType op_ts(DisasContext *s, DisasOps *o)
> {
> - TCGv_i32 t1 = tcg_constant_i32(0xff);
> + TCGv_i32 t1 = tcg_temp_new_i32();
>
> + tcg_gen_movi_i32(t1, 0xff);
> tcg_gen_atomic_xchg_i32(t1, o->in2, t1, get_mem_index(s), MO_UB);
Better as
TCGv_i32 ff = tcg_constant_i32(0xff);
TCGv_i32 t1 = tcg_temp_new_i32();
tcg_gen_atomic_xchg_i32(t1, o->in2, ff, get_mem_index(s), MO_UB);
With that,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
prev parent reply other threads:[~2024-03-18 17:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-18 16:26 [PATCH 1/2] target/s390x: Use mutable temporary value for op_ts Ilya Leoshkevich
2024-03-18 16:26 ` [PATCH 2/2] tests/tcg/s390x: Test TEST AND SET Ilya Leoshkevich
2024-03-18 16:33 ` [PATCH 1/2] target/s390x: Use mutable temporary value for op_ts Thomas Huth
2024-03-18 17:32 ` Richard Henderson [this message]
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=068a88ff-dfe0-4bbe-aa28-9ff3c6c61ea1@linaro.org \
--to=richard.henderson@linaro.org \
--cc=david@redhat.com \
--cc=ido.plat@ibm.com \
--cc=iii@linux.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=thuth@redhat.com \
/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).