[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 10/12] tcg: Change temp_sync argument to TCGTemp
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PULL 10/12] tcg: Change temp_sync argument to TCGTemp |
Date: |
Sat, 6 Feb 2016 11:09:28 +1100 |
Reviewed-by: Aurelien Jarno <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
---
tcg/tcg.c | 55 ++++++++++++++++++++++++++++---------------------------
1 file changed, 28 insertions(+), 27 deletions(-)
diff --git a/tcg/tcg.c b/tcg/tcg.c
index bd3707b..ee3e9dd 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -1722,29 +1722,28 @@ static inline void temp_dead(TCGContext *s, TCGTemp *ts)
/* sync a temporary to memory. 'allocated_regs' is used in case a
temporary registers needs to be allocated to store a constant. */
-static inline void temp_sync(TCGContext *s, int temp, TCGRegSet allocated_regs)
+static void temp_sync(TCGContext *s, TCGTemp *ts, TCGRegSet allocated_regs)
{
- TCGTemp *ts = &s->temps[temp];
-
- if (!ts->fixed_reg) {
- switch(ts->val_type) {
- case TEMP_VAL_CONST:
- ts->reg = tcg_reg_alloc(s, tcg_target_available_regs[ts->type],
- allocated_regs);
- ts->val_type = TEMP_VAL_REG;
- s->reg_to_temp[ts->reg] = ts;
- ts->mem_coherent = 0;
- tcg_out_movi(s, ts->type, ts->reg, ts->val);
- /* fallthrough*/
- case TEMP_VAL_REG:
- tcg_reg_sync(s, ts->reg);
- break;
- case TEMP_VAL_DEAD:
- case TEMP_VAL_MEM:
- break;
- default:
- tcg_abort();
- }
+ if (ts->fixed_reg) {
+ return;
+ }
+ switch (ts->val_type) {
+ case TEMP_VAL_CONST:
+ ts->reg = tcg_reg_alloc(s, tcg_target_available_regs[ts->type],
+ allocated_regs);
+ ts->val_type = TEMP_VAL_REG;
+ s->reg_to_temp[ts->reg] = ts;
+ ts->mem_coherent = 0;
+ tcg_out_movi(s, ts->type, ts->reg, ts->val);
+ /* fallthrough*/
+ case TEMP_VAL_REG:
+ tcg_reg_sync(s, ts->reg);
+ break;
+ case TEMP_VAL_DEAD:
+ case TEMP_VAL_MEM:
+ break;
+ default:
+ tcg_abort();
}
}
@@ -1759,7 +1758,7 @@ static inline void temp_save(TCGContext *s, int temp,
TCGRegSet allocated_regs)
in memory. Keep an assert for safety. */
tcg_debug_assert(ts->val_type == TEMP_VAL_MEM || ts->fixed_reg);
#else
- temp_sync(s, temp, allocated_regs);
+ temp_sync(s, ts, allocated_regs);
temp_dead(s, ts);
#endif
}
@@ -1784,11 +1783,13 @@ static void sync_globals(TCGContext *s, TCGRegSet
allocated_regs)
int i;
for (i = 0; i < s->nb_globals; i++) {
+ TCGTemp *ts = &s->temps[i];
#ifdef USE_LIVENESS_ANALYSIS
- assert(s->temps[i].val_type != TEMP_VAL_REG || s->temps[i].fixed_reg ||
- s->temps[i].mem_coherent);
+ tcg_debug_assert(ts->val_type != TEMP_VAL_REG
+ || ts->fixed_reg
+ || ts->mem_coherent);
#else
- temp_sync(s, i, allocated_regs);
+ temp_sync(s, ts, allocated_regs);
#endif
}
}
@@ -1843,7 +1844,7 @@ static void tcg_reg_alloc_movi(TCGContext *s, const
TCGArg *args,
ots->val = val;
}
if (NEED_SYNC_ARG(0)) {
- temp_sync(s, args[0], s->reserved_regs);
+ temp_sync(s, ots, s->reserved_regs);
}
if (IS_DEAD_ARG(0)) {
temp_dead(s, ots);
--
2.5.0
- [Qemu-devel] [PULL 00/12] TCG patch queue, Richard Henderson, 2016/02/05
- [Qemu-devel] [PULL 01/12] tcg: Respect highwater in tcg_out_tb_finalize, Richard Henderson, 2016/02/05
- [Qemu-devel] [PULL 02/12] tcg: Remove lingering references to gen_opc_buf, Richard Henderson, 2016/02/05
- [Qemu-devel] [PULL 04/12] tcg: Change ts->mem_reg to ts->mem_base, Richard Henderson, 2016/02/05
- [Qemu-devel] [PULL 03/12] tcg: Change tcg_global_mem_new_* to take a TCGv_ptr, Richard Henderson, 2016/02/05
- [Qemu-devel] [PULL 07/12] tcg: Remove tcg_get_arg_str_i32/64, Richard Henderson, 2016/02/05
- [Qemu-devel] [PULL 06/12] tcg: More use of TCGReg where appropriate, Richard Henderson, 2016/02/05
- [Qemu-devel] [PULL 08/12] tcg: Change reg_to_temp to TCGTemp pointer, Richard Henderson, 2016/02/05
- [Qemu-devel] [PULL 05/12] tcg: Tidy temporary allocation, Richard Henderson, 2016/02/05
- [Qemu-devel] [PULL 09/12] tcg: Change temp_dead argument to TCGTemp, Richard Henderson, 2016/02/05
- [Qemu-devel] [PULL 10/12] tcg: Change temp_sync argument to TCGTemp,
Richard Henderson <=
- [Qemu-devel] [PULL 12/12] tcg: Introduce temp_load, Richard Henderson, 2016/02/05
- [Qemu-devel] [PULL 11/12] tcg: Change temp_save argument to TCGTemp, Richard Henderson, 2016/02/05
- Re: [Qemu-devel] [PULL 00/12] TCG patch queue, Peter Maydell, 2016/02/08