target-s390x: Several small fixes
cover target-s390x: Several small fixes
The first patch was triggered by a compilation error with configuration --enable-debug-tcg on 64 bit hosts.
While looking for a fix, I noticed another issue in the same function which I tried to fix in the 2nd patch.
Finally, I reviewed all allocations of TCGv_i64 values and the matching tcg_temp_free_i64() calls.
Please review my patches - I only did a compile check on x86 linux.
Feel free to combine patches if larger patches are preferred.
Regards,
Stefan W.
[PATCH 01/12] target-s390x: Fix wrong argument in call of tcg_gen_shl_i64() [PATCH 02/12] target-s390x: Fix duplicate call of tcg_temp_new_i64 [PATCH 03/12] target-s390x: Add missing tcg_temp_free_i64() [PATCH 04/12] target-s390x: Add missing tcg_temp_free_i64() [PATCH 05/12] target-s390x: Add missing tcg_temp_free_i64() [PATCH 06/12] target-s390x: Add missing tcg_temp_free_i64() [PATCH 07/12] target-s390x: Add missing tcg_temp_free_i64() [PATCH 08/12] target-s390x: Add missing tcg_temp_free_i64() [PATCH 09/12] target-s390x: Add missing tcg_temp_free_i64() [PATCH 10/12] target-s390x: Add missing tcg_temp_free_i64() [PATCH 11/12] target-s390x: Add missing tcg_temp_free_i64() [PATCH 12/12] target-s390x: Add missing tcg_temp_free_i32()
PATCH 1/12 target-s390x: Fix wrong argument in call of tcg_gen_shl_i64()
tcg_gen_shl_i64 needs an argument of type TCGv_i64. Using tmp4 needs some additional changes.
--- target-s390x/translate.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-)
target-s390x/translate.c +5 -3
@@ -2056,7 +2056,6 @@ do_mh:even for very long ones... */ tmp =get_address (s,0 , b2, d2); tmp3 =tcg_const_i64 (stm_len); - tmp4 =tcg_const_i64 (32 );for (i = r1;; i = (i +1 ) %16 ) {switch (op) {case 0x4 :
@@ -2070,7 +2069,9 @@ do_mh:#else tmp2 =tcg_temp_new_i64 ();tcg_gen_qemu_ld32u (tmp2, tmp,get_mem_index (s)); -tcg_gen_shl_i64 (tmp2, tmp2,4 ); + tmp4 =tcg_const_i64 (4 ); +tcg_gen_shl_i64 (tmp2, tmp2, tmp4); +tcg_temp_free_i64 (tmp4);tcg_gen_ext32u_i64 (regs[i], regs[i]);tcg_gen_or_i64 (regs[i], regs[i], tmp2);#endif
@@ -2081,7 +2082,9 @@ do_mh:break ;case 0x26 : tmp2 =tcg_temp_new_i64 (); + tmp4 =tcg_const_i64 (32 );tcg_gen_shr_i64 (tmp2, regs[i], tmp4); +tcg_temp_free_i64 (tmp4);tcg_gen_qemu_st32 (tmp2, tmp,get_mem_index (s));tcg_temp_free_i64 (tmp2);break ;
@@ -2094,7 +2097,6 @@ do_mh:tcg_gen_add_i64 (tmp, tmp, tmp3); }tcg_temp_free_i64 (tmp); -tcg_temp_free_i64 (tmp4);break ;case 0x2c :/* STCMH R1,M3,D2(B2) [RSY] */ tmp =get_address (s,0 , b2, d2);
Signature · 1 line
1.7.2.5
Re: [Qemu-devel] [PATCH 01/12] target-s390x: Fix wrong argument in call of tcg_gen_shl_i64()
Quoted 32 lines · Stefan Weil
tcg_gen_shl_i64needs an argument of typeTCGv_i64. Using tmp4 needs some additional changes.Signed-off-by Stefan Weil <[email protected]>---
target-s390x/translate.c| 8 +++++---1 files changed, 5 insertions(+), 3 deletions(-)target-s390x/translate.c +3
-2@@ -2056,7 +2056,6 @@ do_mh:even for very long ones... */ tmp =get_address (s,0 , b2, d2); tmp3 =tcg_const_i64 (stm_len); - tmp4 =tcg_const_i64 (32 );for (i = r1;; i = (i +1 ) %16 ) {switch (op) {case 0x4 :@@ -2070,7 +2069,9 @@ do_mh:#else tmp2 =tcg_temp_new_i64 ();tcg_gen_qemu_ld32u (tmp2, tmp,get_mem_index (s)); -tcg_gen_shl_i64 (tmp2, tmp2,4 ); + tmp4 =tcg_const_i64 (4 ); +tcg_gen_shl_i64 (tmp2, tmp2, tmp4); +tcg_temp_free_i64 (tmp4);tcg_gen_ext32u_i64 (regs[i], regs[i]);tcg_gen_or_i64 (regs[i], regs[i], tmp2);#endif
target-s390x/translate.c do_mh: · line 2085
Quoted 4 lines
target-s390x/translate.c +1
-0@@ -2081,7 +2082,9 @@ do_mh:break ;case 0x26 : tmp2 =tcg_temp_new_i64 (); + tmp4 =tcg_const_i64 (32 );
This moves the const inside the loop, which is exactly what I was trying to avoid here. The problem is that every new const generated here issues 1 additional tcg op, which really sums up when there's too many of them. I've had the buffer exceed here plenty of times.
Alex
Re: [Qemu-devel] [PATCH 01/12] target-s390x: Fix wrong argument in call of tcg_gen_shl_i64()
Am 26.05.2011 00:15, schrieb Alexander Graf:
Quoted 40 lines · Stefan Weil
Quoted 33 lines
tcg_gen_shl_i64needs an argument of typeTCGv_i64. Using tmp4 needs some additional changes.Signed-off-by Stefan Weil<[email protected]>---
target-s390x/translate.c| 8 +++++---1 files changed, 5 insertions(+), 3 deletions(-)target-s390x/translate.c +3
-2@@ -2056,7 +2056,6 @@ do_mh:even for very long ones... */ tmp =get_address (s,0 , b2, d2); tmp3 =tcg_const_i64 (stm_len); - tmp4 =tcg_const_i64 (32 );for (i = r1;; i = (i +1 ) %16 ) {switch (op) {case 0x4 :@@ -2070,7 +2069,9 @@ do_mh:#else tmp2 =tcg_temp_new_i64 ();tcg_gen_qemu_ld32u (tmp2, tmp,get_mem_index (s)); -tcg_gen_shl_i64 (tmp2, tmp2,4 ); + tmp4 =tcg_const_i64 (4 ); +tcg_gen_shl_i64 (tmp2, tmp2, tmp4); +tcg_temp_free_i64 (tmp4);tcg_gen_ext32u_i64 (regs[i], regs[i]);tcg_gen_or_i64 (regs[i], regs[i], tmp2);#endif target-s390x/translate.c do_mh: · line 2085
Quoted 4 lines
target-s390x/translate.c +1
-0@@ -2081,7 +2082,9 @@ do_mh:break ;case 0x26 : tmp2 =tcg_temp_new_i64 (); + tmp4 =tcg_const_i64 (32 );This moves the const inside the loop, which is exactly what I was trying to avoid here. The problem is that every new const generated here issues 1 additional tcg op, which really sums up when there's too many of them. I've had the buffer exceed here plenty of times.
Quoted 1 line
Alex
I noticed that, too. But adding a tmp5 and generating two const outside the loop of whom only one or even none is used is also a bad solution.
What about moving the loop inside the switch statement (one loop for every case)? This does not look nice but looks like the best solution here.
If you prefer a different solution, just omit this part of my patch series.
Grüße, Stefan
Re: [Qemu-devel] [PATCH 01/12] target-s390x: Fix wrong argument in call of tcg_gen_shl_i64()
Am 26.05.2011 06:32, schrieb Stefan Weil:
Quoted 46 lines
Am 26.05.2011 00:15, schrieb Alexander Graf:
Quoted 40 lines · Stefan Weil
Quoted 33 lines
tcg_gen_shl_i64needs an argument of typeTCGv_i64. Using tmp4 needs some additional changes.Signed-off-by Stefan Weil<[email protected]>---
target-s390x/translate.c| 8 +++++---1 files changed, 5 insertions(+), 3 deletions(-)target-s390x/translate.c +3
-2@@ -2056,7 +2056,6 @@ do_mh:even for very long ones... */ tmp =get_address (s,0 , b2, d2); tmp3 =tcg_const_i64 (stm_len); - tmp4 =tcg_const_i64 (32 );for (i = r1;; i = (i +1 ) %16 ) {switch (op) {case 0x4 :@@ -2070,7 +2069,9 @@ do_mh:#else tmp2 =tcg_temp_new_i64 ();tcg_gen_qemu_ld32u (tmp2, tmp,get_mem_index (s)); -tcg_gen_shl_i64 (tmp2, tmp2,4 ); + tmp4 =tcg_const_i64 (4 ); +tcg_gen_shl_i64 (tmp2, tmp2, tmp4); +tcg_temp_free_i64 (tmp4);tcg_gen_ext32u_i64 (regs[i], regs[i]);tcg_gen_or_i64 (regs[i], regs[i], tmp2);#endif target-s390x/translate.c do_mh: · line 2085
Quoted 4 lines
target-s390x/translate.c +1
-0@@ -2081,7 +2082,9 @@ do_mh:break ;case 0x26 : tmp2 =tcg_temp_new_i64 (); + tmp4 =tcg_const_i64 (32 );This moves the const inside the loop, which is exactly what I was trying to avoid here. The problem is that every new const generated here issues 1 additional tcg op, which really sums up when there's too many of them. I've had the buffer exceed here plenty of times.
Quoted 1 line
Alex
I noticed that, too. But adding a tmp5 and generating two const outside the loop of whom only one or even none is used is also a bad solution.
Quoted 6 lines
What about moving the loop inside the switch statement (one loop for every case)? This does not look nice but looks like the best solution here.
If you prefer a different solution, just omit this part of my patch series.
Grüße, Stefan
Would it be possible to use tcg_gen_shli_64 / tcg_gen_shri_64 and remove tmp4 completely?
Stefan
Re: [Qemu-devel] [PATCH 01/12] target-s390x: Fix wrong argument in call of tcg_gen_shl_i64()
Quoted 50 lines · Stefan Weil
Am 26.05.2011 06:32, schrieb Stefan Weil:
Quoted 49 lines
Am 26.05.2011 00:15, schrieb Alexander Graf:
Quoted 40 lines · Stefan Weil
Quoted 33 lines
tcg_gen_shl_i64needs an argument of typeTCGv_i64. Using tmp4 needs some additional changes.Signed-off-by Stefan Weil<[email protected]>---
target-s390x/translate.c| 8 +++++---1 files changed, 5 insertions(+), 3 deletions(-)target-s390x/translate.c +3
-2@@ -2056,7 +2056,6 @@ do_mh:even for very long ones... */ tmp =get_address (s,0 , b2, d2); tmp3 =tcg_const_i64 (stm_len); - tmp4 =tcg_const_i64 (32 );for (i = r1;; i = (i +1 ) %16 ) {switch (op) {case 0x4 :@@ -2070,7 +2069,9 @@ do_mh:#else tmp2 =tcg_temp_new_i64 ();tcg_gen_qemu_ld32u (tmp2, tmp,get_mem_index (s)); -tcg_gen_shl_i64 (tmp2, tmp2,4 ); + tmp4 =tcg_const_i64 (4 ); +tcg_gen_shl_i64 (tmp2, tmp2, tmp4); +tcg_temp_free_i64 (tmp4);tcg_gen_ext32u_i64 (regs[i], regs[i]);tcg_gen_or_i64 (regs[i], regs[i], tmp2);#endif target-s390x/translate.c do_mh: · line 2085
Quoted 4 lines
target-s390x/translate.c +1
-0@@ -2081,7 +2082,9 @@ do_mh:break ;case 0x26 : tmp2 =tcg_temp_new_i64 (); + tmp4 =tcg_const_i64 (32 );This moves the const inside the loop, which is exactly what I was trying to avoid here. The problem is that every new const generated here issues 1 additional tcg op, which really sums up when there's too many of them. I've had the buffer exceed here plenty of times.
Quoted 1 line
Alex
I noticed that, too. But adding a tmp5 and generating two const outside the loop of whom only one or even none is used is also a bad solution.
What about moving the loop inside the switch statement (one loop for every case)? This does not look nice but looks like the best solution here.
Quoted 6 lines
Quoted 3 lines
If you prefer a different solution, just omit this part of my patch series.
Grüße, Stefan
Would it be possible to use
tcg_gen_shli_64/tcg_gen_shri_64and remove tmp4 completely?
That's what I had originally. It basically does exactly the same as the code you have patched it to :). Any immediate tcg op internally just generates a const tcg var and calls the generic one.
Alex
PATCH 2/12 target-s390x: Fix duplicate call of tcg_temp_new_i64
In reply to Stefan Weiltmp2 = tcg_temp_new_i64() is already executed unconditionally, so there is no need to call it a second time for 64 bit hosts.
--- target-s390x/translate.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
target-s390x/translate.c +0 -1
@@ -2067,7 +2067,6 @@ do_mh:tcg_gen_qemu_ld32u (tmp2, tmp,get_mem_index (s));tcg_gen_trunc_i64_i32 (TCGV_HIGH (regs[i]), tmp2);#else - tmp2 =tcg_temp_new_i64 ();tcg_gen_qemu_ld32u (tmp2, tmp,get_mem_index (s)); tmp4 =tcg_const_i64 (4 );tcg_gen_shl_i64 (tmp2, tmp2, tmp4);
Signature · 1 line
1.7.2.5
PATCH 3/12 target-s390x: Add missing tcg_temp_free_i64()
In reply to Stefan Weil--- target-s390x/translate.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
target-s390x/translate.c +1 -0
@@ -1095,6 +1095,7 @@ static void gen_jcc(DisasContext *s, uint32_t mask, int skip)tcg_gen_brcondi_i64 (TCG_COND_EQ , tmp64,0 , skip);break ;default : +tcg_temp_free_i64 (tmp64); goto do_dynamic; }tcg_temp_free_i64 (tmp64);
Signature · 1 line
1.7.2.5
PATCH 4/12 target-s390x: Add missing tcg_temp_free_i64()
In reply to Stefan Weil--- target-s390x/translate.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
target-s390x/translate.c +1 -0
@@ -2097,6 +2097,7 @@ do_mh:tcg_gen_add_i64 (tmp, tmp, tmp3); }tcg_temp_free_i64 (tmp); +tcg_temp_free_i64 (tmp3);break ;case 0x2c :/* STCMH R1,M3,D2(B2) [RSY] */ tmp =get_address (s,0 , b2, d2);
Signature · 1 line
1.7.2.5
PATCH 5/12 target-s390x: Add missing tcg_temp_free_i64()
In reply to Stefan Weil--- target-s390x/translate.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
target-s390x/translate.c +2 -0
@@ -2966,6 +2966,8 @@ static void disas_b2(DisasContext *s, int op, uint32_t insn)/* we need to keep cc_op intact */ s->is_jmp =DISAS_JUMP ;tcg_temp_free_i64 (tmp); +tcg_temp_free_i64 (tmp2); +tcg_temp_free_i64 (tmp3);break ;case 0x20 :/* SERVC R1,R2 [RRE] */ /* SCLP Service call (PV hypercall) */
Signature · 1 line
1.7.2.5
PATCH 6/12 target-s390x: Add missing tcg_temp_free_i64()
In reply to Stefan Weil--- target-s390x/translate.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
target-s390x/translate.c +2 -0
@@ -4598,6 +4598,8 @@ static void disas_s390_insn(DisasContext *s)store_reg32 (r1, tmp32_1);tcg_gen_trunc_i64_i32 (tmp32_2, tmp2);store_reg32 (r1 +1 , tmp32_2); +tcg_temp_free_i64 (tmp); +tcg_temp_free_i64 (tmp2);break ;case 0x98 :/* LM R1,R3,D2(B2) [RS] */ case 0x90 :/* STM R1,R3,D2(B2) [RS] */
Signature · 1 line
1.7.2.5
PATCH 7/12 target-s390x: Add missing tcg_temp_free_i64()
In reply to Stefan Weil--- target-s390x/translate.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
target-s390x/translate.c +1 -0
@@ -4623,6 +4623,7 @@ static void disas_s390_insn(DisasContext *s) }tcg_gen_add_i64 (tmp, tmp, tmp3); } +tcg_temp_free_i64 (tmp);tcg_temp_free_i64 (tmp2);tcg_temp_free_i64 (tmp3);tcg_temp_free_i64 (tmp4);
Signature · 1 line
1.7.2.5
PATCH 8/12 target-s390x: Add missing tcg_temp_free_i64()
In reply to Stefan Weilload_reg() needs a matching tcg_temp_free_i64().
--- target-s390x/translate.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
target-s390x/translate.c +1 -0
@@ -2367,6 +2367,7 @@ static void disas_a5(DisasContext *s, int op, int r1, int i2)tcg_gen_shri_i64 (tmp2, tmp,48 );tcg_gen_trunc_i64_i32 (tmp32, tmp2);set_cc_nz_u32 (s, tmp32); +tcg_temp_free_i64 (tmp);tcg_temp_free_i64 (tmp2);tcg_temp_free_i32 (tmp32);break ;
Signature · 1 line
1.7.2.5
PATCH 9/12 target-s390x: Add missing tcg_temp_free_i64()
In reply to Stefan Weilload_reg() needs a matching tcg_temp_free_i64().
--- target-s390x/translate.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
target-s390x/translate.c +1 -0
@@ -2393,6 +2393,7 @@ static void disas_a5(DisasContext *s, int op, int r1, int i2)tcg_gen_trunc_i64_i32 (tmp32, tmp2);tcg_gen_andi_i32 (tmp32, tmp32,0xffff );set_cc_nz_u32 (s, tmp32); +tcg_temp_free_i64 (tmp);tcg_temp_free_i64 (tmp2);tcg_temp_free_i32 (tmp32);break ;
Signature · 1 line
1.7.2.5
PATCH 10/12 target-s390x: Add missing tcg_temp_free_i64()
In reply to Stefan Weilload_reg() needs a matching tcg_temp_free_i64().
--- target-s390x/translate.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
target-s390x/translate.c +1 -0
@@ -2419,6 +2419,7 @@ static void disas_a5(DisasContext *s, int op, int r1, int i2)tcg_gen_trunc_i64_i32 (tmp32, tmp);tcg_gen_andi_i32 (tmp32, tmp32,0xffff );set_cc_nz_u32 (s, tmp32); +tcg_temp_free_i64 (tmp);tcg_temp_free_i64 (tmp2);tcg_temp_free_i32 (tmp32);break ;
Signature · 1 line
1.7.2.5
PATCH 11/12 target-s390x: Add missing tcg_temp_free_i64()
In reply to Stefan Weilload_reg() needs a matching tcg_temp_free_i64().
--- target-s390x/translate.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
target-s390x/translate.c +1 -0
@@ -2443,6 +2443,7 @@ static void disas_a5(DisasContext *s, int op, int r1, int i2)tcg_gen_trunc_i64_i32 (tmp32, tmp);tcg_gen_andi_i32 (tmp32, tmp32,0xffff );set_cc_nz_u32 (s, tmp32);/* signedness should not matter here */ +tcg_temp_free_i64 (tmp);tcg_temp_free_i64 (tmp2);tcg_temp_free_i32 (tmp32);break ;
Signature · 1 line
1.7.2.5
PATCH 12/12 target-s390x: Add missing tcg_temp_free_i32()
In reply to Stefan Weil--- target-s390x/translate.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
target-s390x/translate.c +3 -0
@@ -1078,9 +1078,12 @@ static void gen_jcc(DisasContext *s, uint32_t mask, int skip)tcg_gen_brcondi_i32 (TCG_COND_EQ , tmp,0 , skip);break ;default : +tcg_temp_free_i32 (tmp); +tcg_temp_free_i32 (tmp2); goto do_dynamic; }tcg_temp_free_i32 (tmp); +tcg_temp_free_i32 (tmp2);account_inline_branch (s);break ;case CC_OP_TM_64 :
Signature · 1 line
1.7.2.5
Quoted 1 line · Stefan Weil
Feel free to combine patches if larger patches are preferred.
I'd vote for combining at least 03..12, having nine patches all of which have the same summary line is a bit confusing :-)
-- PMM
Quoted 5 lines · Peter Maydell
Quoted 1 line · Stefan Weil
Feel free to combine patches if larger patches are preferred.
I'd vote for combining at least 03..12, having nine patches all of which have the same summary line is a bit confusing :-)
I actually like them as individual patches. Makes bisecting a lot easier :).
Alex
Am 26.05.2011 um 00:17 schrieb Alexander Graf:
Quoted 9 lines · Peter Maydell
Quoted 6 lines · Stefan Weil
Quoted 1 line
Feel free to combine patches if larger patches are preferred.
I'd vote for combining at least 03..12, having nine patches all of which have the same summary line is a bit confusing :-)
I actually like them as individual patches. Makes bisecting a lot easier :).
Stefan, could you add the function name or some other discriminator to the subject then, please?
Andreas
Am 26.05.2011 23:48, schrieb Andreas Färber:
Quoted 7 lines
Am 26.05.2011 um 00:17 schrieb Alexander Graf:
Quoted 5 lines · Peter Maydell
Quoted 4 lines · Stefan Weil
Quoted 1 line
Feel free to combine patches if larger patches are preferred.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
I'd vote for combining at least 03..12, having nine patches all of which have the same summary line is a bit confusing :-)
I actually like them as individual patches. Makes bisecting a lot easier :).
Stefan, could you add the function name or some other discriminator to the subject then, please?
Andreas
This would result in these subjects:
4 x target-s390x: Add missing tcg_temp_free_i64() in disas_a5 2 x target-s390x: Add missing tcg_temp_free_i64() in disas_s390_insn 1 x target-s390x: Add missing tcg_temp_free_i64() in disas_b2 1 x target-s390x: Add missing tcg_temp_free_i64() in do_mh 1 x target-s390x: Add missing tcg_temp_free_i64() in gen_jcc
So there remain duplicate subjects. Adding the line number or a sequence number would look somehow strange.
The subjects are identical simply because the changes are very similar. If needed, git provides the unique identification.
Maybe combining the patches which share the same function and add this function name to the subject would be a compromise which still allows bisecting.
Cheers,
Stefan
Quoted 13 lines · Stefan Weil
Am 26.05.2011 23:48, schrieb Andreas Färber:
Quoted 12 lines
Am 26.05.2011 um 00:17 schrieb Alexander Graf:
Quoted 9 lines · Peter Maydell
Quoted 6 lines · Stefan Weil
Quoted 1 line
Feel free to combine patches if larger patches are preferred.
I'd vote for combining at least 03..12, having nine patches all of which have the same summary line is a bit confusing :-)
I actually like them as individual patches. Makes bisecting a lot easier :).
Quoted 8 lines
Quoted 3 lines
Stefan, could you add the function name or some other discriminator to the subject then, please?
Andreas
This would result in these subjects:
4 x target-s390x: Add missing
tcg_temp_free_i64()indisas_a52 x target-s390x: Add missingtcg_temp_free_i64()indisas_s390_insn
Inside the functions there's a switch that determines the actual opcode. Just use that in the name?
Alex
v2 cover target-s390x: Several small fixes
In reply to Stefan WeilThis is an update of my last patch series.
Modifications in v2:
* Changed 01/12 to create more efficient code.
* Modified subject lines of 03/12 up to 11/12 so there are no duplicates.
Regards,
Stefan W.
[PATCH v2 01/12] target-s390x: Fix wrong argument in call of tcg_gen_shl_i64() [PATCH v2 02/12] target-s390x: Fix duplicate call of tcg_temp_new_i64
[PATCH v2 03/12] target-s390x: Add missing tcg_temp_free_i64() in gen_jcc() [PATCH v2 04/12] target-s390x: Add missing tcg_temp_free_i64() in do_mh()
[PATCH v2 05/12] target-s390x: Add missing tcg_temp_free_i64() in disas_b2() [PATCH v2 06/12] target-s390x: Add missing tcg_temp_free_i64() in disas_s390_insn(), opc == 0x8e [PATCH v2 07/12] target-s390x: Add missing tcg_temp_free_i64() in disas_s390_insn(), opc == 0x90 [PATCH v2 08/12] target-s390x: Add missing tcg_temp_free_i64() in disas_a5(), opc == 0x8 [PATCH v2 09/12] target-s390x: Add missing tcg_temp_free_i64() in disas_a5(), opc == 0x9 [PATCH v2 10/12] target-s390x: Add missing tcg_temp_free_i64() in disas_a5(), opc == 0xa [PATCH v2 11/12] target-s390x: Add missing tcg_temp_free_i64() in disas_a5(), opc == 0xb [PATCH v2 12/12] target-s390x: Add missing tcg_temp_free_i32()
PATCH v2 1/12 target-s390x: Fix wrong argument in call of tcg_gen_shl_i64()
In reply to Stefan Weiltcg_gen_shl_i64 needs a 3rd argument of type TCGv_i64. Set tmp4 so it can be used here.
v2:
Don't call tcg_const_i64() inside of the loop
because it creates additional code.
--- target-s390x/translate.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
target-s390x/translate.c +2 -2
@@ -2056,7 +2056,7 @@ do_mh:even for very long ones... */ tmp =get_address (s,0 , b2, d2); tmp3 =tcg_const_i64 (stm_len); - tmp4 =tcg_const_i64 (32 ); + tmp4 =tcg_const_i64 (op ==0x26 ?32 :4 );for (i = r1;; i = (i +1 ) %16 ) {switch (op) {case 0x4 :
@@ -2070,7 +2070,7 @@ do_mh:#else tmp2 =tcg_temp_new_i64 ();tcg_gen_qemu_ld32u (tmp2, tmp,get_mem_index (s)); -tcg_gen_shl_i64 (tmp2, tmp2,4 ); +tcg_gen_shl_i64 (tmp2, tmp2, tmp4);tcg_gen_ext32u_i64 (regs[i], regs[i]);tcg_gen_or_i64 (regs[i], regs[i], tmp2);#endif
Signature · 1 line
1.7.2.5
PATCH v2 2/12 target-s390x: Fix duplicate call of tcg_temp_new_i64
In reply to Stefan Weiltmp2 = tcg_temp_new_i64() is already executed unconditionally, so there is no need to call it a second time for 64 bit hosts.
--- target-s390x/translate.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
target-s390x/translate.c +0 -1
@@ -2068,7 +2068,6 @@ do_mh:tcg_gen_qemu_ld32u (tmp2, tmp,get_mem_index (s));tcg_gen_trunc_i64_i32 (TCGV_HIGH (regs[i]), tmp2);#else - tmp2 =tcg_temp_new_i64 ();tcg_gen_qemu_ld32u (tmp2, tmp,get_mem_index (s));tcg_gen_shl_i64 (tmp2, tmp2, tmp4);tcg_gen_ext32u_i64 (regs[i], regs[i]);
Signature · 1 line
1.7.2.5
PATCH v2 3/12 target-s390x: Add missing tcg_temp_free_i64() in gen_jcc()
In reply to Stefan Weil--- target-s390x/translate.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
target-s390x/translate.c +1 -0
@@ -1095,6 +1095,7 @@ static void gen_jcc(DisasContext *s, uint32_t mask, int skip)tcg_gen_brcondi_i64 (TCG_COND_EQ , tmp64,0 , skip);break ;default : +tcg_temp_free_i64 (tmp64); goto do_dynamic; }tcg_temp_free_i64 (tmp64);
Signature · 1 line
1.7.2.5
PATCH v2 4/12 target-s390x: Add missing tcg_temp_free_i64() in do_mh()
In reply to Stefan Weil--- target-s390x/translate.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
target-s390x/translate.c +1 -0
@@ -2094,6 +2094,7 @@ do_mh:tcg_gen_add_i64 (tmp, tmp, tmp3); }tcg_temp_free_i64 (tmp); +tcg_temp_free_i64 (tmp3);tcg_temp_free_i64 (tmp4);break ;case 0x2c :/* STCMH R1,M3,D2(B2) [RSY] */
Signature · 1 line
1.7.2.5
PATCH v2 5/12 target-s390x: Add missing tcg_temp_free_i64() in disas_b2()
In reply to Stefan Weil--- target-s390x/translate.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
target-s390x/translate.c +2 -0
@@ -2964,6 +2964,8 @@ static void disas_b2(DisasContext *s, int op, uint32_t insn)/* we need to keep cc_op intact */ s->is_jmp =DISAS_JUMP ;tcg_temp_free_i64 (tmp); +tcg_temp_free_i64 (tmp2); +tcg_temp_free_i64 (tmp3);break ;case 0x20 :/* SERVC R1,R2 [RRE] */ /* SCLP Service call (PV hypercall) */
Signature · 1 line
1.7.2.5
PATCH v2 6/12 target-s390x: Add missing tcg_temp_free_i64() in disas_s390_insn(), opc == 0x8e
In reply to Stefan Weil--- target-s390x/translate.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
target-s390x/translate.c +2 -0
@@ -4596,6 +4596,8 @@ static void disas_s390_insn(DisasContext *s)store_reg32 (r1, tmp32_1);tcg_gen_trunc_i64_i32 (tmp32_2, tmp2);store_reg32 (r1 +1 , tmp32_2); +tcg_temp_free_i64 (tmp); +tcg_temp_free_i64 (tmp2);break ;case 0x98 :/* LM R1,R3,D2(B2) [RS] */ case 0x90 :/* STM R1,R3,D2(B2) [RS] */
Signature · 1 line
1.7.2.5
PATCH v2 7/12 target-s390x: Add missing tcg_temp_free_i64() in disas_s390_insn(), opc == 0x90
In reply to Stefan Weil--- target-s390x/translate.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
target-s390x/translate.c +1 -0
@@ -4621,6 +4621,7 @@ static void disas_s390_insn(DisasContext *s) }tcg_gen_add_i64 (tmp, tmp, tmp3); } +tcg_temp_free_i64 (tmp);tcg_temp_free_i64 (tmp2);tcg_temp_free_i64 (tmp3);tcg_temp_free_i64 (tmp4);
Signature · 1 line
1.7.2.5
PATCH v2 8/12 target-s390x: Add missing tcg_temp_free_i64() in disas_a5(), opc == 0x8
In reply to Stefan Weilload_reg() needs a matching tcg_temp_free_i64().
--- target-s390x/translate.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
target-s390x/translate.c +1 -0
@@ -2365,6 +2365,7 @@ static void disas_a5(DisasContext *s, int op, int r1, int i2)tcg_gen_shri_i64 (tmp2, tmp,48 );tcg_gen_trunc_i64_i32 (tmp32, tmp2);set_cc_nz_u32 (s, tmp32); +tcg_temp_free_i64 (tmp);tcg_temp_free_i64 (tmp2);tcg_temp_free_i32 (tmp32);break ;
Signature · 1 line
1.7.2.5
Re: [Qemu-devel] [PATCH v2 08/12] target-s390x: Add missing tcg_temp_free_i64() in disas_a5(), opc == 0x8
Quoted 12 lines · Stefan Weil
load_reg()needs a matchingtcg_temp_free_i64().Signed-off-by Stefan Weil <[email protected]>---
target-s390x/translate.c| 1 +1 files changed, 1 insertions(+), 0 deletions(-)target-s390x/translate.c +0
-0
target-s390x/translate.c static void disas_a5(DisasContext *s, int op, int r1, int i2) · line 2368
Quoted 4 lines
target-s390x/translate.c +1
-0@@ -2365,6 +2365,7 @@ static void disas_a5(DisasContext *s, int op, int r1, int i2)tcg_gen_shri_i64 (tmp2, tmp,48 );tcg_gen_trunc_i64_i32 (tmp32, tmp2);set_cc_nz_u32 (s, tmp32); +tcg_temp_free_i64 (tmp);
tmp gets freed at the end of the function, so this one is bad.
Alex
PATCH v2 9/12 target-s390x: Add missing tcg_temp_free_i64() in disas_a5(), opc == 0x9
In reply to Stefan Weilload_reg() needs a matching tcg_temp_free_i64().
--- target-s390x/translate.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
target-s390x/translate.c +1 -0
@@ -2391,6 +2391,7 @@ static void disas_a5(DisasContext *s, int op, int r1, int i2)tcg_gen_trunc_i64_i32 (tmp32, tmp2);tcg_gen_andi_i32 (tmp32, tmp32,0xffff );set_cc_nz_u32 (s, tmp32); +tcg_temp_free_i64 (tmp);tcg_temp_free_i64 (tmp2);tcg_temp_free_i32 (tmp32);break ;
Signature · 1 line
1.7.2.5
PATCH v2 10/12 target-s390x: Add missing tcg_temp_free_i64() in disas_a5(), opc == 0xa
In reply to Stefan Weilload_reg() needs a matching tcg_temp_free_i64().
--- target-s390x/translate.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
target-s390x/translate.c +1 -0
@@ -2417,6 +2417,7 @@ static void disas_a5(DisasContext *s, int op, int r1, int i2)tcg_gen_trunc_i64_i32 (tmp32, tmp);tcg_gen_andi_i32 (tmp32, tmp32,0xffff );set_cc_nz_u32 (s, tmp32); +tcg_temp_free_i64 (tmp);tcg_temp_free_i64 (tmp2);tcg_temp_free_i32 (tmp32);break ;
Signature · 1 line
1.7.2.5
PATCH v2 11/12 target-s390x: Add missing tcg_temp_free_i64() in disas_a5(), opc == 0xb
In reply to Stefan Weilload_reg() needs a matching tcg_temp_free_i64().
--- target-s390x/translate.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
target-s390x/translate.c +1 -0
@@ -2441,6 +2441,7 @@ static void disas_a5(DisasContext *s, int op, int r1, int i2)tcg_gen_trunc_i64_i32 (tmp32, tmp);tcg_gen_andi_i32 (tmp32, tmp32,0xffff );set_cc_nz_u32 (s, tmp32);/* signedness should not matter here */ +tcg_temp_free_i64 (tmp);tcg_temp_free_i64 (tmp2);tcg_temp_free_i32 (tmp32);break ;
Signature · 1 line
1.7.2.5
PATCH v2 12/12 target-s390x: Add missing tcg_temp_free_i32()
In reply to Stefan Weil--- target-s390x/translate.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
target-s390x/translate.c +3 -0
@@ -1078,9 +1078,12 @@ static void gen_jcc(DisasContext *s, uint32_t mask, int skip)tcg_gen_brcondi_i32 (TCG_COND_EQ , tmp,0 , skip);break ;default : +tcg_temp_free_i32 (tmp); +tcg_temp_free_i32 (tmp2); goto do_dynamic; }tcg_temp_free_i32 (tmp); +tcg_temp_free_i32 (tmp2);account_inline_branch (s);break ;case CC_OP_TM_64 :
Signature · 1 line
1.7.2.5