1 |
commit: ee4677ce71f203921022b98b6200a7c1755d1254 |
2 |
Author: Aurelien Jarno <aurelien <AT> aurel32 <DOT> net> |
3 |
AuthorDate: Sat Sep 8 03:45:43 2012 +0000 |
4 |
Commit: Doug Goldstein <cardoe <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Oct 24 07:01:41 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/qemu-kvm.git;a=commit;h=ee4677ce |
7 |
|
8 |
tcg/s390: fix ld/st with CONFIG_TCG_PASS_AREG0 |
9 |
|
10 |
The load/store slow path has been broken in e141ab52d: |
11 |
- We need to move 4 registers for store functions and 3 registers for |
12 |
load functions and not the reverse. |
13 |
- According to the s390x calling convention the arguments of a function |
14 |
should be zero extended. This means that the register shift should be |
15 |
done with TCG_TYPE_I64 to ensure the higher word is correctly zero |
16 |
extended when needed. |
17 |
|
18 |
I am aware that CONFIG_TCG_PASS_AREG0 is being removed and thus that |
19 |
this patch can be improved, but doing so means it can also be applied to |
20 |
the 1.1 and 1.2 stable branches. |
21 |
|
22 |
Signed-off-by: Aurelien Jarno <aurelien <AT> aurel32.net> |
23 |
Signed-off-by: Alexander Graf <agraf <AT> suse.de> |
24 |
|
25 |
--- |
26 |
tcg/s390/tcg-target.c | 14 +++++++------- |
27 |
1 files changed, 7 insertions(+), 7 deletions(-) |
28 |
|
29 |
diff --git a/tcg/s390/tcg-target.c b/tcg/s390/tcg-target.c |
30 |
index 04662c1..99b5339 100644 |
31 |
--- a/tcg/s390/tcg-target.c |
32 |
+++ b/tcg/s390/tcg-target.c |
33 |
@@ -1509,11 +1509,13 @@ static void tcg_prepare_qemu_ldst(TCGContext* s, TCGReg data_reg, |
34 |
tcg_out_movi(s, TCG_TYPE_I32, TCG_REG_R4, mem_index); |
35 |
#ifdef CONFIG_TCG_PASS_AREG0 |
36 |
/* XXX/FIXME: suboptimal */ |
37 |
- tcg_out_mov(s, TCG_TYPE_I32, tcg_target_call_iarg_regs[2], |
38 |
+ tcg_out_mov(s, TCG_TYPE_I64, tcg_target_call_iarg_regs[3], |
39 |
+ tcg_target_call_iarg_regs[2]); |
40 |
+ tcg_out_mov(s, TCG_TYPE_I64, tcg_target_call_iarg_regs[2], |
41 |
tcg_target_call_iarg_regs[1]); |
42 |
- tcg_out_mov(s, TCG_TYPE_TL, tcg_target_call_iarg_regs[1], |
43 |
+ tcg_out_mov(s, TCG_TYPE_I64, tcg_target_call_iarg_regs[1], |
44 |
tcg_target_call_iarg_regs[0]); |
45 |
- tcg_out_mov(s, TCG_TYPE_PTR, tcg_target_call_iarg_regs[0], |
46 |
+ tcg_out_mov(s, TCG_TYPE_I64, tcg_target_call_iarg_regs[0], |
47 |
TCG_AREG0); |
48 |
#endif |
49 |
tgen_calli(s, (tcg_target_ulong)qemu_st_helpers[s_bits]); |
50 |
@@ -1521,13 +1523,11 @@ static void tcg_prepare_qemu_ldst(TCGContext* s, TCGReg data_reg, |
51 |
tcg_out_movi(s, TCG_TYPE_I32, arg1, mem_index); |
52 |
#ifdef CONFIG_TCG_PASS_AREG0 |
53 |
/* XXX/FIXME: suboptimal */ |
54 |
- tcg_out_mov(s, TCG_TYPE_I32, tcg_target_call_iarg_regs[3], |
55 |
- tcg_target_call_iarg_regs[2]); |
56 |
tcg_out_mov(s, TCG_TYPE_I64, tcg_target_call_iarg_regs[2], |
57 |
tcg_target_call_iarg_regs[1]); |
58 |
- tcg_out_mov(s, TCG_TYPE_TL, tcg_target_call_iarg_regs[1], |
59 |
+ tcg_out_mov(s, TCG_TYPE_I64, tcg_target_call_iarg_regs[1], |
60 |
tcg_target_call_iarg_regs[0]); |
61 |
- tcg_out_mov(s, TCG_TYPE_PTR, tcg_target_call_iarg_regs[0], |
62 |
+ tcg_out_mov(s, TCG_TYPE_I64, tcg_target_call_iarg_regs[0], |
63 |
TCG_AREG0); |
64 |
#endif |
65 |
tgen_calli(s, (tcg_target_ulong)qemu_ld_helpers[s_bits]); |