diff mbox series

[v6,21/50] tcg: Use pointers in TCGOp->args

Message ID 20171016172609.23422-22-richard.henderson@linaro.org
State New
Headers show
Series tcg tb_lock removal | expand

Commit Message

Richard Henderson Oct. 16, 2017, 5:25 p.m. UTC
This limits the indexing into tcg_ctx.temps to initial
opcode generation time.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 tcg/tcg.h | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

-- 
2.13.6

Comments

Emilio Cota Oct. 18, 2017, 4:13 a.m. UTC | #1
On Mon, Oct 16, 2017 at 10:25:40 -0700, Richard Henderson wrote:
> This limits the indexing into tcg_ctx.temps to initial

> opcode generation time.

> 

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


Reviewed-by: Emilio G. Cota <cota@braap.org>


		E.
diff mbox series

Patch

diff --git a/tcg/tcg.h b/tcg/tcg.h
index ccf1bcdaf6..d5bf61b1cf 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -741,24 +741,29 @@  static inline size_t temp_idx(TCGTemp *ts)
     return n;
 }
 
+static inline TCGTemp *idx_temp(size_t n)
+{
+    return n == TCG_CALL_DUMMY_ARG ? NULL : &tcg_ctx.temps[n];
+}
+
 static inline TCGArg temp_arg(TCGTemp *ts)
 {
-    return temp_idx(ts);
+    return (uintptr_t)ts;
 }
 
 static inline TCGTemp *arg_temp(TCGArg a)
 {
-    return a == TCG_CALL_DUMMY_ARG ? NULL : &tcg_ctx.temps[a];
+    return (TCGTemp *)a;
 }
 
 static inline size_t arg_index(TCGArg a)
 {
-    return a;
+    return temp_idx(arg_temp(a));
 }
 
 static inline TCGArg index_arg(size_t n)
 {
-    return n;
+    return temp_arg(idx_temp(n));
 }
 
 static inline TCGArg tcgv_i32_arg(TCGv_i32 t)