Commit bdffd4a9d7254a765e56132587bc814195e094a2
1 parent
cf960816
TCG: add tcg_const_local_tl()
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5504 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
3 changed files
with
20 additions
and
0 deletions
tcg/tcg-op.h
| @@ -1774,6 +1774,7 @@ static inline void tcg_gen_qemu_st64(TCGv arg, TCGv addr, int mem_index) | @@ -1774,6 +1774,7 @@ static inline void tcg_gen_qemu_st64(TCGv arg, TCGv addr, int mem_index) | ||
| 1774 | #define tcg_gen_nor_tl tcg_gen_nor_i64 | 1774 | #define tcg_gen_nor_tl tcg_gen_nor_i64 |
| 1775 | #define tcg_gen_orc_tl tcg_gen_orc_i64 | 1775 | #define tcg_gen_orc_tl tcg_gen_orc_i64 |
| 1776 | #define tcg_const_tl tcg_const_i64 | 1776 | #define tcg_const_tl tcg_const_i64 |
| 1777 | +#define tcg_const_local_tl tcg_const_local_i64 | ||
| 1777 | #else | 1778 | #else |
| 1778 | #define TCG_TYPE_TL TCG_TYPE_I32 | 1779 | #define TCG_TYPE_TL TCG_TYPE_I32 |
| 1779 | #define tcg_gen_movi_tl tcg_gen_movi_i32 | 1780 | #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) | @@ -1831,6 +1832,7 @@ static inline void tcg_gen_qemu_st64(TCGv arg, TCGv addr, int mem_index) | ||
| 1831 | #define tcg_gen_nor_tl tcg_gen_nor_i32 | 1832 | #define tcg_gen_nor_tl tcg_gen_nor_i32 |
| 1832 | #define tcg_gen_orc_tl tcg_gen_orc_i32 | 1833 | #define tcg_gen_orc_tl tcg_gen_orc_i32 |
| 1833 | #define tcg_const_tl tcg_const_i32 | 1834 | #define tcg_const_tl tcg_const_i32 |
| 1835 | +#define tcg_const_local_tl tcg_const_local_i32 | ||
| 1834 | #endif | 1836 | #endif |
| 1835 | 1837 | ||
| 1836 | #if TCG_TARGET_REG_BITS == 32 | 1838 | #if TCG_TARGET_REG_BITS == 32 |
tcg/tcg.c
| @@ -475,6 +475,22 @@ TCGv tcg_const_i64(int64_t val) | @@ -475,6 +475,22 @@ TCGv tcg_const_i64(int64_t val) | ||
| 475 | return t0; | 475 | return t0; |
| 476 | } | 476 | } |
| 477 | 477 | ||
| 478 | +TCGv tcg_const_local_i32(int32_t val) | ||
| 479 | +{ | ||
| 480 | + TCGv t0; | ||
| 481 | + t0 = tcg_temp_local_new(TCG_TYPE_I32); | ||
| 482 | + tcg_gen_movi_i32(t0, val); | ||
| 483 | + return t0; | ||
| 484 | +} | ||
| 485 | + | ||
| 486 | +TCGv tcg_const_local_i64(int64_t val) | ||
| 487 | +{ | ||
| 488 | + TCGv t0; | ||
| 489 | + t0 = tcg_temp_local_new(TCG_TYPE_I64); | ||
| 490 | + tcg_gen_movi_i64(t0, val); | ||
| 491 | + return t0; | ||
| 492 | +} | ||
| 493 | + | ||
| 478 | void tcg_register_helper(void *func, const char *name) | 494 | void tcg_register_helper(void *func, const char *name) |
| 479 | { | 495 | { |
| 480 | TCGContext *s = &tcg_ctx; | 496 | TCGContext *s = &tcg_ctx; |
tcg/tcg.h
| @@ -385,6 +385,8 @@ void tcg_dump_ops(TCGContext *s, FILE *outfile); | @@ -385,6 +385,8 @@ void tcg_dump_ops(TCGContext *s, FILE *outfile); | ||
| 385 | void dump_ops(const uint16_t *opc_buf, const TCGArg *opparam_buf); | 385 | void dump_ops(const uint16_t *opc_buf, const TCGArg *opparam_buf); |
| 386 | TCGv tcg_const_i32(int32_t val); | 386 | TCGv tcg_const_i32(int32_t val); |
| 387 | TCGv tcg_const_i64(int64_t val); | 387 | TCGv tcg_const_i64(int64_t val); |
| 388 | +TCGv tcg_const_local_i32(int32_t val); | ||
| 389 | +TCGv tcg_const_local_i64(int64_t val); | ||
| 388 | 390 | ||
| 389 | #if TCG_TARGET_REG_BITS == 32 | 391 | #if TCG_TARGET_REG_BITS == 32 |
| 390 | #define tcg_const_ptr tcg_const_i32 | 392 | #define tcg_const_ptr tcg_const_i32 |