]> git.proxmox.com Git - qemu.git/commitdiff
tcg: optimize nor(X, Y, Y), used on PPC for not(X, Y)
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>
Mon, 9 Mar 2009 22:35:22 +0000 (22:35 +0000)
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>
Mon, 9 Mar 2009 22:35:22 +0000 (22:35 +0000)
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6798 c046a42c-6fe2-441c-8c8c-71466251a162

tcg/tcg-op.h

index 1cf8b15e36ae75ee9fa7ef3d52fa69754629d429..32440d0c00d925c46759dc9a128eb53d5ca0d8b5 100644 (file)
@@ -1545,20 +1545,28 @@ static inline void tcg_gen_nand_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2)
 
 static inline void tcg_gen_nor_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2)
 {
-    TCGv_i32 t0;
-    t0 = tcg_temp_new_i32();
-    tcg_gen_or_i32(t0, arg1, arg2);
-    tcg_gen_not_i32(ret, t0);
-    tcg_temp_free_i32(t0);
+    if (GET_TCGV_I32(arg1) != GET_TCGV_I32(arg2)) {
+        TCGv_i32 t0;
+        t0 = tcg_temp_new_i32();
+        tcg_gen_or_i32(t0, arg1, arg2);
+        tcg_gen_not_i32(ret, t0);
+        tcg_temp_free_i32(t0);
+    } else {
+        tcg_gen_not_i32(ret, arg1);
+    }
 }
 
 static inline void tcg_gen_nor_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2)
 {
-    TCGv_i64 t0;
-    t0 = tcg_temp_new_i64();
-    tcg_gen_or_i64(t0, arg1, arg2);
-    tcg_gen_not_i64(ret, t0);
-    tcg_temp_free_i64(t0);
+    if (GET_TCGV_I64(arg1) != GET_TCGV_I64(arg2)) {
+        TCGv_i64 t0;
+        t0 = tcg_temp_new_i64();
+        tcg_gen_or_i64(t0, arg1, arg2);
+        tcg_gen_not_i64(ret, t0);
+        tcg_temp_free_i64(t0);
+    } else {
+        tcg_gen_not_i64(ret, arg1);
+    }
 }
 
 static inline void tcg_gen_orc_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2)