qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 3/4] tcg: Move tcg_target_get_call_iarg_regs_cou


From: Stefan Weil
Subject: Re: [Qemu-devel] [PATCH 3/4] tcg: Move tcg_target_get_call_iarg_regs_count to tcg.c
Date: Thu, 13 Sep 2012 07:31:53 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120827 Thunderbird/15.0

Am 12.09.2012 22:59, schrieb Aurelien Jarno:
On Wed, Sep 12, 2012 at 10:44:37PM +0200, Stefan Weil wrote:
The TCG targets no longer need individual implementations.

Signed-off-by: Stefan Weil <address@hidden>
---
  tcg/arm/tcg-target.c   |    6 ------
  tcg/hppa/tcg-target.c  |    6 ------
  tcg/i386/tcg-target.c  |    6 ------
  tcg/ia64/tcg-target.c  |    6 ------
  tcg/mips/tcg-target.c  |    6 ------
  tcg/ppc/tcg-target.c   |    6 ------
  tcg/ppc64/tcg-target.c |    6 ------
  tcg/s390/tcg-target.c  |    5 -----
  tcg/sparc/tcg-target.c |    6 ------
  tcg/tcg.c              |    7 ++++++-
  tcg/tci/tcg-target.c   |    6 ------
  11 files changed, 6 insertions(+), 60 deletions(-)



[...]

diff --git a/tcg/tcg.c b/tcg/tcg.c
index a4e7f42..53316f6 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -89,7 +89,6 @@ static void tcg_out_st(TCGContext *s, TCGType type, TCGReg 
arg, TCGReg arg1,
                         tcg_target_long arg2);
  static int tcg_target_const_match(tcg_target_long val,
                                    const TCGArgConstraint *arg_ct);
-static int tcg_target_get_call_iarg_regs_count(int flags);
TCGOpDef tcg_op_defs[] = {
  #define DEF(s, oargs, iargs, cargs, flags) { #s, oargs, iargs, cargs, iargs + 
oargs + cargs, flags },
@@ -182,6 +181,12 @@ int gen_new_label(void)
#include "tcg-target.c" +/* Maximum number of register used for input function arguments. */
+static inline int tcg_target_get_call_iarg_regs_count(int flags)
+{
+    return ARRAY_SIZE(tcg_target_call_iarg_regs);
+}
+
Do we really need a function for that, given that it has only one
caller?

For me ARRAY_SIZE(tcg_target_call_iarg_regs) is even more understandable
than tcg_target_get_call_iarg_regs_count().


I agree. tcg_target_get_call_iarg_regs_count can be removed
completely, but only if we find a solution for the problem
which Peter Maydell found: some code accesses
tcg_target_call_iarg_regs unconditionally even for x86 32 bit,
so for the moment, we cannot reduce its size to 0.

Stefan




reply via email to

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