]> git.proxmox.com Git - mirror_qemu.git/commitdiff
tcg: Remove sizemask and flags arguments to tcg_gen_callN
authorRichard Henderson <rth@twiddle.net>
Tue, 8 Apr 2014 15:39:43 +0000 (08:39 -0700)
committerRichard Henderson <rth@twiddle.net>
Wed, 28 May 2014 16:33:55 +0000 (09:33 -0700)
Take them from the TCGHelperInfo struct instead.

Signed-off-by: Richard Henderson <rth@twiddle.net>
include/exec/helper-gen.h
include/exec/helper-head.h
tcg/tcg.c
tcg/tcg.h

index 21089aa9fa67c6dea58a13299ae6b3865ce8af1f..4d290b21b3f6cbedaf67b752f44d1c7055a0a60d 100644 (file)
@@ -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"
index 253e4d53fde56d38a875994470c0e5d20d010280..4c541abbcc51fbe5cfc8ff2f1582ee832980b814 100644 (file)
   ((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)
 
index 004f4bf8a5f5c610ceb2cb0adf5e0af4ecfb2c2e..219c995272880cc0ec5de3c33b967cd6e62f57e7 100644 (file)
--- 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++;
index 7e7d5910e89338177765e0b6449368e8df513033..2efa3331660c2ae6f6bfede1e95c11c2f3a0a2d7 100644 (file)
--- 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);