aboutsummaryrefslogtreecommitdiff
path: root/tcg/tcg-op.h
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-05-03 20:52:26 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-05-03 20:52:26 +0000
commit4d07272d80c48e9a124c91a4f135839a65e7aeca (patch)
tree50af2e82e07225a14d90d14ba4b0b4beff4e4288 /tcg/tcg-op.h
parent6f551262b35aa5f95ef9a8a9e5b3e43871be66a6 (diff)
downloadqemu-4d07272d80c48e9a124c91a4f135839a65e7aeca.zip
qemu-4d07272d80c48e9a124c91a4f135839a65e7aeca.tar.gz
qemu-4d07272d80c48e9a124c91a4f135839a65e7aeca.tar.bz2
Skip register moves when the target and the source are the same
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4312 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'tcg/tcg-op.h')
-rw-r--r--tcg/tcg-op.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/tcg/tcg-op.h b/tcg/tcg-op.h
index 5f66d7f..c1ff8f4 100644
--- a/tcg/tcg-op.h
+++ b/tcg/tcg-op.h
@@ -164,7 +164,8 @@ static inline void tcg_gen_br(int label)
static inline void tcg_gen_mov_i32(TCGv ret, TCGv arg)
{
- tcg_gen_op2(INDEX_op_mov_i32, ret, arg);
+ if (ret != arg)
+ tcg_gen_op2(INDEX_op_mov_i32, ret, arg);
}
static inline void tcg_gen_movi_i32(TCGv ret, int32_t arg)
@@ -495,8 +496,10 @@ static inline void tcg_gen_remu_i32(TCGv ret, TCGv arg1, TCGv arg2)
static inline void tcg_gen_mov_i64(TCGv ret, TCGv arg)
{
- tcg_gen_mov_i32(ret, arg);
- tcg_gen_mov_i32(TCGV_HIGH(ret), TCGV_HIGH(arg));
+ if (ret != arg) {
+ tcg_gen_mov_i32(ret, arg);
+ tcg_gen_mov_i32(TCGV_HIGH(ret), TCGV_HIGH(arg));
+ }
}
static inline void tcg_gen_movi_i64(TCGv ret, int64_t arg)
@@ -719,7 +722,8 @@ static inline void tcg_gen_remu_i64(TCGv ret, TCGv arg1, TCGv arg2)
static inline void tcg_gen_mov_i64(TCGv ret, TCGv arg)
{
- tcg_gen_op2(INDEX_op_mov_i64, ret, arg);
+ if (ret != arg)
+ tcg_gen_op2(INDEX_op_mov_i64, ret, arg);
}
static inline void tcg_gen_movi_i64(TCGv ret, int64_t arg)