qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: qemu-devel@nongnu.org
Cc: mark.cave-ayland@ilande.co.uk, aurelien@aurel32.net
Subject: [Qemu-devel] [PATCH v2 04/14] tcg: More use of TCGReg where appropriate
Date: Thu, 17 Dec 2015 12:00:15 -0800	[thread overview]
Message-ID: <1450382415-5699-1-git-send-email-rth@twiddle.net> (raw)
In-Reply-To: <1450382320-5383-1-git-send-email-rth@twiddle.net>

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 tcg/tcg.c | 26 +++++++++++++++-----------
 tcg/tcg.h |  8 ++++----
 2 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/tcg/tcg.c b/tcg/tcg.c
index 0a6edfb..06d71d7 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -451,7 +451,7 @@ static inline TCGTemp *tcg_global_alloc(TCGContext *s)
 }
 
 static int tcg_global_reg_new_internal(TCGContext *s, TCGType type,
-                                       int reg, const char *name)
+                                       TCGReg reg, const char *name)
 {
     TCGTemp *ts;
 
@@ -470,7 +470,7 @@ static int tcg_global_reg_new_internal(TCGContext *s, TCGType type,
     return temp_idx(s, ts);
 }
 
-void tcg_set_frame(TCGContext *s, int reg, intptr_t start, intptr_t size)
+void tcg_set_frame(TCGContext *s, TCGReg reg, intptr_t start, intptr_t size)
 {
     int idx;
     s->frame_start = start;
@@ -479,7 +479,7 @@ void tcg_set_frame(TCGContext *s, int reg, intptr_t start, intptr_t size)
     s->frame_temp = &s->temps[idx];
 }
 
-TCGv_i32 tcg_global_reg_new_i32(int reg, const char *name)
+TCGv_i32 tcg_global_reg_new_i32(TCGReg reg, const char *name)
 {
     TCGContext *s = &tcg_ctx;
     int idx;
@@ -491,7 +491,7 @@ TCGv_i32 tcg_global_reg_new_i32(int reg, const char *name)
     return MAKE_TCGV_I32(idx);
 }
 
-TCGv_i64 tcg_global_reg_new_i64(int reg, const char *name)
+TCGv_i64 tcg_global_reg_new_i64(TCGReg reg, const char *name)
 {
     TCGContext *s = &tcg_ctx;
     int idx;
@@ -1613,7 +1613,8 @@ static void dump_regs(TCGContext *s)
 
 static void check_regs(TCGContext *s)
 {
-    int reg, k;
+    TCGReg reg;
+    int k;
     TCGTemp *ts;
     char buf[64];
 
@@ -1666,7 +1667,7 @@ static void temp_allocate_frame(TCGContext *s, int temp)
 }
 
 /* sync register 'reg' by saving it to the corresponding temporary */
-static inline void tcg_reg_sync(TCGContext *s, int reg)
+static inline void tcg_reg_sync(TCGContext *s, TCGReg reg)
 {
     TCGTemp *ts;
     int temp;
@@ -1684,7 +1685,7 @@ static inline void tcg_reg_sync(TCGContext *s, int reg)
 }
 
 /* free register 'reg' by spilling the corresponding temporary if necessary */
-static void tcg_reg_free(TCGContext *s, int reg)
+static void tcg_reg_free(TCGContext *s, TCGReg reg)
 {
     int temp;
 
@@ -1697,9 +1698,10 @@ static void tcg_reg_free(TCGContext *s, int reg)
 }
 
 /* Allocate a register belonging to reg1 & ~reg2 */
-static int tcg_reg_alloc(TCGContext *s, TCGRegSet reg1, TCGRegSet reg2)
+static TCGReg tcg_reg_alloc(TCGContext *s, TCGRegSet reg1, TCGRegSet reg2)
 {
-    int i, reg;
+    int i;
+    TCGReg reg;
     TCGRegSet reg_ct;
 
     tcg_regset_andnot(reg_ct, reg1, reg2);
@@ -1964,7 +1966,8 @@ static void tcg_reg_alloc_op(TCGContext *s,
                              uint8_t sync_args)
 {
     TCGRegSet allocated_regs;
-    int i, k, nb_iargs, nb_oargs, reg;
+    int i, k, nb_iargs, nb_oargs;
+    TCGReg reg;
     TCGArg arg;
     const TCGArgConstraint *arg_ct;
     TCGTemp *ts;
@@ -2140,7 +2143,8 @@ static void tcg_reg_alloc_call(TCGContext *s, int nb_oargs, int nb_iargs,
                                const TCGArg * const args, uint16_t dead_args,
                                uint8_t sync_args)
 {
-    int flags, nb_regs, i, reg;
+    int flags, nb_regs, i;
+    TCGReg reg;
     TCGArg arg;
     TCGTemp *ts;
     intptr_t stack_offset;
diff --git a/tcg/tcg.h b/tcg/tcg.h
index 8b7efed..3674739 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -448,7 +448,7 @@ typedef enum TCGTempVal {
 } TCGTempVal;
 
 typedef struct TCGTemp {
-    unsigned int reg:8;
+    TCGReg reg:8;
     TCGTempVal val_type:8;
     TCGType base_type:8;
     TCGType type:8;
@@ -628,12 +628,12 @@ void tcg_func_start(TCGContext *s);
 
 int tcg_gen_code(TCGContext *s, tcg_insn_unit *gen_code_buf);
 
-void tcg_set_frame(TCGContext *s, int reg, intptr_t start, intptr_t size);
+void tcg_set_frame(TCGContext *s, TCGReg reg, intptr_t start, intptr_t size);
 
 int tcg_global_mem_new_internal(TCGType, TCGv_ptr, intptr_t, const char *);
 
-TCGv_i32 tcg_global_reg_new_i32(int reg, const char *name);
-TCGv_i64 tcg_global_reg_new_i64(int reg, const char *name);
+TCGv_i32 tcg_global_reg_new_i32(TCGReg reg, const char *name);
+TCGv_i64 tcg_global_reg_new_i64(TCGReg reg, const char *name);
 
 TCGv_i32 tcg_temp_new_internal_i32(int temp_local);
 TCGv_i64 tcg_temp_new_internal_i64(int temp_local);
-- 
2.5.0

  parent reply	other threads:[~2015-12-17 20:00 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-17 19:58 [Qemu-devel] [PATCH v2 00/14] tcg: Improve sparc register windows Richard Henderson
2015-12-17 20:00 ` [Qemu-devel] [PATCH v2 02/14] tcg: Change ts->mem_reg to ts->mem_base Richard Henderson
2015-12-31 10:52   ` Aurelien Jarno
2015-12-17 20:00 ` [Qemu-devel] [PATCH v2 03/14] tcg: Tidy temporary allocation Richard Henderson
2015-12-31 11:13   ` Aurelien Jarno
2015-12-17 20:00 ` Richard Henderson [this message]
2015-12-31 11:14   ` [Qemu-devel] [PATCH v2 04/14] tcg: More use of TCGReg where appropriate Aurelien Jarno
2015-12-17 20:00 ` [Qemu-devel] [PATCH v2 05/14] tcg: Remove tcg_get_arg_str_i32/64 Richard Henderson
2015-12-31 11:15   ` Aurelien Jarno
2015-12-17 20:00 ` [Qemu-devel] [PATCH v2 06/14] tcg: Change reg_to_temp to TCGTemp pointer Richard Henderson
2015-12-31 11:19   ` Aurelien Jarno
2015-12-17 20:00 ` [Qemu-devel] [PATCH v2 07/14] tcg: Change temp_dead argument to TCGTemp Richard Henderson
2015-12-31 11:24   ` Aurelien Jarno
2015-12-17 20:00 ` [Qemu-devel] [PATCH v2 08/14] tcg: Change temp_sync " Richard Henderson
2015-12-31 11:24   ` Aurelien Jarno
2015-12-17 20:00 ` [Qemu-devel] [PATCH v2 09/14] tcg: Change temp_save " Richard Henderson
2015-12-31 11:24   ` Aurelien Jarno
2015-12-17 20:00 ` [Qemu-devel] [PATCH v2 10/14] tcg: Introduce temp_load Richard Henderson
2015-12-31 11:33   ` Aurelien Jarno
2016-01-15 22:08     ` Richard Henderson
2015-12-17 20:00 ` [Qemu-devel] [PATCH v2 11/14] tcg: Implement indirect memory registers Richard Henderson
2015-12-31 11:54   ` Aurelien Jarno
2016-01-15 22:31     ` Richard Henderson
2015-12-17 20:00 ` [Qemu-devel] [PATCH v2 12/14] tcg: Allocate indirect_base temporaries in a different order Richard Henderson
2015-12-17 20:00 ` [Qemu-devel] [PATCH v2 13/14] target-sparc: Tidy global register initialization Richard Henderson
2015-12-17 20:00 ` [Qemu-devel] [PATCH v2 14/14] target-sparc: Use global registers for the register window Richard Henderson

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=1450382415-5699-1-git-send-email-rth@twiddle.net \
    --to=rth@twiddle.net \
    --cc=aurelien@aurel32.net \
    --cc=mark.cave-ayland@ilande.co.uk \
    --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).