Skip to contentSkip to conversation

target/tcg: Use TCGv_i64 with tcg_temp_new_i64()

PATCH Superseded Philippe Mathieu-Daudé 3 participants 6 messages Nov 30, 2022 – Dec 1, 2022

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover target/tcg: Use TCGv_i64 with tcg_temp_new_i64()

Although on 64-bit targets TCGv is defined as TCGv_i64, clarify using the correct type for tcg_temp_new_i64().

Philippe Mathieu-Daudé (2):
target/s390x: Replace TCGv by TCGv_i64 in op_mov2e() target/sparc64: Replace TCGv by TCGv_i64 in gen_op_multiply()

 target/s390x/tcg/translate.c | 2 +-
 target/sparc/translate.c     | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.38.1
#1 lore raw

PATCH 1/2 target/s390x: Replace TCGv by TCGv_i64 in op_mov2e()

Although TCGv is defined as TCGv_i64 on s390x, make it clear tcg_temp_new_i64() returns a TCGv_i64.

---
 target/s390x/tcg/translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/s390x/tcg/translate.c +1 -1
index 1e599ac259..a77039b863 100644
@@ -3335,7 +3335,7 @@ static DisasJumpType op_mov2(DisasContext *s, DisasOps *o)
 static DisasJumpType op_mov2e(DisasContext *s, DisasOps *o)
 {
     int b2 = get_field(s, b2);
-    TCGv ar1 = tcg_temp_new_i64();
+    TCGv_i64 ar1 = tcg_temp_new_i64();
 
     o->out = o->in2;
     o->g_out = o->g_in2;
Signature · 1 line
2.38.1
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH-for-8.0 1/2] target/s390x: Replace TCGv by TCGv_i64 in op_mov2e()

Quoted 20 lines · Philippe Mathieu-Daudé

Although TCGv is defined as TCGv_i64 on s390x, make it clear tcg_temp_new_i64() returns a TCGv_i64.

---
 target/s390x/tcg/translate.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
target/s390x/tcg/translate.c +1 -1
index 1e599ac259..a77039b863 100644
@@ -3335,7 +3335,7 @@ static DisasJumpType op_mov2(DisasContext *s,
 DisasOps *o)
  static DisasJumpType op_mov2e(DisasContext *s, DisasOps *o)
  {
      int b2 = get_field(s, b2);
-    TCGv ar1 = tcg_temp_new_i64();
+    TCGv_i64 ar1 = tcg_temp_new_i64();
Quoted 3 lines


     o->out = o->in2;
     o->g_out = o->g_in2;

It looks as if besides sparc and s390x there is one occurrence of this in alpha?

$ git grep -w TCGv | grep -w tcg_temp_new_i64
target/alpha/translate.c:    TCGv tmp = tcg_temp_new_i64();
#3 lore raw

Re: [PATCH-for-8.0 1/2] target/s390x: Replace TCGv by TCGv_i64 in op_mov2e()

Quoted 27 lines · Ilya Leoshkevich
Quoted 22 lines · Philippe Mathieu-Daudé

Although TCGv is defined as TCGv_i64 on s390x, make it clear tcg_temp_new_i64() returns a TCGv_i64.

---
  target/s390x/tcg/translate.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
target/s390x/tcg/translate.c +1 -1
index 1e599ac259..a77039b863 100644
@@ -3335,7 +3335,7 @@ static DisasJumpType op_mov2(DisasContext *s,
 DisasOps *o)
  static DisasJumpType op_mov2e(DisasContext *s, DisasOps *o)
  {
      int b2 = get_field(s, b2);
-    TCGv ar1 = tcg_temp_new_i64();
+    TCGv_i64 ar1 = tcg_temp_new_i64();
 
      o->out = o->in2;
Quoted 1 line

     o->g_out = o->g_in2;

Quoted 5 lines

It looks as if besides sparc and s390x there is one occurrence of this in alpha?

$ git grep -w TCGv | grep -w tcg_temp_new_i64
target/alpha/translate.c:    TCGv tmp = tcg_temp_new_i64();

Oh I missed it, thanks!

#4 lore raw

PATCH 2/2 target/sparc64: Replace TCGv by TCGv_i64 in gen_op_multiply()

In reply to Philippe Mathieu-Daudé

Although TCGv is defined as TCGv_i64 on sparc64, make it clear tcg_temp_new_i64() returns a TCGv_i64.

---
 target/sparc/translate.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
target/sparc/translate.c +2 -2
index 34858eb95f..5a08641995 100644
@@ -647,8 +647,8 @@ static inline void gen_op_multiply(TCGv dst, TCGv src1, TCGv src2, int sign_ext)
         tcg_gen_mulu2_tl(dst, cpu_y, src1, src2);
     }
 #else
-    TCGv t0 = tcg_temp_new_i64();
-    TCGv t1 = tcg_temp_new_i64();
+    TCGv_i64 t0 = tcg_temp_new_i64();
+    TCGv_i64 t1 = tcg_temp_new_i64();
 
     if (sign_ext) {
         tcg_gen_ext32s_i64(t0, src1);
Signature · 1 line
2.38.1
Reviewed-by on the v1 series
#5 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 11 lines · Philippe Mathieu-Daudé

Although on 64-bit targets TCGv is defined as TCGv_i64, clarify using the correct type for tcg_temp_new_i64().

Philippe Mathieu-Daudé (2):
target/s390x: Replace TCGv by TCGv_i64 in op_mov2e() target/sparc64: Replace TCGv by TCGv_i64 in gen_op_multiply()

  target/s390x/tcg/translate.c | 2 +-
  target/sparc/translate.c     | 4 ++--
  2 files changed, 3 insertions(+), 3 deletions(-)

r~