i386.md (pro_epilogue_adjust_stack_1): Assert that operand 0 == operand 1.
authorUros Bizjak <uros@gcc.gnu.org>
Fri, 11 Jun 2010 09:38:59 +0000 (11:38 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Fri, 11 Jun 2010 09:38:59 +0000 (11:38 +0200)
* config/i386/i386.md (pro_epilogue_adjust_stack_1) <TYPE_ALU>: Assert
that operand 0 == operand 1.  Use x86_maybe_negate_const_int to output
insn mnemonic.
(pro_epilogue_adjust_stack_rex64) <TYPE_ALU>: Ditto.

From-SVN: r160600

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

index 42492a437852965388d453909121801c22a34bac..561b0eed0f961b7a30d0b9419029af4eb10c6ef8 100644 (file)
@@ -1,3 +1,10 @@
+2010-06-11  Uros Bizjak  <ubizjak@gmail.com>
+
+       * config/i386/i386.md (pro_epilogue_adjust_stack_1) <TYPE_ALU>: Assert
+       that operand 0 == operand 1.  Use x86_maybe_negate_const_int to output
+       insn mnemonic.
+       (pro_epilogue_adjust_stack_rex64) <TYPE_ALU>: Ditto.
+
 2010-06-10  Dodji Seketeli  <dodji@redhat.com>
 
        Fix bootstap on mips
        * gensupport.h (message_with_line, n_comma_elts, scan_comma_elt):
        Move to read-md.h.
        * gensupport.c: Include read-md.h.
-       (message_with_line, n_comma_elts, scan_comma_elt): Move to
-       read-md.c.
+       (message_with_line, n_comma_elts, scan_comma_elt): Move to read-md.c.
        * read-md.h, read-md.c: New files.
 
 2010-06-10  Anatoly Sokolov  <aesok@post.ru>
 2010-06-10  Jan Hubicka  <jh@suse.cz>
 
        PR rtl-optimization/44460
-       * emit-rtl.c (set_mem_attributes_minus_bitpos): Remove TYPE_NEEDS_CONSTRUCTING
-       sanity check.
+       * emit-rtl.c (set_mem_attributes_minus_bitpos): Remove
+       TYPE_NEEDS_CONSTRUCTING sanity check.
 
 2010-06-10  Gerald Pfeifer  <gerald@pfeifer.com>
 
 
 2010-06-09  Changpeng Fang  <changpeng.fang@amd.com>
 
-        * tree-ssa-loop-prefetch.c (PREFETCH_MOD_TO_UNROLL_FACTOR_RATIO) :
-        Change the PREFETCH_MOD_TO_UNROLL_FACTOR_RATIO threshold value from
-        8 to 4.  Minor change of the related comments.
+       * tree-ssa-loop-prefetch.c (PREFETCH_MOD_TO_UNROLL_FACTOR_RATIO) :
+       Change the PREFETCH_MOD_TO_UNROLL_FACTOR_RATIO threshold value from
+       8 to 4.  Minor change of the related comments.
 
 2010-06-09  Sebastian Pop  <sebastian.pop@amd.com>
 
        * tree-vectorizer.h (vinfo_for_stmt): Remove check.
        (set_vinfo_for_stmt, get_earlier_stmt, is_loop_header_bb_p): Change
        gcc_assert to gcc_checking_assert.
-       * tree-flow-inline.h (gimple_vop, get_var_ann, relink_imm_use, phi_nodes
-       set_phi_nodes, phi_arg_index_from_use, op_iter_next_use,
+       * tree-flow-inline.h (gimple_vop, get_var_ann, relink_imm_use,
+       phi_nodes, set_phi_nodes, phi_arg_index_from_use, op_iter_next_use,
        op_iter_next_def, op_iter_next_tree, op_iter_init, op_iter_init_use,
-       op_iter_init_phiuse, op_iter_init_phidef, array_ref_contains_indirect_ref,
-       ref_contains_array_ref): Use gcc_checking_assert.
+       op_iter_init_phiuse, op_iter_init_phidef,
+       array_ref_contains_indirect_ref, ref_contains_array_ref): Use
+       gcc_checking_assert.
        * emit-rtl.h (set_first_insn, set_last_insn): Likewise.
        * tree-ssa-live.h (var_to_partition, var_to_partition_to_var,
        partition_is_global, live_on_entry, live_on_exit,
 2010-06-09  Jan Hubicka  <jh@suse.cz>
 
        * gimple.h (gcc_gimple_checking_assert): New macro.
-       (gimple_set_def_ops, gimple_set_use_ops,
-       gimple_set_vuse, gimple_set_vdef,
-       gimple_omp_subcode, gimple_omp_set_subcode, gimple_ops, gimple_op,
-       gimple_op_ptr, gimple_op_ptr, gimple_set_op, gimple_bind_set_block,
-       gimple_asm_input_op, gimple_asm_input_op_ptr, gimple_asm_set_input_op,
-       gimple_asm_output_op, gimple_asm_output_op_ptr,
-       gimple_asm_set_output_op, gimple_asm_clobber_op, 
-       gimple_asm_set_clobber_op, gimple_asm_label_op,
-       gimple_asm_set_label_op, gimple_try_set_kind, gimple_try_catch_is_cleanup
-       gimple_try_set_catch_is_cleanup, gimple_phi_arg, 
-       gimple_switch_num_labels, gimple_switch_set_index, gimple_switch_label,
-       gimple_switch_set_label, gimple_omp_for_index, gimple_omp_for_index_ptr,
-       gimple_omp_for_set_index, gimple_omp_for_initial, gimple_omp_for_initial_ptr,
-       gimple_omp_for_set_initial, gimple_omp_for_final, gimple_omp_for_final_ptr,
-       gimple_omp_for_set_final, gimple_omp_for_incr, gimple_omp_for_incr_ptr,
-       gimple_omp_for_set_incr, gimple_omp_for_set_cond, gimple_omp_for_cond): Make
-       checking conditional with ENABLE_GIMPLE_CHECKING.
-       (gimple_phi_set_arg): Likewise; replace memcpy by assignment.
+       (gimple_set_def_ops, gimple_set_use_ops,
+       gimple_set_vuse, gimple_set_vdef,
+       gimple_omp_subcode, gimple_omp_set_subcode, gimple_ops, gimple_op,
+       gimple_op_ptr, gimple_op_ptr, gimple_set_op, gimple_bind_set_block,
+       gimple_asm_input_op, gimple_asm_input_op_ptr, gimple_asm_set_input_op,
+       gimple_asm_output_op, gimple_asm_output_op_ptr,
+       gimple_asm_set_output_op, gimple_asm_clobber_op,
+       gimple_asm_set_clobber_op, gimple_asm_label_op,
+       gimple_asm_set_label_op, gimple_try_set_kind,
+       gimple_try_catch_is_cleanup, gimple_try_set_catch_is_cleanup,
+       gimple_phi_arg, gimple_switch_num_labels, gimple_switch_set_index,
+       gimple_switch_label, gimple_switch_set_label, gimple_omp_for_index,
+       gimple_omp_for_index_ptr, gimple_omp_for_set_index,
+       gimple_omp_for_initial, gimple_omp_for_initial_ptr,
+       gimple_omp_for_set_initial, gimple_omp_for_final,
+       gimple_omp_for_final_ptr, gimple_omp_for_set_final,
+       gimple_omp_for_incr, gimple_omp_for_incr_ptr, gimple_omp_for_set_incr,
+       gimple_omp_for_set_cond, gimple_omp_for_cond): Make checking
+       conditional with ENABLE_GIMPLE_CHECKING.
+       (gimple_phi_set_arg): Likewise; replace memcpy by assignment.
 
 2010-06-09  Sandra Loosemore  <sandra@codesourcery.com>
 
 
        * tree-cfg.c (create_bb): Update comment to not reference
        ggc_alloc_cleared.
-       * tree-ssa-structalias.c (struct heapvar_for_stmt): Fix param_is
-       value.
+       * tree-ssa-structalias.c (struct heapvar_for_stmt): Fix param_is value.
 
        * varpool.c (varpool_node): Use typed GC allocation.
        (varpool_extra_name_alias): Likewise.
        (init_alias_analysis): Likewise.
 
 2010-06-08  Shujing Zhao  <pearly.zhao@oracle.com>
-       
+
        * fold-const.c (fold_comparison): Remove redundant parenthesis.
        * tree-inline.c (expand_call_inline): Pass translated return value of
        cgraph_inline_failed_string to diagnostic function.
        toplev.c.
        * flags.h (flag_signed_char, flag_short_enums,
        flag_pcc_struct_return, flag_ira_verbose,
-       flag_detailed_statistics, flag_remove_unreachable_functions):
-       Remove.
+       flag_detailed_statistics, flag_remove_unreachable_functions): Remove.
        * toplev.c (flag_detailed_statistics, flag_signed_char,
        flag_short_enums, flag_pcc_struct_return, flag_ira_verbose): Remove.
        (DEFAULT_PCC_STRUCT_RETURN): Move definition to defaults.h.
 
        PR rtl-optimization/44404
        * auto-inc-dec.c (find_inc): Use reg_overlap_mentioned_p instead
-       of count_occurrences to see if it's safe to modify mem_insn.insn.
+       of count_occurrences to see if it's safe to modify mem_insn.
 
 2010-06-07  Richard Guenther  <rguenther@suse.de>
 
 
        * tree-into-ssa.c (insert_phi_nodes): Use bitmap heads
        for dominance frontiers.
-       (rewrite_into_ssa): Update for bitmap heads in dominance
-       frontiers.
+       (rewrite_into_ssa): Update for bitmap heads in dominance frontiers.
        (insert_updated_phi_nodes_for): Likewise.
        (update_ssa): Likewise.
        * cfganal.c (compute_dominance_frontiers_1): Likewise.
 
 2010-05-29  Steven Bosscher  <steven@gcc.gnu.org>
 
-       * c-lex.c: Do not include c-tree.h.
-       * c-pretty-print.c: Likewise.
-       * c-opts.c: Likewise.
-       * c-gimplify.c: Likewise.
+       * c-lex.c: Do not include c-tree.h.
+       * c-pretty-print.c: Likewise.
+       * c-opts.c: Likewise.
+       * c-gimplify.c: Likewise.
        * c-common.c: Likewise.
        * c-dump.c: Likewise.  Include c-common.h.
 
        (next_operand_entry_id): New static variable.
        (sort_by_operand_rank): Stabilize qsort comparator by using unique IDs.
        (add_to_ops_vec): Assigned unique ID to operand entry.
-       (struct oecount_s): New field ID.
+       (struct oecount_s): New field ID.
        (oecount_cmp): Stabilize qsort comparotor by using unique IDs.
        (undistribute_ops_list): Assign unique IDs to oecounts.
        (init_reassoc): reset next_operand_entry_id.
index af9c113f8656b59411d6bfb89476899fff4c2ed3..37f3f99b76abdc0374ca54d8c8ef464b0aec42d4 100644 (file)
       return "mov{l}\t{%1, %0|%0, %1}";
 
     case TYPE_ALU:
-      if (CONST_INT_P (operands[2])
-          && (INTVAL (operands[2]) == 128
-             || (INTVAL (operands[2]) < 0
-                 && INTVAL (operands[2]) != -128)))
-       {
-         operands[2] = GEN_INT (-INTVAL (operands[2]));
-         return "sub{l}\t{%2, %0|%0, %2}";
-       }
+      gcc_assert (rtx_equal_p (operands[0], operands[1]));
+      if (x86_maybe_negate_const_int (&operands[2], SImode))
+       return "sub{l}\t{%2, %0|%0, %2}";
+
       return "add{l}\t{%2, %0|%0, %2}";
 
-    case TYPE_LEA:
+    default:
       operands[2] = SET_SRC (XVECEXP (PATTERN (insn), 0, 0));
       return "lea{l}\t{%a2, %0|%0, %a2}";
-
-    default:
-      gcc_unreachable ();
     }
 }
   [(set (attr "type")
       return "mov{q}\t{%1, %0|%0, %1}";
 
     case TYPE_ALU:
-      if (CONST_INT_P (operands[2])
-         /* Avoid overflows.  */
-         && ((INTVAL (operands[2]) & ((((unsigned int) 1) << 31) - 1)))
-          && (INTVAL (operands[2]) == 128
-             || (INTVAL (operands[2]) < 0
-                 && INTVAL (operands[2]) != -128)))
-       {
-         operands[2] = GEN_INT (-INTVAL (operands[2]));
-         return "sub{q}\t{%2, %0|%0, %2}";
-       }
+      gcc_assert (rtx_equal_p (operands[0], operands[1]));
+      if (x86_maybe_negate_const_int (&operands[2], DImode))
+       return "sub{q}\t{%2, %0|%0, %2}";
+
       return "add{q}\t{%2, %0|%0, %2}";
 
-    case TYPE_LEA:
+    default:
       operands[2] = SET_SRC (XVECEXP (PATTERN (insn), 0, 0));
       return "lea{q}\t{%a2, %0|%0, %a2}";
-
-    default:
-      gcc_unreachable ();
     }
 }
   [(set (attr "type")