TCG: add tcg_const_local_tl()
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>
Tue, 21 Oct 2008 11:30:45 +0000 (11:30 +0000)
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>
Tue, 21 Oct 2008 11:30:45 +0000 (11:30 +0000)
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5504 c046a42c-6fe2-441c-8c8c-71466251a162

tcg/tcg-op.h
tcg/tcg.c
tcg/tcg.h

index 8ddaf0b40ee858611a5a032bb0ca0fe23f1e47ea..18be6412d872d22d90c30f9772dcc743878ab4aa 100644 (file)
@@ -1774,6 +1774,7 @@ static inline void tcg_gen_qemu_st64(TCGv arg, TCGv addr, int mem_index)
 #define tcg_gen_nor_tl tcg_gen_nor_i64
 #define tcg_gen_orc_tl tcg_gen_orc_i64
 #define tcg_const_tl tcg_const_i64
+#define tcg_const_local_tl tcg_const_local_i64
 #else
 #define TCG_TYPE_TL TCG_TYPE_I32
 #define tcg_gen_movi_tl tcg_gen_movi_i32
@@ -1831,6 +1832,7 @@ static inline void tcg_gen_qemu_st64(TCGv arg, TCGv addr, int mem_index)
 #define tcg_gen_nor_tl tcg_gen_nor_i32
 #define tcg_gen_orc_tl tcg_gen_orc_i32
 #define tcg_const_tl tcg_const_i32
+#define tcg_const_local_tl tcg_const_local_i32
 #endif
 
 #if TCG_TARGET_REG_BITS == 32
index 1b7bf5ca3b8c68879e586a1fe1ae98ef5d6baa01..9d090f70daab6a08bca7f7e144f0400109c047e7 100644 (file)
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -475,6 +475,22 @@ TCGv tcg_const_i64(int64_t val)
     return t0;
 }
 
+TCGv tcg_const_local_i32(int32_t val)
+{
+    TCGv t0;
+    t0 = tcg_temp_local_new(TCG_TYPE_I32);
+    tcg_gen_movi_i32(t0, val);
+    return t0;
+}
+
+TCGv tcg_const_local_i64(int64_t val)
+{
+    TCGv t0;
+    t0 = tcg_temp_local_new(TCG_TYPE_I64);
+    tcg_gen_movi_i64(t0, val);
+    return t0;
+}
+
 void tcg_register_helper(void *func, const char *name)
 {
     TCGContext *s = &tcg_ctx;
index bc5b90269930d489b4f74a6aec430dce368c57d9..1471ca34ac0458419cd21d9b369e692931af0228 100644 (file)
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -385,6 +385,8 @@ void tcg_dump_ops(TCGContext *s, FILE *outfile);
 void dump_ops(const uint16_t *opc_buf, const TCGArg *opparam_buf);
 TCGv tcg_const_i32(int32_t val);
 TCGv tcg_const_i64(int64_t val);
+TCGv tcg_const_local_i32(int32_t val);
+TCGv tcg_const_local_i64(int64_t val);
 
 #if TCG_TARGET_REG_BITS == 32
 #define tcg_const_ptr tcg_const_i32