diff mbox series

[29/84] tcg: Remove TARGET_LONG_BITS, TCG_TYPE_TL

Message ID 20230503072331.1747057-30-richard.henderson@linaro.org
State Superseded
Headers show
Series tcg: Build once for system, once for user | expand

Commit Message

Richard Henderson May 3, 2023, 7:22 a.m. UTC
All uses replaced with TCGContext.addr_type.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 tcg/tcg.c | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

Comments

Alex Bennée May 12, 2023, 9:37 a.m. UTC | #1
Richard Henderson <richard.henderson@linaro.org> writes:

> All uses replaced with TCGContext.addr_type.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
diff mbox series

Patch

diff --git a/tcg/tcg.c b/tcg/tcg.c
index 45f5ce0fa1..16dab1b6e3 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -5475,12 +5475,7 @@  static void tcg_out_ld_helper_args(TCGContext *s, const TCGLabelQemuLdst *ldst,
     next_arg = 1;
 
     loc = &info->in[next_arg];
-    if (TCG_TARGET_REG_BITS == 64 || TARGET_LONG_BITS == 64) {
-        nmov = tcg_out_helper_add_mov(mov, loc, TCG_TYPE_I64, TCG_TYPE_TL,
-                                      ldst->addrlo_reg, ldst->addrhi_reg);
-        tcg_out_helper_load_slots(s, nmov, mov, parm);
-        next_arg += nmov;
-    } else {
+    if (TCG_TARGET_REG_BITS == 32 && s->addr_type == TCG_TYPE_I32) {
         /*
          * 32-bit host with 32-bit guest: zero-extend the guest address
          * to 64-bits for the helper by storing the low part, then
@@ -5494,6 +5489,11 @@  static void tcg_out_ld_helper_args(TCGContext *s, const TCGLabelQemuLdst *ldst,
         tcg_out_helper_load_imm(s, loc[!HOST_BIG_ENDIAN].arg_slot,
                                 TCG_TYPE_I32, 0, parm);
         next_arg += 2;
+    } else {
+        nmov = tcg_out_helper_add_mov(mov, loc, TCG_TYPE_I64, s->addr_type,
+                                      ldst->addrlo_reg, ldst->addrhi_reg);
+        tcg_out_helper_load_slots(s, nmov, mov, parm);
+        next_arg += nmov;
     }
 
     switch (info->out_kind) {
@@ -5648,12 +5648,7 @@  static void tcg_out_st_helper_args(TCGContext *s, const TCGLabelQemuLdst *ldst,
 
     /* Handle addr argument. */
     loc = &info->in[next_arg];
-    if (TCG_TARGET_REG_BITS == 64 || TARGET_LONG_BITS == 64) {
-        n = tcg_out_helper_add_mov(mov, loc, TCG_TYPE_I64, TCG_TYPE_TL,
-                                   ldst->addrlo_reg, ldst->addrhi_reg);
-        next_arg += n;
-        nmov += n;
-    } else {
+    if (TCG_TARGET_REG_BITS == 32 && s->addr_type == TCG_TYPE_I32) {
         /*
          * 32-bit host with 32-bit guest: zero-extend the guest address
          * to 64-bits for the helper by storing the low part.  Later,
@@ -5665,6 +5660,11 @@  static void tcg_out_st_helper_args(TCGContext *s, const TCGLabelQemuLdst *ldst,
                                ldst->addrlo_reg, -1);
         next_arg += 2;
         nmov += 1;
+    } else {
+        n = tcg_out_helper_add_mov(mov, loc, TCG_TYPE_I64, s->addr_type,
+                                   ldst->addrlo_reg, ldst->addrhi_reg);
+        next_arg += n;
+        nmov += n;
     }
 
     /* Handle data argument. */
@@ -5710,7 +5710,8 @@  static void tcg_out_st_helper_args(TCGContext *s, const TCGLabelQemuLdst *ldst,
         g_assert_not_reached();
     }
 
-    if (TCG_TARGET_REG_BITS == 32 && TARGET_LONG_BITS == 32) {
+    if (TCG_TARGET_REG_BITS == 32 && s->addr_type == TCG_TYPE_I32) {
+        /* Zero extend the address by loading a zero for the high part. */
         loc = &info->in[1 + !HOST_BIG_ENDIAN];
         tcg_out_helper_load_imm(s, loc->arg_slot, TCG_TYPE_I32, 0, parm);
     }