+
+ if (mode_is_int(mode)) {
+ /* integer only */
+ if (pn == pn_Cmp_Eq) {
+ ir_node *tmp = t;
+ t = f;
+ f = tmp;
+ pn = pn_Cmp_Lg;
+ }
+ if (pn == pn_Cmp_Lg && is_And(cmp_l)) {
+ /* Psi((a & b) != 0, c, 0) */
+ ir_node *and_r = get_And_right(cmp_l);
+ ir_node *and_l;
+
+ if (and_r == t && f == cmp_r) {
+ if (is_Const(t) && tarval_is_single_bit(get_Const_tarval(t))) {
+ /* Psi((a & 2^C) != 0, 2^C, 0) */
+ n = cmp_l;
+ return n;
+ }
+ }
+ if (and_r == f && t == cmp_r) {
+ if (is_Const(f) && tarval_is_single_bit(get_Const_tarval(f))) {
+ /* Psi((a & 2^C) != 0, 0, 2^C) */
+ n = new_rd_Eor(get_irn_dbg_info(n), current_ir_graph,
+ block, cmp_l, f, mode);
+ return n;
+ }
+ }
+ if (is_Shl(and_r)) {
+ ir_node *shl_l = get_Shl_left(and_r);
+ if (is_Const(shl_l) && is_Const_one(shl_l)) {
+ if (and_r == t && f == cmp_r) {
+ /* (a & (1 << n)) != 0, (1 << n), 0) */
+ n = cmp_l;
+ return n;
+ }
+ else if (and_r == f && t == cmp_r) {
+ /* (a & (1 << n)) != 0, 0, (1 << n)) */
+ n = new_rd_Eor(get_irn_dbg_info(n), current_ir_graph,
+ block, cmp_l, f, mode);
+ return n;
+ }
+ }
+ }
+ and_l = get_And_left(cmp_l);
+ if (is_Shl(and_l)) {
+ ir_node *shl_l = get_Shl_left(and_l);
+ if (is_Const(shl_l) && is_Const_one(shl_l)) {
+ if (and_l == t && f == cmp_r) {
+ /* ((1 << n) & a) != 0, (1 << n), 0) */
+ n = cmp_l;
+ return n;
+ }
+ else if (and_l == f && t == cmp_r) {
+ /* ((1 << n) & a) != 0, 0, (1 << n)) */
+ n = new_rd_Eor(get_irn_dbg_info(n), current_ir_graph,
+ block, cmp_l, f, mode);
+ return n;
+ }
+ }
+ }
+ }
+ }