+2017-05-12 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/80723
+ * config/i386/i386.c (ix86_rtx_cost) [case PLUS]: Ignore the
+ cost of adding a carry flag for ADC instruction.
+ [case MINUS]: Ignore the cost of subtracting a carry flag
+ for SBB instruction.
+
2017-05-12 Steven Munroe <munroesj@gcc.gnu.org>
* config.gcc (powerpc*-*-*): Add bmi2intrin.h, bmiintrin.h,
2017-05-12 Jeff Law <law@redhat.com>
- * tree-vrp.c (vrp_dom_walker::before_dom_childern): Push unwinding
+ * tree-vrp.c (vrp_dom_walker::before_dom_children): Push unwinding
markers.
2017-05-12 Peter Bergner <bergner@vnet.ibm.com>
}
else if (GET_CODE (XEXP (x, 0)) == PLUS)
{
- *total = cost->lea;
- *total += rtx_cost (XEXP (XEXP (x, 0), 0), mode,
- outer_code, opno, speed);
+ /* Add with carry, ignore the cost of adding a carry flag. */
+ if (ix86_carry_flag_operator (XEXP (XEXP (x, 0), 0), mode))
+ *total = cost->add;
+ else
+ {
+ *total = cost->lea;
+ *total += rtx_cost (XEXP (XEXP (x, 0), 0), mode,
+ outer_code, opno, speed);
+ }
+
*total += rtx_cost (XEXP (XEXP (x, 0), 1), mode,
outer_code, opno, speed);
*total += rtx_cost (XEXP (x, 1), mode,
/* FALLTHRU */
case MINUS:
+ /* Subtract with borrow, ignore the cost of subtracting a carry flag. */
+ if (GET_MODE_CLASS (mode) == MODE_INT
+ && GET_MODE_SIZE (mode) <= UNITS_PER_WORD
+ && GET_CODE (XEXP (x, 0)) == MINUS
+ && ix86_carry_flag_operator (XEXP (XEXP (x, 0), 1), mode))
+ {
+ *total = cost->add;
+ *total += rtx_cost (XEXP (XEXP (x, 0), 0), mode,
+ outer_code, opno, speed);
+ *total += rtx_cost (XEXP (x, 1), mode,
+ outer_code, opno, speed);
+ return true;
+ }
+
if (SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH)
{
/* ??? SSE cost should be used here. */