Commit 4d07272d80c48e9a124c91a4f135839a65e7aeca

Authored by blueswir1
1 parent 6f551262

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
Showing 1 changed file with 8 additions and 4 deletions
tcg/tcg-op.h
... ... @@ -164,7 +164,8 @@ static inline void tcg_gen_br(int label)
164 164  
165 165 static inline void tcg_gen_mov_i32(TCGv ret, TCGv arg)
166 166 {
167   - tcg_gen_op2(INDEX_op_mov_i32, ret, arg);
  167 + if (ret != arg)
  168 + tcg_gen_op2(INDEX_op_mov_i32, ret, arg);
168 169 }
169 170  
170 171 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)
495 496  
496 497 static inline void tcg_gen_mov_i64(TCGv ret, TCGv arg)
497 498 {
498   - tcg_gen_mov_i32(ret, arg);
499   - tcg_gen_mov_i32(TCGV_HIGH(ret), TCGV_HIGH(arg));
  499 + if (ret != arg) {
  500 + tcg_gen_mov_i32(ret, arg);
  501 + tcg_gen_mov_i32(TCGV_HIGH(ret), TCGV_HIGH(arg));
  502 + }
500 503 }
501 504  
502 505 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)
719 722  
720 723 static inline void tcg_gen_mov_i64(TCGv ret, TCGv arg)
721 724 {
722   - tcg_gen_op2(INDEX_op_mov_i64, ret, arg);
  725 + if (ret != arg)
  726 + tcg_gen_op2(INDEX_op_mov_i64, ret, arg);
723 727 }
724 728  
725 729 static inline void tcg_gen_movi_i64(TCGv ret, int64_t arg)
... ...