+2016-04-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/70467
+ * config/i386/i386.md (*add<dwi>3_doubleword, *sub<dwi>3_doubleword):
+ If low word of the last operand is 0, just emit addition/subtraction
+ for the high word.
+
2016-04-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
PR target/70404
(match_dup 4))
(match_dup 5)))
(clobber (reg:CC FLAGS_REG))])]
- "split_double_mode (<DWI>mode, &operands[0], 3, &operands[0], &operands[3]);")
+{
+ split_double_mode (<DWI>mode, &operands[0], 3, &operands[0], &operands[3]);
+ if (operands[2] == const0_rtx)
+ {
+ ix86_expand_binary_operator (PLUS, <MODE>mode, &operands[3]);
+ DONE;
+ }
+})
(define_insn "*add<mode>_1"
[(set (match_operand:SWI48 0 "nonimmediate_operand" "=r,rm,r,r")
(ltu:DWIH (reg:CC FLAGS_REG) (const_int 0)))
(match_dup 5)))
(clobber (reg:CC FLAGS_REG))])]
- "split_double_mode (<DWI>mode, &operands[0], 3, &operands[0], &operands[3]);")
+{
+ split_double_mode (<DWI>mode, &operands[0], 3, &operands[0], &operands[3]);
+ if (operands[2] == const0_rtx)
+ {
+ ix86_expand_binary_operator (MINUS, <MODE>mode, &operands[3]);
+ DONE;
+ }
+})
(define_insn "*sub<mode>_1"
[(set (match_operand:SWI 0 "nonimmediate_operand" "=<r>m,<r>")
+2016-04-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/70467
+ * gcc.target/i386/pr70467-2.c: New test.
+
2016-04-01 Jakub Jelinek <jakub@redhat.com>
Marek Polacek <polacek@redhat.com>
--- /dev/null
+/* PR rtl-optimization/70467 */
+/* { dg-do compile { target ia32 } } */
+/* { dg-options "-O2" } */
+
+unsigned long long
+foo (unsigned long long x)
+{
+ return x + 0x12345600000000ULL;
+}
+
+unsigned long long
+bar (unsigned long long x)
+{
+ return x - 0x12345600000000ULL;
+}
+
+/* { dg-final { scan-assembler-not "addl\[ \t\]*.0," } } */
+/* { dg-final { scan-assembler-not "subl\[ \t\]*.0," } } */
+/* { dg-final { scan-assembler-not "adcl\[^\n\r\]*%" } } */
+/* { dg-final { scan-assembler-not "sbbl\[^\n\r\]*%" } } */