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
This commit is contained in:
aurel32 2009-03-09 22:35:22 +00:00
parent d2604285b2
commit c29d0de4d6

View 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)