FS_OPT_AND, /**< a & 0b1...1 = 0b1...1 & a = a & a = a */
FS_OPT_TO_EOR, /**< (a|b) & ~(a&b) = a^b */
FS_OPT_EOR_A_A, /**< a ^ a = 0 */
+ FS_OPT_EOR_A_B_A, /**< (a ^ b) ^ a = b */
FS_OPT_EOR_TO_NOT_BOOL, /**< bool ^ 1 = !bool */
FS_OPT_EOR_TO_NOT, /**< x ^ 0b1..1 = ~x, (a ^ b) & b -> ~a & b */
FS_OPT_NOT_CMP, /**< !(a cmp b) = a !cmp b */
if (aa == b) {
/* (a ^ b) ^ a -> b */
n = ab;
+ DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_EOR_A_B_A);
} else if (ab == b) {
/* (a ^ b) ^ b -> a */
n = aa;
+ DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_EOR_A_B_A);
}
} else if (is_Eor(b)) {
ir_node *ba = get_Eor_left(b);
if (ba == a) {
/* a ^ (a ^ b) -> b */
n = bb;
+ DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_EOR_A_B_A);
} else if (bb == a) {
/* a ^ (b ^ a) -> b */
n = ba;
+ DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_EOR_A_B_A);
}
}
{ FS_OPT_AND, "algebraic simplification: a & 0b1...1 = 0b1...1 & a = a & a = (a|X) & a = a" },
{ FS_OPT_TO_EOR, "algebraic simplification: (a|b) & ~(a&b) = a^b" },
{ FS_OPT_EOR_A_A, "algebraic simplification: a ^ a = 0" },
+ { FS_OPT_EOR_A_B_A, "algebraic simplification: (a ^ b) ^ a = b" },
{ FS_OPT_EOR_TO_NOT_BOOL,"boolean simplification: bool ^ 1 = !bool" },
{ FS_OPT_EOR_TO_NOT, "algebraic simplification: x ^ 0b1..1 = ~x, (a ^ b) & b = ~a & b" },
{ FS_OPT_NOT_CMP, "algebraic simplification: !(a cmp b) = a !cmp b" },