Skip to content

Commit

Permalink
target/s390x: Use mutable temporary value for op_ts
Browse files Browse the repository at this point in the history
Otherwise TCG would assume the register that holds t1 would be constant
and reuse whenever it needs the value within it.

Cc: qemu-stable@nongnu.org
Fixes: f1ea739 ("target/s390x: Use tcg_constant_* in local contexts")
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
[iii: Adjust a newline and capitalization, add tags]
Signed-off-by: Ido Plat <ido.plat@ibm.com>
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Message-ID: <20240318202722.20675-1-iii@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
(cherry picked from commit 272fba9)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
  • Loading branch information
Ido Plat authored and Michael Tokarev committed Mar 25, 2024
1 parent ef9b43b commit 784ebe5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions target/s390x/tcg/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -4783,9 +4783,10 @@ 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 ff = tcg_constant_i32(0xff);
TCGv_i32 t1 = tcg_temp_new_i32();

tcg_gen_atomic_xchg_i32(t1, o->in2, t1, get_mem_index(s), MO_UB);
tcg_gen_atomic_xchg_i32(t1, o->in2, ff, get_mem_index(s), MO_UB);
tcg_gen_extract_i32(cc_op, t1, 7, 1);
set_cc_static(s);
return DISAS_NEXT;
Expand Down

0 comments on commit 784ebe5

Please sign in to comment.