From: Alexander Graf <agraf@suse.de>
To: qemu-devel qemu-devel <qemu-devel@nongnu.org>
Cc: Blue Swirl <blauwirbel@gmail.com>, Aurelien Jarno <aurelien@aurel32.net>
Subject: [Qemu-devel] [PATCH 12/12] tcg/s390: fix ld/st with CONFIG_TCG_PASS_AREG0
Date: Mon, 10 Sep 2012 13:40:57 +0200 [thread overview]
Message-ID: <1347277257-22639-13-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1347277257-22639-1-git-send-email-agraf@suse.de>
From: Aurelien Jarno <aurelien@aurel32.net>
The load/store slow path has been broken in e141ab52d:
- We need to move 4 registers for store functions and 3 registers for
load functions and not the reverse.
- According to the s390x calling convention the arguments of a function
should be zero extended. This means that the register shift should be
done with TCG_TYPE_I64 to ensure the higher word is correctly zero
extended when needed.
I am aware that CONFIG_TCG_PASS_AREG0 is being removed and thus that
this patch can be improved, but doing so means it can also be applied to
the 1.1 and 1.2 stable branches.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
tcg/s390/tcg-target.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/tcg/s390/tcg-target.c b/tcg/s390/tcg-target.c
index 04662c1..99b5339 100644
--- a/tcg/s390/tcg-target.c
+++ b/tcg/s390/tcg-target.c
@@ -1509,11 +1509,13 @@ static void tcg_prepare_qemu_ldst(TCGContext* s, TCGReg data_reg,
tcg_out_movi(s, TCG_TYPE_I32, TCG_REG_R4, mem_index);
#ifdef CONFIG_TCG_PASS_AREG0
/* XXX/FIXME: suboptimal */
- tcg_out_mov(s, TCG_TYPE_I32, tcg_target_call_iarg_regs[2],
+ tcg_out_mov(s, TCG_TYPE_I64, tcg_target_call_iarg_regs[3],
+ tcg_target_call_iarg_regs[2]);
+ tcg_out_mov(s, TCG_TYPE_I64, tcg_target_call_iarg_regs[2],
tcg_target_call_iarg_regs[1]);
- tcg_out_mov(s, TCG_TYPE_TL, tcg_target_call_iarg_regs[1],
+ tcg_out_mov(s, TCG_TYPE_I64, tcg_target_call_iarg_regs[1],
tcg_target_call_iarg_regs[0]);
- tcg_out_mov(s, TCG_TYPE_PTR, tcg_target_call_iarg_regs[0],
+ tcg_out_mov(s, TCG_TYPE_I64, tcg_target_call_iarg_regs[0],
TCG_AREG0);
#endif
tgen_calli(s, (tcg_target_ulong)qemu_st_helpers[s_bits]);
@@ -1521,13 +1523,11 @@ static void tcg_prepare_qemu_ldst(TCGContext* s, TCGReg data_reg,
tcg_out_movi(s, TCG_TYPE_I32, arg1, mem_index);
#ifdef CONFIG_TCG_PASS_AREG0
/* XXX/FIXME: suboptimal */
- tcg_out_mov(s, TCG_TYPE_I32, tcg_target_call_iarg_regs[3],
- tcg_target_call_iarg_regs[2]);
tcg_out_mov(s, TCG_TYPE_I64, tcg_target_call_iarg_regs[2],
tcg_target_call_iarg_regs[1]);
- tcg_out_mov(s, TCG_TYPE_TL, tcg_target_call_iarg_regs[1],
+ tcg_out_mov(s, TCG_TYPE_I64, tcg_target_call_iarg_regs[1],
tcg_target_call_iarg_regs[0]);
- tcg_out_mov(s, TCG_TYPE_PTR, tcg_target_call_iarg_regs[0],
+ tcg_out_mov(s, TCG_TYPE_I64, tcg_target_call_iarg_regs[0],
TCG_AREG0);
#endif
tgen_calli(s, (tcg_target_ulong)qemu_ld_helpers[s_bits]);
--
1.6.0.2
next prev parent reply other threads:[~2012-09-10 11:41 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-10 11:40 [Qemu-devel] [PULL 00/12] s390 patch queue 2012-09-10 Alexander Graf
2012-09-10 11:40 ` [Qemu-devel] [PATCH 01/12] target-s390x: fix style Alexander Graf
2012-09-10 11:40 ` [Qemu-devel] [PATCH 02/12] target-s390x: split FPU ops Alexander Graf
2012-09-10 11:40 ` [Qemu-devel] [PATCH 03/12] target-s390x: split condition code helpers Alexander Graf
2012-09-10 11:40 ` [Qemu-devel] [PATCH 04/12] target-s390x: split integer helpers Alexander Graf
2012-09-10 11:40 ` [Qemu-devel] [PATCH 05/12] target-s390x: split memory access helpers Alexander Graf
2012-09-10 11:40 ` [Qemu-devel] [PATCH 06/12] target-s390x: rename op_helper.c to misc_helper.c Alexander Graf
2012-09-10 11:40 ` [Qemu-devel] [PATCH 07/12] target-s390x: avoid AREG0 for FPU helpers Alexander Graf
2012-09-10 11:40 ` [Qemu-devel] [PATCH 08/12] target-s390x: avoid AREG0 for integer helpers Alexander Graf
2012-09-10 11:40 ` [Qemu-devel] [PATCH 09/12] target-s390x: avoid AREG0 for condition code helpers Alexander Graf
2012-09-10 11:40 ` [Qemu-devel] [PATCH 10/12] target-s390x: avoid AREG0 for misc helpers Alexander Graf
2012-09-10 11:40 ` [Qemu-devel] [PATCH 11/12] target-s390x: switch to AREG0 free mode Alexander Graf
2012-09-10 11:40 ` Alexander Graf [this message]
2012-09-10 13:16 ` [Qemu-devel] [PULL 00/12] s390 patch queue 2012-09-10 Aurelien Jarno
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=1347277257-22639-13-git-send-email-agraf@suse.de \
--to=agraf@suse.de \
--cc=aurelien@aurel32.net \
--cc=blauwirbel@gmail.com \
--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).