qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 09/18] tcg: Remove sizemask and flags arguments to tc


From: Richard Henderson
Subject: [Qemu-devel] [PULL 09/18] tcg: Remove sizemask and flags arguments to tcg_gen_callN
Date: Tue, 27 May 2014 12:12:36 -0700

Take them from the TCGHelperInfo struct instead.

Signed-off-by: Richard Henderson <address@hidden>
---
 include/exec/helper-gen.h  | 18 ++++++------------
 include/exec/helper-head.h |  3 +--
 tcg/tcg.c                  | 17 +++++++----------
 tcg/tcg.h                  |  4 ++--
 4 files changed, 16 insertions(+), 26 deletions(-)

diff --git a/include/exec/helper-gen.h b/include/exec/helper-gen.h
index 21089aa..4d290b2 100644
--- a/include/exec/helper-gen.h
+++ b/include/exec/helper-gen.h
@@ -9,17 +9,15 @@
 #define DEF_HELPER_FLAGS_0(name, flags, ret) \
 static inline void glue(gen_helper_, name)(dh_retvar_decl0(ret)) \
 { \
-  int sizemask = dh_sizemask(ret, 0); \
-  tcg_gen_callN(&tcg_ctx, HELPER(name), flags, sizemask, dh_retvar(ret), 0, 
NULL); \
+  tcg_gen_callN(&tcg_ctx, HELPER(name), dh_retvar(ret), 0, NULL); \
 }
 
 #define DEF_HELPER_FLAGS_1(name, flags, ret, t1) \
 static inline void glue(gen_helper_, name)(dh_retvar_decl(ret) dh_arg_decl(t1, 
1)) \
 { \
   TCGArg args[1]; \
-  int sizemask = dh_sizemask(ret, 0); \
   dh_arg(t1, 1); \
-  tcg_gen_callN(&tcg_ctx, HELPER(name), flags, sizemask, dh_retvar(ret), 1, 
args); \
+  tcg_gen_callN(&tcg_ctx, HELPER(name), dh_retvar(ret), 1, args); \
 }
 
 #define DEF_HELPER_FLAGS_2(name, flags, ret, t1, t2) \
@@ -27,10 +25,9 @@ static inline void glue(gen_helper_, 
name)(dh_retvar_decl(ret) dh_arg_decl(t1, 1
     dh_arg_decl(t2, 2)) \
 { \
   TCGArg args[2]; \
-  int sizemask = dh_sizemask(ret, 0); \
   dh_arg(t1, 1); \
   dh_arg(t2, 2); \
-  tcg_gen_callN(&tcg_ctx, HELPER(name), flags, sizemask, dh_retvar(ret), 2, 
args); \
+  tcg_gen_callN(&tcg_ctx, HELPER(name), dh_retvar(ret), 2, args); \
 }
 
 #define DEF_HELPER_FLAGS_3(name, flags, ret, t1, t2, t3) \
@@ -38,11 +35,10 @@ static inline void glue(gen_helper_, 
name)(dh_retvar_decl(ret) dh_arg_decl(t1, 1
     dh_arg_decl(t2, 2), dh_arg_decl(t3, 3)) \
 { \
   TCGArg args[3]; \
-  int sizemask = dh_sizemask(ret, 0); \
   dh_arg(t1, 1); \
   dh_arg(t2, 2); \
   dh_arg(t3, 3); \
-  tcg_gen_callN(&tcg_ctx, HELPER(name), flags, sizemask, dh_retvar(ret), 3, 
args); \
+  tcg_gen_callN(&tcg_ctx, HELPER(name), dh_retvar(ret), 3, args); \
 }
 
 #define DEF_HELPER_FLAGS_4(name, flags, ret, t1, t2, t3, t4) \
@@ -50,12 +46,11 @@ static inline void glue(gen_helper_, 
name)(dh_retvar_decl(ret) dh_arg_decl(t1, 1
     dh_arg_decl(t2, 2), dh_arg_decl(t3, 3), dh_arg_decl(t4, 4)) \
 { \
   TCGArg args[4]; \
-  int sizemask = dh_sizemask(ret, 0); \
   dh_arg(t1, 1); \
   dh_arg(t2, 2); \
   dh_arg(t3, 3); \
   dh_arg(t4, 4); \
-  tcg_gen_callN(&tcg_ctx, HELPER(name), flags, sizemask, dh_retvar(ret), 4, 
args); \
+  tcg_gen_callN(&tcg_ctx, HELPER(name), dh_retvar(ret), 4, args); \
 }
 
 #define DEF_HELPER_FLAGS_5(name, flags, ret, t1, t2, t3, t4, t5) \
@@ -64,13 +59,12 @@ static inline void glue(gen_helper_, 
name)(dh_retvar_decl(ret) \
     dh_arg_decl(t4, 4), dh_arg_decl(t5, 5)) \
 { \
   TCGArg args[5]; \
-  int sizemask = dh_sizemask(ret, 0); \
   dh_arg(t1, 1); \
   dh_arg(t2, 2); \
   dh_arg(t3, 3); \
   dh_arg(t4, 4); \
   dh_arg(t5, 5); \
-  tcg_gen_callN(&tcg_ctx, HELPER(name), flags, sizemask, dh_retvar(ret), 5, 
args); \
+  tcg_gen_callN(&tcg_ctx, HELPER(name), dh_retvar(ret), 5, args); \
 }
 
 #include "helper.h"
diff --git a/include/exec/helper-head.h b/include/exec/helper-head.h
index 253e4d5..4c541ab 100644
--- a/include/exec/helper-head.h
+++ b/include/exec/helper-head.h
@@ -112,8 +112,7 @@
   ((dh_is_64bit(t) << (n*2)) | (dh_is_signed(t) << (n*2+1)))
 
 #define dh_arg(t, n) \
-  args[n - 1] = glue(GET_TCGV_, dh_alias(t))(glue(arg, n)); \
-  sizemask |= dh_sizemask(t, n)
+  (args[n - 1] = glue(GET_TCGV_, dh_alias(t))(glue(arg, n)))
 
 #define dh_arg_decl(t, n) glue(TCGv_, dh_alias(t)) glue(arg, n)
 
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 004f4bf..219c995 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -691,18 +691,17 @@ int tcg_check_temp_count(void)
 /* Note: we convert the 64 bit args to 32 bit and do some alignment
    and endian swap. Maybe it would be better to do the alignment
    and endian swap in tcg_reg_alloc_call(). */
-void tcg_gen_callN(TCGContext *s, void *func, unsigned int flags,
-                   int sizemask, TCGArg ret, int nargs, TCGArg *args)
+void tcg_gen_callN(TCGContext *s, void *func, TCGArg ret,
+                   int nargs, TCGArg *args)
 {
-    int i;
-    int real_args;
-    int nb_rets;
+    int i, real_args, nb_rets;
+    unsigned sizemask, flags;
     TCGArg *nparam;
     TCGHelperInfo *info;
 
     info = g_hash_table_lookup(s->helpers, (gpointer)func);
-    assert(info != NULL);
-    assert(info->sizemask == sizemask);
+    flags = info->flags;
+    sizemask = info->sizemask;
 
 #if defined(__sparc__) && !defined(__arch64__) \
     && !defined(CONFIG_TCG_INTERPRETER)
@@ -788,9 +787,8 @@ void tcg_gen_callN(TCGContext *s, void *func, unsigned int 
flags,
     }
     real_args = 0;
     for (i = 0; i < nargs; i++) {
-#if TCG_TARGET_REG_BITS < 64
         int is_64bit = sizemask & (1 << (i+1)*2);
-        if (is_64bit) {
+        if (TCG_TARGET_REG_BITS < 64 && is_64bit) {
 #ifdef TCG_TARGET_CALL_ALIGN_ARGS
             /* some targets want aligned 64 bit args */
             if (real_args & 1) {
@@ -818,7 +816,6 @@ void tcg_gen_callN(TCGContext *s, void *func, unsigned int 
flags,
             real_args += 2;
             continue;
         }
-#endif /* TCG_TARGET_REG_BITS < 64 */
 
         *s->gen_opparam_ptr++ = args[i];
         real_args++;
diff --git a/tcg/tcg.h b/tcg/tcg.h
index 7e7d591..2efa333 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -723,8 +723,8 @@ void tcg_add_target_add_op_defs(const TCGTargetOpDef 
*tdefs);
 #define tcg_temp_free_ptr(T) tcg_temp_free_i64(TCGV_PTR_TO_NAT(T))
 #endif
 
-void tcg_gen_callN(TCGContext *s, void *func, unsigned int flags,
-                   int sizemask, TCGArg ret, int nargs, TCGArg *args);
+void tcg_gen_callN(TCGContext *s, void *func,
+                   TCGArg ret, int nargs, TCGArg *args);
 
 void tcg_gen_shifti_i64(TCGv_i64 ret, TCGv_i64 arg1,
                         int c, int right, int arith);
-- 
1.9.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]