Skip to contentSkip to conversation

[4312] Skip register moves when the target and the source are the same

Qemu-devel Blue Swirl 1 participant 1 message May 3, 2008

lore
Share & tools
lore

Blue Swirl

author
#0 lore raw

Revision: 4312

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4312
Author:   blueswir1
Date:     2008-05-03 20:52:26 +0000 (Sat, 03 May 2008)

Log Message:
-----------
Skip register moves when the target and the source are the same

Modified Paths:
--------------
trunk/tcg/tcg-op.h

Modified: trunk/tcg/tcg-op.h
===================================================================

tcg/tcg-op.h +8 -4
@@ -164,7 +164,8 @@
 
 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_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_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)