]> xenbits.xensource.com Git - qemu-upstream-4.5-testing.git/commitdiff
tcg-ppc64: Avoid code for nop move
authorRichard Henderson <rth@twiddle.net>
Wed, 31 Jul 2013 04:26:04 +0000 (18:26 -1000)
committerRichard Henderson <rth@twiddle.net>
Wed, 25 Sep 2013 14:46:32 +0000 (07:46 -0700)
While these are rare from code that's been through the optimizer,
it's not uncommon within the tcg backend.

Signed-off-by: Richard Henderson <rth@twiddle.net>
tcg/ppc64/tcg-target.c

index 27a955ba2ae97e0f78117641ac9e0892db481877..357f8c11de890da034f182c7c0a51624af3c58d2 100644 (file)
@@ -509,7 +509,9 @@ static const uint32_t tcg_to_isel[] = {
 static inline void tcg_out_mov(TCGContext *s, TCGType type,
                                TCGReg ret, TCGReg arg)
 {
-    tcg_out32(s, OR | SAB(arg, ret, arg));
+    if (ret != arg) {
+        tcg_out32(s, OR | SAB(arg, ret, arg));
+    }
 }
 
 static inline void tcg_out_rld(TCGContext *s, int op, TCGReg ra, TCGReg rs,