SUBST (XEXP (x, 1), temp);
}
+ /* Try to fold this expression in case we have constants that weren't
+ present before. */
+ temp = 0;
+ switch (GET_RTX_CLASS (code))
+ {
+ case RTX_UNARY:
+ if (op0_mode == VOIDmode)
+ op0_mode = GET_MODE (XEXP (x, 0));
+ temp = simplify_unary_operation (code, mode, XEXP (x, 0), op0_mode);
+ break;
+ case RTX_COMPARE:
+ case RTX_COMM_COMPARE:
+ {
+ machine_mode cmp_mode = GET_MODE (XEXP (x, 0));
+ if (cmp_mode == VOIDmode)
+ {
+ cmp_mode = GET_MODE (XEXP (x, 1));
+ if (cmp_mode == VOIDmode)
+ cmp_mode = op0_mode;
+ }
+ temp = simplify_relational_operation (code, mode, cmp_mode,
+ XEXP (x, 0), XEXP (x, 1));
+ }
+ break;
+ case RTX_COMM_ARITH:
+ case RTX_BIN_ARITH:
+ temp = simplify_binary_operation (code, mode, XEXP (x, 0), XEXP (x, 1));
+ break;
+ case RTX_BITFIELD_OPS:
+ case RTX_TERNARY:
+ temp = simplify_ternary_operation (code, mode, op0_mode, XEXP (x, 0),
+ XEXP (x, 1), XEXP (x, 2));
+ break;
+ default:
+ break;
+ }
+
+ if (temp)
+ {
+ x = temp;
+ code = GET_CODE (temp);
+ op0_mode = VOIDmode;
+ mode = GET_MODE (temp);
+ }
+
/* If this is a simple operation applied to an IF_THEN_ELSE, try
applying it to the arms of the IF_THEN_ELSE. This often simplifies
things. Check for cases where both arms are testing the same
}
}
- /* Try to fold this expression in case we have constants that weren't
- present before. */
- temp = 0;
- switch (GET_RTX_CLASS (code))
- {
- case RTX_UNARY:
- if (op0_mode == VOIDmode)
- op0_mode = GET_MODE (XEXP (x, 0));
- temp = simplify_unary_operation (code, mode, XEXP (x, 0), op0_mode);
- break;
- case RTX_COMPARE:
- case RTX_COMM_COMPARE:
- {
- machine_mode cmp_mode = GET_MODE (XEXP (x, 0));
- if (cmp_mode == VOIDmode)
- {
- cmp_mode = GET_MODE (XEXP (x, 1));
- if (cmp_mode == VOIDmode)
- cmp_mode = op0_mode;
- }
- temp = simplify_relational_operation (code, mode, cmp_mode,
- XEXP (x, 0), XEXP (x, 1));
- }
- break;
- case RTX_COMM_ARITH:
- case RTX_BIN_ARITH:
- temp = simplify_binary_operation (code, mode, XEXP (x, 0), XEXP (x, 1));
- break;
- case RTX_BITFIELD_OPS:
- case RTX_TERNARY:
- temp = simplify_ternary_operation (code, mode, op0_mode, XEXP (x, 0),
- XEXP (x, 1), XEXP (x, 2));
- break;
- default:
- break;
- }
-
- if (temp)
- {
- x = temp;
- code = GET_CODE (temp);
- op0_mode = VOIDmode;
- mode = GET_MODE (temp);
- }
-
/* First see if we can apply the inverse distributive law. */
if (code == PLUS || code == MINUS
|| code == AND || code == IOR || code == XOR)