i386.md (*add<mode>_2): Add r/r/0 alternative.
authorUros Bizjak <uros@gcc.gnu.org>
Mon, 23 Apr 2012 21:24:56 +0000 (23:24 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Mon, 23 Apr 2012 21:24:56 +0000 (23:24 +0200)
* config/i386/i386.md (*add<mode>_2): Add r/r/0 alternative.
(*addsi_2_zext): Ditto.
(*add<mode>_3): Ditto.
(*addsi_3_zext): Ditto.
(*add<mode>_5): Ditto.

From-SVN: r186725

gcc/ChangeLog
gcc/config/i386/i386.md
gcc/testsuite/ChangeLog

index e62b04eed7b40792efd3d732045dbef7d980921f..6334c59b7d73f0a9ad2cad337080f3b5d73ee0b4 100644 (file)
@@ -1,3 +1,11 @@
+2012-04-23  Uros Bizjak  <ubizjak@gmail.com>
+
+       * config/i386/i386.md (*add<mode>_2): Add r/r/0 alternative.
+       (*addsi_2_zext): Ditto.
+       (*add<mode>_3): Ditto.
+       (*addsi_3_zext): Ditto.
+       (*add<mode>_5): Ditto.
+
 2012-04-23  Andrew Pinski  <apinski@cavium.com>
 
        * tree-ssa-forwprop.c (simplify_bitwise_binary): Simplify (A & B) OP0
        (varpool_node): Remove reachable flag.
        (cgraph_mark_if_needed): Remove.
        (cgraph_mark_reachable_node): Remove.
-       * tree-emutls.c (ipa_lower_emutls): Do not check
-       reachable.
+       * tree-emutls.c (ipa_lower_emutls): Do not check reachable.
        * cgraphunit.c (cgraph_finalize_function): Do not mark node as
        reachable.
        (cgraph_add_new_function): Likewise.
        (cgraph_mark_if_needed): Remove.
        (cgraph_analyze_function): Do not set target as reachable.
-       (process_function_and_variable_attributes): Do not care about dllexport.
+       (process_function_and_variable_attributes): Do not care about
+       dllexport.
        (cgraph_analyze_functions): Do not set reachable flags.
        (cgraph_mark_functions_to_output): Do not check reachability.
        (cgraph_copy_node_for_versioning): Do not set reachable flag.
@@ -52,7 +60,8 @@
        (enqueue_cgraph_node): Use reachable pointer set.
        (process_references): Likewise.
        (cgraph_remove_unreachable_nodes): Likewise.
-       (whole_program_function_and_variable_visibility): Do not recompute reachable.
+       (whole_program_function_and_variable_visibility): Do not recompute
+       reachable.
        * trans-mem.c (ipa_tm_execute): Do not check reachable flag.
 
 2012-04-23  Georg-Johann Lay  <avr@gjlay.de>
        (varpool_analyze_node): New.
        (varpool_mark_needed_node): Remove.
        (varpool_first_variable, varpool_next_variable): New inlines.
-       (varpool_first_static_initializer, varpool_next_static_initializer): Update.
+       (varpool_first_static_initializer, varpool_next_static_initializer):
+       Update.
        (FOR_EACH_STATIC_VARIABLE): Remove unused walker.
        (varpool_first_defined_variable): New inline.
        (varpool_next_defined_variable): New inline
        when varpool is in construction.
        (cgraph_analyze_functions): Rewrite.
        (cgraph_expand_all_functions): Update.
-       (cgraph_output_in_order): Do not analyze pending decls; do not set needed flags.
+       (cgraph_output_in_order): Do not analyze pending decls; do not set
+       needed flags.
        (cgraph_optimize): Do not analyze pending decls.
-       * lto-cgraph.c (input_varpool_node): Clear analyzed flag for objects in other
-       partition; do not mark node as needed.
+       * lto-cgraph.c (input_varpool_node): Clear analyzed flag for objects
+       in other partition; do not mark node as needed.
        * dwarf2out.c (reference_to_unused): Use analyzed flag.
        (premark_types_used_by_global_vars_helper): Likewise.
        * ipa.c (process_references): Do not call varpool_mark_needed_node.
index 27ed5f6e07983b31a0f92afa144f00fc82d743bc..5d7cc408493197e6359709b56330461ec00f6421 100644 (file)
   [(set (reg FLAGS_REG)
        (compare
          (plus:SWI
-           (match_operand:SWI 1 "nonimmediate_operand" "%0,0")
-           (match_operand:SWI 2 "<general_operand>" "<g>,<r><i>"))
+           (match_operand:SWI 1 "nonimmediate_operand" "%0,0,<r>")
+           (match_operand:SWI 2 "<general_operand>" "<g>,<r><i>,0"))
          (const_int 0)))
-   (set (match_operand:SWI 0 "nonimmediate_operand" "=<r>,<r>m")
+   (set (match_operand:SWI 0 "nonimmediate_operand" "=<r>,<r>m,<r>")
        (plus:SWI (match_dup 1) (match_dup 2)))]
   "ix86_match_ccmode (insn, CCGOCmode)
    && ix86_binary_operator_ok (PLUS, <MODE>mode, operands)"
        }
 
     default:
+      if (which_alternative == 2)
+       {
+         rtx tmp;
+         tmp = operands[1], operands[1] = operands[2], operands[2] = tmp;
+       }
+        
+      gcc_assert (rtx_equal_p (operands[0], operands[1]));
       if (x86_maybe_negate_const_int (&operands[2], <MODE>mode))
         return "sub{<imodesuffix>}\t{%2, %0|%0, %2}";
 
 (define_insn "*addsi_2_zext"
   [(set (reg FLAGS_REG)
        (compare
-         (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0")
-                  (match_operand:SI 2 "x86_64_general_operand" "rme"))
+         (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,r")
+                  (match_operand:SI 2 "x86_64_general_operand" "rme,0"))
          (const_int 0)))
-   (set (match_operand:DI 0 "register_operand" "=r")
+   (set (match_operand:DI 0 "register_operand" "=r,r")
        (zero_extend:DI (plus:SI (match_dup 1) (match_dup 2))))]
   "TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode)
    && ix86_binary_operator_ok (PLUS, SImode, operands)"
        }
 
     default:
+      if (which_alternative == 1)
+       {
+         rtx tmp;
+         tmp = operands[1], operands[1] = operands[2], operands[2] = tmp;
+       }
+
+      gcc_assert (rtx_equal_p (operands[0], operands[1]));
       if (x86_maybe_negate_const_int (&operands[2], SImode))
         return "sub{l}\t{%2, %k0|%k0, %2}";
 
 (define_insn "*add<mode>_3"
   [(set (reg FLAGS_REG)
        (compare
-         (neg:SWI (match_operand:SWI 2 "<general_operand>" "<g>"))
-         (match_operand:SWI 1 "nonimmediate_operand" "%0")))
-   (clobber (match_scratch:SWI 0 "=<r>"))]
+         (neg:SWI (match_operand:SWI 2 "<general_operand>" "<g>,0"))
+         (match_operand:SWI 1 "nonimmediate_operand" "%0,<r>")))
+   (clobber (match_scratch:SWI 0 "=<r>,<r>"))]
   "ix86_match_ccmode (insn, CCZmode)
    && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
 {
        }
 
     default:
+      if (which_alternative == 1)
+       {
+         rtx tmp;
+         tmp = operands[1], operands[1] = operands[2], operands[2] = tmp;
+       }
+
+      gcc_assert (rtx_equal_p (operands[0], operands[1]));
       if (x86_maybe_negate_const_int (&operands[2], <MODE>mode))
         return "sub{<imodesuffix>}\t{%2, %0|%0, %2}";
 
 (define_insn "*addsi_3_zext"
   [(set (reg FLAGS_REG)
        (compare
-         (neg:SI (match_operand:SI 2 "x86_64_general_operand" "rme"))
-         (match_operand:SI 1 "nonimmediate_operand" "%0")))
-   (set (match_operand:DI 0 "register_operand" "=r")
+         (neg:SI (match_operand:SI 2 "x86_64_general_operand" "rme,0"))
+         (match_operand:SI 1 "nonimmediate_operand" "%0,r")))
+   (set (match_operand:DI 0 "register_operand" "=r,r")
        (zero_extend:DI (plus:SI (match_dup 1) (match_dup 2))))]
   "TARGET_64BIT && ix86_match_ccmode (insn, CCZmode)
    && ix86_binary_operator_ok (PLUS, SImode, operands)"
        }
 
     default:
+      if (which_alternative == 1)
+       {
+         rtx tmp;
+         tmp = operands[1], operands[1] = operands[2], operands[2] = tmp;
+       }
+
+      gcc_assert (rtx_equal_p (operands[0], operands[1]));
       if (x86_maybe_negate_const_int (&operands[2], SImode))
         return "sub{l}\t{%2, %k0|%k0, %2}";
 
   [(set (reg FLAGS_REG)
        (compare
          (plus:SWI
-           (match_operand:SWI 1 "nonimmediate_operand" "%0")
-           (match_operand:SWI 2 "<general_operand>" "<g>"))
+           (match_operand:SWI 1 "nonimmediate_operand" "%0,<r>")
+           (match_operand:SWI 2 "<general_operand>" "<g>,0"))
          (const_int 0)))
-   (clobber (match_scratch:SWI 0 "=<r>"))]
+   (clobber (match_scratch:SWI 0 "=<r>,<r>"))]
   "ix86_match_ccmode (insn, CCGOCmode)
    && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
 {
        }
 
     default:
+      if (which_alternative == 1)
+       {
+         rtx tmp;
+         tmp = operands[1], operands[1] = operands[2], operands[2] = tmp;
+       }
+
+      gcc_assert (rtx_equal_p (operands[0], operands[1]));
       if (x86_maybe_negate_const_int (&operands[2], <MODE>mode))
         return "sub{<imodesuffix>}\t{%2, %0|%0, %2}";
 
index 36fdbb5ad6dd0cac79beb160a3847095f0de300b..abda7a8d15cde2703a46c84c3d01423c0cbe8963 100644 (file)
@@ -21,7 +21,7 @@
 2012-04-23  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimizations/52891
-       * gcc.c-torture/compile/pr52891-1.c: New test.  
+       * gcc.c-torture/compile/pr52891-1.c: New test.
        * gcc.c-torture/compile/pr52891-2.c: New test.
 
 2012-04-22  Tobias Burnus  <burnus@net-b.de>
 2012-04-18  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
        PR tree-optimization/52976
-       gfortran.dg/reassoc_11.f: New test.
+       gfortran.dg/reassoc_11.f: New test.
 
 2012-04-18  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
        PR tree-optimization/52976
-       gfortran.dg/reassoc_7.f: New test.
-       gfortran.dg/reassoc_8.f: Likewise.
-       gfortran.dg/reassoc_9.f: Likewise.
-       gfortran.dg/reassoc_10.f: Likewise.
+       gfortran.dg/reassoc_7.f: New test.
+       gfortran.dg/reassoc_8.f: Likewise.
+       gfortran.dg/reassoc_9.f: Likewise.
+       gfortran.dg/reassoc_10.f: Likewise.
 
 2012-04-18  Paolo Carlini  <paolo.carlini@oracle.com>