From a110769b0594fd6dee203e6aad8a5d9095e73aa7 Mon Sep 17 00:00:00 2001 From: uros Date: Mon, 23 Apr 2012 21:24:56 +0000 Subject: [PATCH] * config/i386/i386.md (*add_2): Add r/r/0 alternative. (*addsi_2_zext): Ditto. (*add_3): Ditto. (*addsi_3_zext): Ditto. (*add_5): Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186725 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 27 ++++++++++++++------ gcc/config/i386/i386.md | 65 +++++++++++++++++++++++++++++++++++++------------ gcc/testsuite/ChangeLog | 12 ++++----- 3 files changed, 75 insertions(+), 29 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e62b04e..6334c59 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2012-04-23 Uros Bizjak + + * config/i386/i386.md (*add_2): Add r/r/0 alternative. + (*addsi_2_zext): Ditto. + (*add_3): Ditto. + (*addsi_3_zext): Ditto. + (*add_5): Ditto. + 2012-04-23 Andrew Pinski * tree-ssa-forwprop.c (simplify_bitwise_binary): Simplify (A & B) OP0 @@ -35,14 +43,14 @@ (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 @@ -94,7 +103,8 @@ (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 @@ -114,10 +124,11 @@ 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. diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 27ed5f6..5d7cc40 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -5811,10 +5811,10 @@ [(set (reg FLAGS_REG) (compare (plus:SWI - (match_operand:SWI 1 "nonimmediate_operand" "%0,0") - (match_operand:SWI 2 "" ",")) + (match_operand:SWI 1 "nonimmediate_operand" "%0,0,") + (match_operand:SWI 2 "" ",,0")) (const_int 0))) - (set (match_operand:SWI 0 "nonimmediate_operand" "=,m") + (set (match_operand:SWI 0 "nonimmediate_operand" "=,m,") (plus:SWI (match_dup 1) (match_dup 2)))] "ix86_match_ccmode (insn, CCGOCmode) && ix86_binary_operator_ok (PLUS, mode, operands)" @@ -5831,6 +5831,13 @@ } 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)) return "sub{}\t{%2, %0|%0, %2}"; @@ -5852,10 +5859,10 @@ (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)" @@ -5872,6 +5879,13 @@ } 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}"; @@ -5892,9 +5906,9 @@ (define_insn "*add_3" [(set (reg FLAGS_REG) (compare - (neg:SWI (match_operand:SWI 2 "" "")) - (match_operand:SWI 1 "nonimmediate_operand" "%0"))) - (clobber (match_scratch:SWI 0 "="))] + (neg:SWI (match_operand:SWI 2 "" ",0")) + (match_operand:SWI 1 "nonimmediate_operand" "%0,"))) + (clobber (match_scratch:SWI 0 "=,"))] "ix86_match_ccmode (insn, CCZmode) && !(MEM_P (operands[1]) && MEM_P (operands[2]))" { @@ -5910,6 +5924,13 @@ } 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)) return "sub{}\t{%2, %0|%0, %2}"; @@ -5931,9 +5952,9 @@ (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)" @@ -5950,6 +5971,13 @@ } 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}"; @@ -6060,10 +6088,10 @@ [(set (reg FLAGS_REG) (compare (plus:SWI - (match_operand:SWI 1 "nonimmediate_operand" "%0") - (match_operand:SWI 2 "" "")) + (match_operand:SWI 1 "nonimmediate_operand" "%0,") + (match_operand:SWI 2 "" ",0")) (const_int 0))) - (clobber (match_scratch:SWI 0 "="))] + (clobber (match_scratch:SWI 0 "=,"))] "ix86_match_ccmode (insn, CCGOCmode) && !(MEM_P (operands[1]) && MEM_P (operands[2]))" { @@ -6079,6 +6107,13 @@ } 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)) return "sub{}\t{%2, %0|%0, %2}"; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 36fdbb5..abda7a8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -21,7 +21,7 @@ 2012-04-23 Jakub Jelinek 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 @@ -77,15 +77,15 @@ 2012-04-18 Bill Schmidt PR tree-optimization/52976 - gfortran.dg/reassoc_11.f: New test. + * gfortran.dg/reassoc_11.f: New test. 2012-04-18 Bill Schmidt 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 -- 2.7.4