[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v6 08/50] tcg: Introduce temp_arg
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH v6 08/50] tcg: Introduce temp_arg |
Date: |
Mon, 16 Oct 2017 10:25:27 -0700 |
From: Richard Henderson <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
---
tcg/tcg.h | 7 +++++++
tcg/tcg.c | 4 ++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/tcg/tcg.h b/tcg/tcg.h
index 5fcdec1fc5..1e456d8e5a 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -729,6 +729,13 @@ struct TCGContext {
extern TCGContext tcg_ctx;
extern bool parallel_cpus;
+static inline TCGArg temp_arg(TCGTemp *ts)
+{
+ ptrdiff_t n = ts - tcg_ctx.temps;
+ tcg_debug_assert(n >= 0 && n < tcg_ctx.nb_temps);
+ return n;
+}
+
static inline TCGTemp *arg_temp(TCGArg a)
{
return a == TCG_CALL_DUMMY_ARG ? NULL : &tcg_ctx.temps[a];
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 915e041bea..31279ab3bb 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -1941,7 +1941,7 @@ static bool liveness_pass_2(TCGContext *s, uint8_t
*temp_state)
TCGOp *lop = tcg_op_insert_before(s, op, lopc, 3);
lop->args[0] = dir;
- lop->args[1] = temp_idx(s, its->mem_base);
+ lop->args[1] = temp_arg(its->mem_base);
lop->args[2] = its->mem_offset;
/* Loaded, but synced with memory. */
@@ -2012,7 +2012,7 @@ static bool liveness_pass_2(TCGContext *s, uint8_t
*temp_state)
TCGOp *sop = tcg_op_insert_after(s, op, sopc, 3);
sop->args[0] = dir;
- sop->args[1] = temp_idx(s, its->mem_base);
+ sop->args[1] = temp_arg(its->mem_base);
sop->args[2] = its->mem_offset;
temp_state[arg] = TS_MEM;
--
2.13.6
- Re: [Qemu-devel] [PATCH v6 03/50] tcg: Propagate args to op->args in tcg.c, (continued)
- [Qemu-devel] [PATCH v6 02/50] tcg: Propagate args to op->args in optimizer, Richard Henderson, 2017/10/16
- [Qemu-devel] [PATCH v6 05/50] tcg: Introduce arg_temp, Richard Henderson, 2017/10/16
- [Qemu-devel] [PATCH v6 06/50] tcg: Add temp_global bit to TCGTemp, Richard Henderson, 2017/10/16
- [Qemu-devel] [PATCH v6 07/50] tcg: Return NULL temp for TCG_CALL_DUMMY_ARG, Richard Henderson, 2017/10/16
- [Qemu-devel] [PATCH v6 08/50] tcg: Introduce temp_arg,
Richard Henderson <=
- [Qemu-devel] [PATCH v6 10/50] tcg: Avoid loops against variable bounds, Richard Henderson, 2017/10/16
- [Qemu-devel] [PATCH v6 11/50] tcg: Change temp_allocate_frame arg to TCGTemp, Richard Henderson, 2017/10/16
- [Qemu-devel] [PATCH v6 12/50] tcg: Remove unused TCG_CALL_DUMMY_TCGV, Richard Henderson, 2017/10/16
- [Qemu-devel] [PATCH v6 09/50] tcg: Use per-temp state data in liveness, Richard Henderson, 2017/10/16