diff options
author | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-03-09 22:35:22 +0000 |
---|---|---|
committer | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-03-09 22:35:22 +0000 |
commit | c29d0de4d67f09674f7070a5e9a648f1d5074d8e (patch) | |
tree | 8688fe67560ba824f592ec7c4dc982ba09f3f400 | |
parent | d2604285b26501435286d7d2933d9017920794d6 (diff) |
tcg: optimize nor(X, Y, Y), used on PPC for not(X, Y)
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6798 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r-- | tcg/tcg-op.h | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/tcg/tcg-op.h b/tcg/tcg-op.h index 1cf8b15e36..32440d0c00 100644 --- a/tcg/tcg-op.h +++ b/tcg/tcg-op.h @@ -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) |