qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: qemu-devel@nongnu.org
Cc: aurelien@aurel32.net
Subject: [Qemu-devel] [PATCH 09/10] tcg: Remove sizemask and flags arguments to tcg_gen_callN
Date: Mon, 12 May 2014 16:47:03 -0700	[thread overview]
Message-ID: <1399938424-6703-10-git-send-email-rth@twiddle.net> (raw)
In-Reply-To: <1399938424-6703-1-git-send-email-rth@twiddle.net>

Take them from the TCGHelperInfo struct instead.

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 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 d71a9bf..04280ef 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.0

  parent reply	other threads:[~2014-05-12 23:48 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-12 23:46 [Qemu-devel] [PATCH 00/10] tcg cleanup and optimization Richard Henderson
2014-05-12 23:46 ` [Qemu-devel] [PATCH 01/10] tcg: Optimize brcond2 and setcond2 ne/eq Richard Henderson
2014-05-12 23:46 ` [Qemu-devel] [PATCH 02/10] tcg: Invert the inclusion of helper.h Richard Henderson
2014-05-13  9:10   ` Alex Bennée
2014-05-12 23:46 ` [Qemu-devel] [PATCH 03/10] tcg: Push tcg-runtime routines into exec/helper-* Richard Henderson
2014-05-13  9:20   ` Alex Bennée
2014-05-13 13:39     ` Richard Henderson
2014-05-12 23:46 ` [Qemu-devel] [PATCH 04/10] tcg: Use helper-gen.h in tcg-op.h Richard Henderson
2014-05-13  9:34   ` Alex Bennée
2014-05-13 13:44     ` Richard Henderson
2014-05-12 23:46 ` [Qemu-devel] [PATCH 05/10] tcg: Inline tcg_gen_helperN Richard Henderson
2014-05-13  9:34   ` Alex Bennée
2014-05-12 23:47 ` [Qemu-devel] [PATCH 06/10] tcg: Move side effects out of dh_sizemask Richard Henderson
2014-05-12 23:47 ` [Qemu-devel] [PATCH 07/10] tcg: Register the helper info struct rather than the name Richard Henderson
2014-05-13  9:36   ` Alex Bennée
2014-05-12 23:47 ` [Qemu-devel] [PATCH 08/10] tcg: Save flags and computed sizemask in TCGHelperInfo Richard Henderson
2014-05-13  9:38   ` Alex Bennée
2014-05-13 13:54     ` Richard Henderson
2014-05-12 23:47 ` Richard Henderson [this message]
2014-05-12 23:47 ` [Qemu-devel] [PATCH 10/10] tcg: Move size effects out of dh_arg Richard Henderson
2014-05-13  9:42   ` Alex Bennée

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1399938424-6703-10-git-send-email-rth@twiddle.net \
    --to=rth@twiddle.net \
    --cc=aurelien@aurel32.net \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).