qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v6 21/50] tcg: Use pointers in TCGOp->args


From: Richard Henderson
Subject: [Qemu-devel] [PATCH v6 21/50] tcg: Use pointers in TCGOp->args
Date: Mon, 16 Oct 2017 10:25:40 -0700

This limits the indexing into tcg_ctx.temps to initial
opcode generation time.

Signed-off-by: Richard Henderson <address@hidden>
---
 tcg/tcg.h | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

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)
-- 
2.13.6




reply via email to

[Prev in Thread] Current Thread [Next in Thread]