summaryrefslogtreecommitdiffstats
path: root/tcg
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2013-09-18 14:54:45 -0700
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:34:37 -0600
commit2dc926352397a900dcfa32f86f1afae7ed8e62ca (patch)
tree11dd4f7d186031c86336885c13148ce2729ce7ce /tcg
parentfe280e401595337a6350f4d3cd453efd21c9c3f1 (diff)
downloadhqemu-2dc926352397a900dcfa32f86f1afae7ed8e62ca.zip
hqemu-2dc926352397a900dcfa32f86f1afae7ed8e62ca.tar.gz
tcg: More use of TCGReg where appropriate
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'tcg')
-rw-r--r--tcg/tcg.c26
-rw-r--r--tcg/tcg.h8
2 files changed, 19 insertions, 15 deletions
diff --git a/tcg/tcg.c b/tcg/tcg.c
index e2d00ba..1fa3958 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -453,7 +453,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;
@@ -472,7 +472,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;
@@ -481,7 +481,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;
@@ -493,7 +493,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;
@@ -1808,7 +1808,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];
@@ -1861,7 +1862,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;
@@ -1879,7 +1880,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;
@@ -1892,9 +1893,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);
@@ -2159,7 +2161,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;
@@ -2335,7 +2338,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 14dda1e..05ceaec 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -449,7 +449,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;
@@ -650,12 +650,12 @@ void tcg_func_start(TCGContext *s, TranslationBlock *tb);
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);
OpenPOWER on IntegriCloud