Skip to contentSkip to conversation

target/tcg: Expand tcg_global_mem_new() -> tcg_global_mem_new_i64()

PATCH In review Philippe Mathieu-Daudé 2 participants 3 messages Feb 5 – Feb 6

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/tcg: Expand tcg_global_mem_new() -> tcg_global_mem_new_i64()

The s390x target is a 64-bit one, so tcg_global_mem_new() expands to tcg_global_mem_new_i64(). Use the latter which is more explicit.

---
 target/s390x/tcg/translate.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
target/s390x/tcg/translate.c +3 -3
index 4dabd49840f..203afe265bc 100644
@@ -217,9 +217,9 @@ void s390x_translate_init(void)
 
     for (i = 0; i < 16; i++) {
         snprintf(cpu_reg_names[i], sizeof(cpu_reg_names[0]), "r%d", i);
-        regs[i] = tcg_global_mem_new(tcg_env,
-                                     offsetof(CPUS390XState, regs[i]),
-                                     cpu_reg_names[i]);
+        regs[i] = tcg_global_mem_new_i64(tcg_env,
+                                         offsetof(CPUS390XState, regs[i]),
+                                         cpu_reg_names[i]);
     }
 }
 
Signature · 1 line
2.52.0
#1 lore raw

"target/s390x: ..." in subject :/

Quoted 26 lines · Philippe Mathieu-Daudé

The s390x target is a 64-bit one, so tcg_global_mem_new() expands to tcg_global_mem_new_i64(). Use the latter which is more explicit.

---
  target/s390x/tcg/translate.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
target/s390x/tcg/translate.c +3 -3
index 4dabd49840f..203afe265bc 100644
@@ -217,9 +217,9 @@ void s390x_translate_init(void)
 
      for (i = 0; i < 16; i++) {
          snprintf(cpu_reg_names[i], sizeof(cpu_reg_names[0]), "r%d", i);
-        regs[i] = tcg_global_mem_new(tcg_env,
-                                     offsetof(CPUS390XState, regs[i]),
-                                     cpu_reg_names[i]);
+        regs[i] = tcg_global_mem_new_i64(tcg_env,
+                                         offsetof(CPUS390XState, regs[i]),
+                                         cpu_reg_names[i]);
      }
  }
 
Reviewed-by on v1 1/1
#2 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 16 lines · Philippe Mathieu-Daudé

The s390x target is a 64-bit one, so tcg_global_mem_new() expands to tcg_global_mem_new_i64(). Use the latter which is more explicit.

---
  target/s390x/tcg/translate.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
target/s390x/tcg/translate.c +0 -0
index 4dabd49840f..203afe265bc 100644
@@ -217,9 +217,9 @@ void s390x_translate_init(void)
 
      for (i = 0; i < 16; i++) {

target/s390x/tcg/translate.c void s390x_translate_init(void) · line 225

Quoted 10 lines
target/s390x/tcg/translate.c +3 -3
          snprintf(cpu_reg_names[i], sizeof(cpu_reg_names[0]), "r%d", i);
-        regs[i] = tcg_global_mem_new(tcg_env,
-                                     offsetof(CPUS390XState, regs[i]),
-                                     cpu_reg_names[i]);
+        regs[i] = tcg_global_mem_new_i64(tcg_env,
+                                         offsetof(CPUS390XState, regs[i]),
+                                         cpu_reg_names[i]);
      }
  }