All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH-for-6.2 0/2] target/mips: Use tcg_constant_* in TX79 & MXU
@ 2021-08-08 16:08 Philippe Mathieu-Daudé
  2021-08-08 16:08 ` [PATCH-for-6.2 1/2] target/mips/tx79: Use tcg_constant_tl() Philippe Mathieu-Daudé
  2021-08-08 16:08 ` [PATCH-for-6.2 2/2] target/mips/mxu: Use tcg_constant_i32() Philippe Mathieu-Daudé
  0 siblings, 2 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-08-08 16:08 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Rikalo, Richard Henderson, Philippe Mathieu-Daudé,
	Aurelien Jarno



Philippe Mathieu-Daudé (2):
  target/mips/tx79: Use tcg_constant_tl()
  target/mips/mxu: Use tcg_constant_i32()

 target/mips/tcg/mxu_translate.c  | 6 ++----
 target/mips/tcg/tx79_translate.c | 6 ++----
 2 files changed, 4 insertions(+), 8 deletions(-)

-- 
2.31.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH-for-6.2 1/2] target/mips/tx79: Use tcg_constant_tl()
  2021-08-08 16:08 [PATCH-for-6.2 0/2] target/mips: Use tcg_constant_* in TX79 & MXU Philippe Mathieu-Daudé
@ 2021-08-08 16:08 ` Philippe Mathieu-Daudé
  2021-08-09 19:21   ` Richard Henderson
  2021-08-08 16:08 ` [PATCH-for-6.2 2/2] target/mips/mxu: Use tcg_constant_i32() Philippe Mathieu-Daudé
  1 sibling, 1 reply; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-08-08 16:08 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Rikalo, Richard Henderson, Philippe Mathieu-Daudé,
	Aurelien Jarno

Replace uses of tcg_const_tl() with the allocate and free close together.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 target/mips/tcg/tx79_translate.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/target/mips/tcg/tx79_translate.c b/target/mips/tcg/tx79_translate.c
index 6d51fe17c1a..0dacdf2a619 100644
--- a/target/mips/tcg/tx79_translate.c
+++ b/target/mips/tcg/tx79_translate.c
@@ -247,8 +247,8 @@ static bool trans_parallel_compare(DisasContext *ctx, arg_r *a,
         return true;
     }
 
-    c0 = tcg_const_tl(0);
-    c1 = tcg_const_tl(0xffffffff);
+    c0 = tcg_constant_tl(0);
+    c1 = tcg_constant_tl(0xffffffff);
     ax = tcg_temp_new_i64();
     bx = tcg_temp_new_i64();
     t0 = tcg_temp_new_i64();
@@ -279,8 +279,6 @@ static bool trans_parallel_compare(DisasContext *ctx, arg_r *a,
     tcg_temp_free(t0);
     tcg_temp_free(bx);
     tcg_temp_free(ax);
-    tcg_temp_free(c1);
-    tcg_temp_free(c0);
 
     return true;
 }
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH-for-6.2 2/2] target/mips/mxu: Use tcg_constant_i32()
  2021-08-08 16:08 [PATCH-for-6.2 0/2] target/mips: Use tcg_constant_* in TX79 & MXU Philippe Mathieu-Daudé
  2021-08-08 16:08 ` [PATCH-for-6.2 1/2] target/mips/tx79: Use tcg_constant_tl() Philippe Mathieu-Daudé
@ 2021-08-08 16:08 ` Philippe Mathieu-Daudé
  2021-08-09 19:25   ` Richard Henderson
  1 sibling, 1 reply; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-08-08 16:08 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Rikalo, Richard Henderson, Philippe Mathieu-Daudé,
	Aurelien Jarno

Replace uses of tcg_const_i32() with the allocate and free close together.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 target/mips/tcg/mxu_translate.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/target/mips/tcg/mxu_translate.c b/target/mips/tcg/mxu_translate.c
index f52244e1b2b..85eb7857d36 100644
--- a/target/mips/tcg/mxu_translate.c
+++ b/target/mips/tcg/mxu_translate.c
@@ -1101,7 +1101,7 @@ static void gen_mxu_D16MAX_D16MIN(DisasContext *ctx)
         uint32_t XRx = XRb ? XRb : XRc;
         /* ...and do half-word-wise max/min with one operand 0 */
         TCGv_i32 t0 = tcg_temp_new();
-        TCGv_i32 t1 = tcg_const_i32(0);
+        TCGv_i32 t1 = tcg_constant_i32(0);
 
         /* the left half-word first */
         tcg_gen_andi_i32(t0, mxu_gpr[XRx - 1], 0xFFFF0000);
@@ -1126,7 +1126,6 @@ static void gen_mxu_D16MAX_D16MIN(DisasContext *ctx)
         /* finally update the destination */
         tcg_gen_or_i32(mxu_gpr[XRa - 1], mxu_gpr[XRa - 1], t0);
 
-        tcg_temp_free(t1);
         tcg_temp_free(t0);
     } else if (unlikely(XRb == XRc)) {
         /* both operands same -> just set destination to one of them */
@@ -1198,7 +1197,7 @@ static void gen_mxu_Q8MAX_Q8MIN(DisasContext *ctx)
         uint32_t XRx = XRb ? XRb : XRc;
         /* ...and do byte-wise max/min with one operand 0 */
         TCGv_i32 t0 = tcg_temp_new();
-        TCGv_i32 t1 = tcg_const_i32(0);
+        TCGv_i32 t1 = tcg_constant_i32(0);
         int32_t i;
 
         /* the leftmost byte (byte 3) first */
@@ -1227,7 +1226,6 @@ static void gen_mxu_Q8MAX_Q8MIN(DisasContext *ctx)
             tcg_gen_or_i32(mxu_gpr[XRa - 1], mxu_gpr[XRa - 1], t0);
         }
 
-        tcg_temp_free(t1);
         tcg_temp_free(t0);
     } else if (unlikely(XRb == XRc)) {
         /* both operands same -> just set destination to one of them */
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH-for-6.2 1/2] target/mips/tx79: Use tcg_constant_tl()
  2021-08-08 16:08 ` [PATCH-for-6.2 1/2] target/mips/tx79: Use tcg_constant_tl() Philippe Mathieu-Daudé
@ 2021-08-09 19:21   ` Richard Henderson
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Henderson @ 2021-08-09 19:21 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel; +Cc: Aleksandar Rikalo, Aurelien Jarno

On 8/8/21 6:08 AM, Philippe Mathieu-Daudé wrote:
> Replace uses of tcg_const_tl() with the allocate and free close together.
> 
> Signed-off-by: Philippe Mathieu-Daudé<f4bug@amsat.org>
> ---
>   target/mips/tcg/tx79_translate.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH-for-6.2 2/2] target/mips/mxu: Use tcg_constant_i32()
  2021-08-08 16:08 ` [PATCH-for-6.2 2/2] target/mips/mxu: Use tcg_constant_i32() Philippe Mathieu-Daudé
@ 2021-08-09 19:25   ` Richard Henderson
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Henderson @ 2021-08-09 19:25 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel; +Cc: Aleksandar Rikalo, Aurelien Jarno

On 8/8/21 6:08 AM, Philippe Mathieu-Daudé wrote:
> Replace uses of tcg_const_i32() with the allocate and free close together.
> 
> Signed-off-by: Philippe Mathieu-Daudé<f4bug@amsat.org>
> ---
>   target/mips/tcg/mxu_translate.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)

In my opinion these functions should be simplified by dropping all of the special casing 
for the zero register and simply let the tcg optimizer do its thing.

But failing that, this is fine.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-08-09 19:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-08 16:08 [PATCH-for-6.2 0/2] target/mips: Use tcg_constant_* in TX79 & MXU Philippe Mathieu-Daudé
2021-08-08 16:08 ` [PATCH-for-6.2 1/2] target/mips/tx79: Use tcg_constant_tl() Philippe Mathieu-Daudé
2021-08-09 19:21   ` Richard Henderson
2021-08-08 16:08 ` [PATCH-for-6.2 2/2] target/mips/mxu: Use tcg_constant_i32() Philippe Mathieu-Daudé
2021-08-09 19:25   ` Richard Henderson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.