diff options
author | Ilya Leoshkevich <iii@linux.ibm.com> | 2022-01-12 17:50:13 +0100 |
---|---|---|
committer | Thomas Huth <thuth@redhat.com> | 2022-01-17 08:36:33 +0100 |
commit | 57556b28afde4b039bb12bfc274bd8df9022d946 (patch) | |
tree | 569704b85221875e5e03dcb0265d2f3db70b8613 | |
parent | 521130f267240cb1ed8fd4635496493a153281db (diff) | |
download | qemu-57556b28afde4b039bb12bfc274bd8df9022d946.zip qemu-57556b28afde4b039bb12bfc274bd8df9022d946.tar.gz qemu-57556b28afde4b039bb12bfc274bd8df9022d946.tar.bz2 |
target/s390x: Fix SRDA CC calculation
SRDA uses r1_D32 for binding the first operand and s64 for setting CC.
cout_s64() relies on o->out being the shift result, however,
wout_r1_D32() clobbers it.
Fix by using a temporary.
Fixes: a79ba3398a0a ("target-s390: Convert SHIFT DOUBLE")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Message-Id: <20220112165016.226996-3-iii@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
-rw-r--r-- | target/s390x/tcg/translate.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index f180853..766b4c8 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -5420,9 +5420,11 @@ static void wout_r1_P32(DisasContext *s, DisasOps *o) static void wout_r1_D32(DisasContext *s, DisasOps *o) { int r1 = get_field(s, r1); + TCGv_i64 t = tcg_temp_new_i64(); store_reg32_i64(r1 + 1, o->out); - tcg_gen_shri_i64(o->out, o->out, 32); - store_reg32_i64(r1, o->out); + tcg_gen_shri_i64(t, o->out, 32); + store_reg32_i64(r1, t); + tcg_temp_free_i64(t); } #define SPEC_wout_r1_D32 SPEC_r1_even |