Commit Graph

314 Commits

Author SHA1 Message Date
Mark Mitchell b3f8d95d35 configure.in (arm*-*-eabi*): New target.
* configure.in (arm*-*-eabi*): New target.
	* configure: Regenerate.

	* configure.ac (arm*-*-eabi*): New target.
	(arm*-*-symbianelf*): Likewise.
	* configure: Regenerated.

	* config.gcc (arm*-*-eabi*): New target.
	* defaults.h (TARGET_LIBGCC_FUNCS): New macro.
	(TARGET_LIB_INT_CMP_BIASED): Likewise.
	* expmed.c (expand_divmod): Try a two-valued divmod function as a
	last resort.
	* gthr.h: Remove bogus tokens at end of #pragma.
	* optabs.c (expand_twoval_binop_libfunc): New function.
	(prepare_cmp_insn): Handle the !TARGET_LIB_INT_CMP_BIASED case.
	(prepare_float_lib_cmp): Try reversing the condition.
	(debug_optab_libfuncs): New function.
	* optabs.h (expand_twoval_binop_libfunc): Declare.
	* config/arm/arm.c (arm_init_libfuncs): New function.
	(arm_compute_initial_eliminatino_offset): Return HOST_WIDE_INT.
	(TARGET_INIT_LIBFUNCS): Define it.
	* config/arm/arm.h (TARGET_BPABI): New macro.
	* config/arm/arm-protos.h
	(arm_compute_initial_elimination_offset): Return HOST_WIDE_INT.
	* config/arm/bpabi.S: New file.
	* config/arm/bpabi.c: Likewise.
	* config/arm/bpabi.h: Likewise.
	* config/arm/ieee754-df.S (__aeabi_dneg): New function or alias.
	(__aeabi_drsub): Likewise.
	(__aeabi_dsub): Likewise.
	(__aeabi_dadd): Likewise.
	(__aeabi_ui2d): Likewise.
	(__aeabi_i2d): Likewise.
	(__aeabi_f2d): Likewise.
	(__aeabi_dmul): Likewise.
	(__aeabi_ddiv): Likewise.
	(__aeabi_cdrcmple): Likewise.
	(__aeabi_cdcmpeq): Likewise.
	(__aeabi_cdcmple): Likewise.
	(__aeabi_dcmpeq): Likewise.
	(__aeabi_dcmplt): Likewise.
	(__aeabi_dcmple): Likewise.
	(__aeabi_dcmpge): Likewise.
	(__aeabi_dcmpgt): Likewise.
	(__aeabi_dcmpun): Likewise.
	(__aeabi_d2iz): Likewise.
	(__aeabi_d2uiz): Likewise.
	(__aeabi_d2f): Likewise.
	* config/arm/ieee754-sf.S (__aeabi_fneg): New function or alias.
	(__aeabi_frsub): Likewise.
	(__aeabi_fsub): Likewise.
	(__aeabi_fadd): Likewise.
	(__aeabi_ui2f): Likewise.
	(__aeabi_i2f): Likewise.
	(__aeabi_fmul): Likewise.
	(__aeabi_fdiv): Likewise.
	(__aeabi_cfrcmple): Likewise.
	(__aeabi_cfcmpeq): Likewise.
	(__aeabi_cfcmple): Likewise.
	(__aeabi_fcmpeq): Likewise.
	(__aeabi_fcmplt): Likewise.
	(__aeabi_fcmple): Likewise.
	(__aeabi_fcmpge): Likewise.
	(__aeabi_fcmpgt): Likewise.
	(__aeabi_fcmpun): Likewise.
	(__aeabi_f2iz): Likewise.
	(__aeabi_f2uiz): Likewise.
	* config/arm/lib1funcs.asm (ARM_CALL): New macro.
	(__aeabi_uidivmod): New function or alias.
	(__aeabi_idivmod): Likewise.
	(__aeabi_idiv0): Likewise.
	(__aeabi_ldiv0): Likewise.
	(__aeabi_llsr): Likewise.
	(__aeabi_lasr): Likewise.
	(__aeabi_llsl): Likewise.
	(bpabi.S): Include it.
	* config/arm/libgcc-bpabi.ver: New file.
	* config/arm/symbian.h (ARM_DEFAULT_ABI): Remove.
	(LINK_SPEC): Remove.
	* config/arm/t-arm-elf (LIB1ASMFUNCS): Add __aeabi_lcmp and
	__aeabi_ulcmp.
	* config/arm/t-bpabi: New file.
	* doc/tm.texi (TARGET_LIBGCC_FUNCS): New entry.
	(TARGET_LIB_INT_CMP_BIASED): Likewise.

	* gcc.dg/testsuite/gcc.dg/arm-eabi1.c: New test.
	* gcc.dg/dll-2.c: Fix dg-require syntax.
	* gcc.misc-tests/arm-isr.c (abort): Declare.
	(exit): Likewise.

From-SVN: r85788
2004-08-11 02:50:14 +00:00
Roger Sayle fdded40102 expmed.c (sdiv_pow2_cheap, [...]): Change type to bool.
* expmed.c (sdiv_pow2_cheap, smod_pow2_cheap): Change type to bool.
	(init_expmed): Fix potential overrun problem with "all.reg".
	(expand_sdiv2_pow2): Add an alternate implementation for signed
	division, if the target provides a suitable conditional move insn.

From-SVN: r85728
2004-08-09 22:36:39 +00:00
Roger Sayle 3244e67d15 convert.c (convert_to_real, [...]): Replace calls to build with calls to buildN.
* convert.c (convert_to_real, convert_to_integer,
	convert_to_complex): Replace calls to build with calls to buildN.
	* coverage.c (tree_coverage_counter_ref): Likewise.
	* dojump.c (do_jump): Likewise.
	* dwarf2out.c (loc_descriptor_from_tree): Likewise.
	* emit-rtl.c (component_ref_for_mem_expr,
	set_mem_attributes_minus_bitpos): Likewise.
	* explow.c (update_nonlocal_goto_save_area): Likewise.
	* expmed.c (expand_shift, make_tree, const_mult_add_overflow_p,
	expand_mult_add): Likewise.
	* expr.c (emit_block_move_via_libcall, clear_storage_via_libcall,
	store_constructor, get_inner_reference, expand_expr_real_1,
	try_casesi, try_tablejump): Likewise.
	* function.c (expand_function_start): Likewise.
	* stmt.c (emit_case_bit_tests, expand_end_case_type,
	node_has_low_bound, node_has_high_bound, emit_case_nodes): Likewise.
	* stor-layout.c (place_union_field, layout_type): Likewise.
	* tree.c (substitute_in_expr, tree_fold_gcd): Likewise.
	* varasm.c (copy_constant): Likewise.

From-SVN: r85160
2004-07-25 19:15:50 +00:00
Roger Sayle 8b91e18c05 expmed.c (init_expmed): A signed modulus by a power of two is considered cheap if...
* expmed.c (init_expmed): A signed modulus by a power of two is
	considered cheap if its less than or equal to four instructions.

From-SVN: r85134
2004-07-25 00:25:28 +00:00
Roger Sayle 39cab01994 expmed.c (expand_sdiv_pow2): New function to expand signed division by a positive power of two...
* expmed.c (expand_sdiv_pow2): New function to expand signed division
	by a positive power of two, split out from expand_divmod.  Provide
	an alternate implementation when shifts are expensive.  Lower the
	threshold for using a branchless implementation to BRANCH_COST >= 2.
	(expand_divmod): Call expand_sdiv_pow2 for suitable divisions.

From-SVN: r84686
2004-07-14 13:50:39 +00:00
Paolo Bonzini 96985307d9 expmed.c: Remove more references to QUEUED in the comments.
2004-07-14  Paolo Bonzini  <bonzini@gnu.org>

	* expmed.c: Remove more references to QUEUED in the comments.
	* expr.c: Likewise.

From-SVN: r84678
2004-07-14 08:49:30 +00:00
Paolo Bonzini ad76cef84c expr.c (enqueue_insn, [...]): Remove.
2004-07-14  Paolo Bonzini  <bonzini@gnu.org>

	* expr.c (enqueue_insn, finish_expr_for_function,
	protect_from_queue, queued_subexp_p, mark_queue,
	emit_insns_enqueued_after_mark, emit_queue,
	expand_increment): Remove.
	(store_constructor): Expand increment as an assignment.
	(expand_expr_real_1 <case PREINCREMENT_EXPR,
	case PREDECREMENT_EXPR, case POSTINCREMENT_EXPR,
	case POSTDECREMENT_EXPR>): Abort.
	* expr.h (QUEUED_VAR, QUEUED_INSN, QUEUED_COPY,
	QUEUED_BODY, QUEUED_NEXT, finish_expr_for_function,
	protect_from_queue, emit_queue, queued_subexp_p): Remove.
	* function.h (pending_chain, x_pending_chain): Remove.
	* rtl.def (QUEUED): Remove.

	* emit-rtl.c (copy_insn_1, copy_most_rtx,
	set_used_flags, verify_rtx_sharing): Remove references to QUEUED.
	* genattrtab.c (attr_copy_rtx, clear_struct_flag,
	encode_units_mask): Likewise.
	* local-alloc.c (equiv_init_varies_p): Likewise.
	* rtl.c (copy_rtx): Likewise.
	* rtlanal.c (rtx_unstable_p, rtx_varies_p): Likewise.
	* simplify-rtx.c (simplify_gen_subreg): Likewise.
	* config/mn10300/mn10300.c (legitimate_pic_operand_p): Likewise.

	* builtins.c (expand_builtin, expand_builtin_apply,
	expand_builtin_mathfn, expand_builtin_mathfn_2,
	expand_builtin_mathfn_3, expand_builtin_setjmp_setup):
	Remove calls to emit_queue and protect_from_queue.
	* calls.c (expand_call, precompute_arguments,
	precompute_register_parameters, rtx_for_function_call,
	store_one_arg): Likewise.
	* dojump.c (do_compare_and_jump, do_jump): Likewise.
	* explow.c (memory_address): Likewise.
	* expmed.c (clear_by_pieces_1, clear_storage,
	clear_storage_via_libcall, emit_group_load,
	emit_group_store, emit_store_flag,
	expand_expr_real_1, store_by_pieces,
	store_constructor, store_expr, try_casesi,
	try_tablejump): Likewise.
	* function.c (expand_pending_sizes): Likewise.
	* optabs.c (emit_cmp_and_jump_insns,
	emit_conditional_add, emit_conditional_move,
	expand_fix, expand_float, prepare_cmp_insn): Likewise.
	* stmt.c (emit_case_bit_tests,
	expand_asm_expr, expand_computed_goto,
	expand_decl_init, expand_end_case_type,
	expand_end_stmt_expr, expand_expr_stmt_value,
	expand_return, expand_start_case,
	optimize_tail_recursion): Likewise.
	* config/c4x/c4x.c (c4x_expand_builtin): Likewise.
	* config/s390/s390.c (s390_expand_cmpmem): Likewise.

From-SVN: r84675
2004-07-14 07:30:23 +00:00
Richard Henderson 79b4a8dcfb expmed.c (init_expmed): Use stack-local structures for temporary rtl.
* expmed.c (init_expmed): Use stack-local structures for
        temporary rtl.  Don't recognize shifts.

From-SVN: r84502
2004-07-11 04:20:44 -07:00
Jakub Jelinek b352098021 expr.h (store_bit_field, [...]): Remove last argument.
* expr.h (store_bit_field, extract_bit_field): Remove last argument.
	* expmed.c (store_bit_field, extract_bit_field): Remove last
	argument.
	* builtins.c (expand_builtin_signbit): Adjust callers.
	* optabs.c (expand_vector_binop, expand_vector_unop): Likewise.
	* calls.c (store_unaligned_arguments_into_pseudos): Likewise.
	* ifcvt.c (noce_emit_move_insn): Likewise.
	* stmt.c (expand_return): Likewise.
	* expr.c (emit_group_load, emit_group_store, copy_blkmode_from_reg,
	store_field, expand_expr_real_1): Likewise.

From-SVN: r84447
2004-07-10 10:04:58 +02:00
Jan Beulich b42271d678 expmed.c (extract_bit_field): Correct condition to use vec_extract patterns also on vector elements other...
* expmed.c (extract_bit_field): Correct condition to use vec_extract
        patterns also on vector elements other than the first one.
        * config/i386/i386.md (vec_extractv2df, vec_extractv4sf): Add missing
        break statements.

From-SVN: r84316
2004-07-08 14:52:36 -07:00
Jan Beulich 884815aa85 expmed.c (emit_store_flag): Also special-case double-word (in-)equality comparison against -1.
* expmed.c (emit_store_flag): Also special-case double-word
        (in-)equality comparison against -1.

From-SVN: r84268
2004-07-07 23:08:52 -07:00
Richard Henderson 8fff4fc136 rtl.def (ADDRESSOF): Remove.
* rtl.def (ADDRESSOF): Remove.
	* alias.c (rtx_equal_for_memref_p): Don't handle addressof.
	(find_base_term, memrefs_conflict_p): Likewise.
	* cse.c (fixed_base_plus_p, find_best_addr: Likewise.
	(fold_rtx, cse_insn, set_live_p): Likewise.
	* dwarf2out.c (mem_loc_descriptor): Likewise.
	(add_location_or_const_value_attribute): Likewise.
	* emit-rtl.c (copy_insn_1): Likewise.
	* explow.c (memory_address): Likewise.
	* expmed.c (store_split_bit_field): Likewise.
	* expr.c (expand_expr_real_1): Likewise.
	* function.c (instantiate_decl
	(instantiate_virtual_regs_1, fix_lexical_addr): Likewise.
	* genrecog.c (preds, validate_pattern): Likewise.
	* integrate.c (copy_rtx_and_substitute): Likewise.
	* recog.c (general_operand, register_operand): Likewise.
	(memory_address_p): Likwise.
	* reload1.c (eliminate_regs, elimination_effects): Likewise.
	* rtl.c (copy_rtx): Likewise.
	* rtlanal.c (rtx_unstable_p, rtx_varies_p): Likewise.
	(rtx_addr_can_trap_p, nonzero_address_p, address_cost): Likewise.
	* rtlhooks.c (gen_lowpart_general): Likewise.
	* stmt.c (expand_asm_operands): Likewise.
	* web.c (entry_register, replace_ref, web_main): Likewise.
	* config/alpha/alpha.c (input_operand, alpha_legitimate_address_p,
	alpha_expand_block_move, alpha_expand_block_clear): Likewise.
	* config/arm/arm.c (thumb_rtx_costs): Likewise.
	* config/c4x/c4x.c (c4x_valid_operands): Likewise.
	* config/frv/frv.c (move_destination_operand, move_source_operand,
	condexec_dest_operand, condexec_source_operand,
	condexec_memory_operand): Likewise.
	* config/h8300/h8300.h (PREDICATE_CODES): Likewise.
	* config/ia64/ia64.c (general_xfmode_operand): Likewise.
	(destination_xfmode_operand): Likewise.
	* config/mips/mips.h (PREDICATE_CODES): Likewise.
	* config/mn10300/mn10300.c (mn10300_address_cost_1): Likewise.
	* config/s390/s390.c (general_s_operand): Likewise.
	* config/s390/s390.md (mov*): Likewise.
	* config/sparc/sparc.h (PREDICATE_CODES): Likewise.

	* c-typeck.c (c_mark_addressable): Don't put_var_into_stack.
	* expr.c (expand_expr_real_1): Likewise.
	* stmt.c (expand_decl): Likewise.
	* config/c4x/c4x.c (c4x_expand_builtin): Likewise.

	* function.c (struct fixup_replacement, struct insns_for_mem_entry,
	postponed_insns, put_var_into_stack, put_reg_into_stack,
	schedule_fixup_var_refs, fixup_var_refs, find_fixup_replacement,
	fixup_var_refs_insns, fixup_var_refs_insns_with_hash,
	fixup_var_refs_insn, fixup_var_refs_1, fixup_memory_subreg,
	walk_fixup_memory_subreg, fixup_stack_1, optimize_bit_field,
	gen_mem_addressof, flush_addressof, put_addressof_into_stack,
	purge_bitfield_addressof_replacements, purge_addressof_replacements,
	purge_addressof_1, insns_for_mem_hash, insns_for_mem_comp,
	struct insns_for_mem_walk_info, insns_for_mem_walk,
	compute_insns_for_mem, is_addressof, purge_addressof, setjmp_protect,
	setjmp_protect_args): Remove.
	(push_function_context_to): Don't handle var_refs_queue.
	(pop_function_context_from, free_after_compilation): Likewise.
	(instantiate_virtual_regs): Don't handle parm_reg_stack_loc.
	(assign_parms, allocate_struct_function): Likewise.
	(use_register_for_decl): New.
	(expand_function_end): Don't setjmp_protect.
	* function.h (struct emit_status): Update commentary.
	(struct function): Remove x_max_parm_reg, x_parm_reg_stack_loc.
	(max_parm_reg, parm_reg_stack_loc): Remove.
	* passes.c (DFI_addressof): Remove.
	(dump_file_info): Remove addressof.
	(rest_of_handle_addressof): Remove.
	(rest_of_compilation): Don't call it.
	* rtl.h (ADDRESSOF_REGNO, ADDRESSOF_DECL): Remove.
	* stmt.c (expand_decl): Use use_register_for_decl.
	* tree.h: Update decls.
	* web.c (mark_addressof): Remove.
	* doc/invoke.texi (-dF): Remove.

ada/
        * utils2.c (gnat_mark_addressable): Don't put_var_into_stack.
cp/
        * typeck.c (cxx_mark_addressable): Don't put_var_into_stack.
fortran/
        * f95-lang.c (gfc_mark_addressable): Don't put_var_into_stack.
treelang/
        * treetree.c (tree_mark_addressable):  Don't put_var_into_stack.

From-SVN: r84072
2004-07-04 01:07:15 -07:00
Richard Henderson 8a0aa06e00 * expmed.c (make_tree): Don't use SET_DECL_RTL.
From-SVN: r84023
2004-07-02 10:32:23 -07:00
Richard Henderson 4dfa034295 tree.def (RTL_EXPR): Remove.
* tree.def (RTL_EXPR): Remove.
        * c-typeck.c (lvalue_p): Don't handle it.
        * expr.c (safe_from_p): Likewise.
        (expand_expr_real_1): Likewise.
        * fold-const.c (non_lvalue, operand_equal_p, fold): Likewise.
        (fold_checksum_tree, tree_expr_nonnegative_p): Likewise.
        * gengtype.c (adjust_field_tree_exp): Likewise.
        * stmt.c (warn_if_unused_value): Likewise.
        * tree-gimple.c (recalculate_side_effects): Likewise.
        * tree-pretty-print.c (dump_generic_node): Likewise.
        * tree.c (make_node_stat, first_rtl_op, unsave_expr_1): Likewise.
        (unsafe_for_reeval, stabilize_reference, build1_stat): Likewise.
        * tree.h (RTL_EXPR_SEQUENCE, RTL_EXPR_RTL, RTL_EXPR_ALT_RTL): Remove.

        * stmt.c (struct stmt_status): Remove x_last_expr_type,
        x_last_expr_value, x_last_expr_alt_rtl, x_expr_stmts_for_value.
        (last_expr_type, last_expr_value, last_expr_alt_rtl): Remove.
        (expand_expr_stmt): Merge with expand_expr_stmt_value.  Remove
        all the bits that tracked last_expr.
        (expand_end_bindings): Don't track last_expr.
        (expand_start_stmt_expr, expand_end_stmt_expr): Remove.
        (clear_last_expr): Remove.
        (expand_asm): Don't call it.
        (expand_asm_operands, expand_end_cond): Likewise.
        (expand_naked_return, expand_null_return_1): Likewise.
        * c-typeck.c (c_begin_compound_stmt): Likewise.
        * cfgexpand.c (expand_block): Use expand_expr_stmt.
        * expr.c (expand_expr_real_1): Likewise.
        * tree.h: Update prototypes.

        * function.h (struct sequence_stack): Remove sequence_rtl_expr.
        (struct emit_status): Remove sequence_rtl_expr.
        (struct function): Remove x_rtl_expr_chain.
        (seq_rtl_expr, rtl_expr_chain): Remove.
        * function.c (struct temp_slot): Remove rtl_expr.
        (assign_stack_temp_for_type): Don't set it.
        (free_temp_slots, pop_temp_slots): Don't check it.
        (free_after_compilation): Don't clear x_rtl_expr_chain.
        (fixup_var_refs): Don't search it.
        (preserve_rtl_expr_result, free_temps_for_rtl_expr): Remove.
        * emit-rtl.c (start_sequence): Don't use sequence_rtl_expr
        or seq_rtl_expr.
        (push_topmost_sequence): Likewise.
        (end_sequence, init_emit): Likewise.
        (start_sequence_for_rtl_expr): Remove.
        * expmed.c (make_tree): Build a VAR_DECL instead of an RTL_EXPR.
        * rtl.h (preserve_rtl_expr_result): Remove.

ada/
        * trans.c (gnat_stabilize_reference): Don't handle RTL_EXPR.
        * utils.c (max_size): Likewise.

cp/
        * class.c (fixed_type_or_null): Don't handle RTL_EXPR.
        * method.c (synthesize_method): Don't clear_last_expr.
        * name-lookup.c (maybe_push_cleanup_level): Likewise.

From-SVN: r84009
2004-07-01 18:15:43 -07:00
Jerry Quinn 3c0cb5de6a alias.c (get_alias_set, [...]): Use MEM_P.
2004-07-01  Jerry Quinn  <jlquinn@optonline.net>

	* alias.c (get_alias_set, canon_rtx, get_addr,
	nonoverlapping_memrefs_p, nonlocal_referenced_p_1, memory_modified_1):
	Use MEM_P.
	* builtins.c (expand_builtin_prefetch, expand_builtin_profile_func,
	expand_builtin): Likewise.
	* calls.c (expand_call, emit_library_call_value_1, store_one_arg):
	Likewise.
	* combine.c (can_combine_p, combinable_i3pat, try_combine,
	find_split_point, combine_simplify_rtx, simplify_set, make_extraction,
	rtx_equal_for_field_assignment_p, gen_lowpart_for_combine,
	record_dead_and_set_regs_1, get_last_value_validate,
	mark_used_regs_combine, move_deaths, unmentioned_reg_p_1): Likewise.
	* cse.c (check_dependence, canon_hash, equiv_constant,
	gen_lowpart_if_possible, cse_insn, invalidate_from_clobbers,
	cse_around_loop, cse_check_loop_start, cse_set_around_loop,
	count_reg_usage): Likewise.
	* cselib.c (rtx_equal_for_cselib_p, add_mem_for_addr, cselib_lookup,
	cselib_invalidate_mem, cselib_invalidate_rtx, cselib_record_set,
	cselib_record_sets): Likewise.
	* dbxout.c (PARM_PASSED_IN_MEMORY, dbxout_symbol,
	dbxout_symbol_location, dbxout_parms, dbxout_reg_parms): Likewise.
	* ddg.c (mark_mem_use, mark_mem_store, rtx_mem_access_p): Likewise.
	* df.c (df_uses_record): Likewise.
	* dojump (do_jump): Likewise.
	* dwarf2out.c (stack_adjust_offset, mem_loc_descriptor,
	loc_descriptor_from_tree, rtl_for_decl_location, add_bound_info,
	decl_start_label): Likewise.
	* emit-rtl.c (gen_complex_constant_part, gen_highpart,
	operand_subword, change_address_1, make_safe_from): Likewise.
	* explow.c (break_out_memory_refs, copy_all_regs, validize_mem,
	stabilize, force_not_mem): Likewise.
	* expmed.c (store_bit_field, store_split_bit_field, extract_bit_field,
	expand_mult_const, expand_divmod, emit_store_flag): Likewise.
	* expr.c (convert_move, convert_modes, emit_block_move,
	emit_group_load, emit_group_store, clear_storage, emit_move_insn,
	emit_move_insn_1, expand_assignment, store_expr,
	store_constructor_field, store_constructor, store_field,
	force_operand, safe_from_p, expand_expr_real_1, expand_increment):
	Likewise.
	* final.c (cleanup_subreg_operands, alter_subreg,
	get_mem_expr_from_op): Likewise.
	* flow.c (notice_stack_pointer_modification_1,
	init_propagate_block_info, insn_dead_p, mark_set_1, mark_used_regs):
	Likewise.
	* function.c (mark_temp_addr_taken, preserve_temp_slots,
	preserve_rtl_expr_result, put_var_into_stack, fixup_var_refs_1,
	optimize_bit_field, flush_addressof, purge_addressof_1,
	instantiate_decl, instantiate_virtual_regs_1, assign_parms,
	setjmp_protect, setjmp_protect_args, fix_lexical_addr,
	keep_stack_depressed): Likewise.
	* ifcvt.c (noce_try_cmove_arith, noce_try_abs, noce_operand_ok,
	noce_process_if_block, find_memory): Likewise.
	* integrate.c (subst_constants, allocate_initial_values): Likewise.
	* local-alloc.c (validate_equiv_mem_from_store, memref_referenced_p,
	update_equiv_regs): Likewise.
	* loop.c (scan_loop, prescan_loop, note_addr_stored, check_store,
	maybe_eliminate_biv_1, find_mem_in_note_1): Likewise.
	* optabs.c (expand_abs, emit_unop_insn): Likewise.
	* passes.c (rest_of_handle_final): Likewise.
	* postreload.c (reload_cse_simplify_set, reload_cse_simplify_operands,
	move2add_note_store): Likewise.
	* ra-build.c (detect_remat_webs): Likewise.
	* ra-debug.c (dump_static_insn_cost): Likewise.
	* ra-rewrite.c (slots_overlap_p, insert_stores): Likewise.
	* recog.c (validate_change, apply_change_group, cancel_changes,
	validate_replace_rtx_1, general_operand, register_operand,
	nonmemory_operand, push_operand, pop_operand, memory_operand,
	indirect_operand, asm_operand_ok, offsettable_memref_p,
	offsettable_nonstrict_memref_p, constrain_operands,
	store_data_bypass_p): Likewise.
	* reg-stack.c (subst_stack_regs_pat): Likewise.
	* regclass.c (record_operand_costs, scan_one_insn, record_reg_classes,
	copy_cost, reg_scan_mark_refs): Likewise.
	* regmove.c (optimize_reg_copy_3, stack_memref_p,
	combine_stack_adjustments_for_block): Likewise.
	* regrename.c (copyprop_hardreg_forward_1): Likewise.
	* reload.c (can_reload_into, push_reload, decompose, immune_p,
	find_reloads, find_reloads_address, find_reloads_address_1,
	reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p,
	find_equiv_reg): Likewise.
	* reload1.c (reload, eliminate_regs, eliminate_regs_in_insn,
	reload_as_needed, choose_reload_regs, emit_input_reload_insns,
	do_input_reload, emit_reload_insns, gen_reload, delete_output_reload,
	delete_address_reloads): Likewise.
	* resource.c (mark_referenced_resources): Likewise.
	* rtlanal.c (get_jump_table_offset, count_occurrences,
	reg_referenced_p, reg_set_p, set_of_1, set_noop_p,
	reg_overlap_mentioned_p, note_uses, replace_regs, nonzero_bits1,
	num_sign_bit_copies1): Likewise.
	* rtlhooks.c (gen_lowpart_general): Likewise.
	* sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise.
	* sdbout.c (PARM_PASSED_IN_MEMORY, sdbout_symbol,
	sdbout_toplevel_data, sdbout_parms, sdbout_reg_parms,
	sdbout_global_decl): Likewise.
	* simplify-rtx.c (simplify_subreg): Likewise.
	* stmt.c (expand_asm_operands, expand_expr_stmt_value, expand_decl,
	expand_anon_union_decl, expand_end_case_type): Likewise.
	* unroll.c (calculate_giv_inc): Likewise.
	* var-tracking.c (stack_adjust_offset_pre_post,
	bb_stack_adjust_offset, track_expr_p, count_uses, add_uses,
	add_stores, compute_bb_dataflow, vt_get_decl_and_offset,
	vt_add_function_parameters): Likewise.
	* varasm.c (make_var_volatile, notice_global_symbol,
	assemble_external, decode_addr_const, mark_weak,
	default_encode_section_info): Likewise.

From-SVN: r83980
2004-07-01 12:52:53 +00:00
Roger Sayle 15bad393a1 expmed.c (expand_shift): Consider expanding LSHIFT_EXPR by a constant as a sequence of additions...
* expmed.c (expand_shift): Consider expanding LSHIFT_EXPR by a
	constant as a sequence of additions depending upon the rtx_costs.
	(synth_mult): Update the "observed" cost of a shift, based upon
	the above optimization.

From-SVN: r83956
2004-07-01 04:27:09 +00:00
J"orn Rennecke 4c6fd544cc * expmed.c (expand_smod_pow2): Fix sign of mask.
From-SVN: r83905
2004-06-30 13:30:00 +01:00
Roger Sayle 1c234fcb72 expmed.c (expand_smod_pow2): Provide alternate implementations that avoid conditional jumps...
* expmed.c (expand_smod_pow2): Provide alternate implementations
	that avoid conditional jumps, and choose between them based upon
	the target's rtx_costs.

From-SVN: r83861
2004-06-29 17:13:08 +00:00
Roger Sayle 0b55e93214 expmed.c (expand_smod_pow2): New function to expand signed remainder by a constant power of 2, such as "x % 16".
* expmed.c (expand_smod_pow2): New function to expand signed
	remainder by a constant power of 2, such as "x % 16".
	(expand_divmod): Call new expand_smod_pow2 when appropriate.
	Minor corrections to comments, e.g. wrapping long lines.

From-SVN: r83815
2004-06-28 20:49:37 +00:00
Roger Sayle 7906648201 re PR middle-end/15239 (suboptimal mult-by-const expansion cost limit)
PR middle-end/15239
	* expmed.c (expand_mult): Remove artificial restriction on the
	maximum cost of a synthetic multiplication sequence.

From-SVN: r83610
2004-06-24 20:38:59 +00:00
Zack Weinberg 42eb30b557 expmed.c (expand_mult_const): In sanity check...
* expmed.c (expand_mult_const): In sanity check, compare only
	the bits of val and val_so_far that are significant in the
	result mode.

From-SVN: r83294
2004-06-17 17:03:11 +00:00
Jerry Quinn f8cfc6aa07 alias.c (record_set, [...]): Use REG_P.
2004-06-15  Jerry Quinn  <jlquinn@optonline.net>

	* alias.c (record_set, record_base_value, canon_rtx, get_addr,
	nonlocal_mentioned_p_1, init_alias_analysis): Use REG_P.
	* bt-load.c (find_btr_reference, insn_sets_btr_p, note_btr_set):
	Likewise.
	* builtins.c (expand_builtin_setjmp, expand_builtin_apply,
	expand_builtin_mathfn, expand_builtin_strlen, expand_builtin_memcmp,
	expand_builtin_strcmp, expand_builtin_strncmp,
	expand_builtin_frame_address): Likewise.
	* caller-save.c (mark_set_regs, add_stored_regs, mark_referenced_regs,
	insert_one_insn): Likewise.
	* calls.c (prepare_call_address, precompute_register_parameters,
	precompute_arguments, expand_call, emit_library_call_value_1): Likewise.
	* cfganal.c (flow_active_insn_p): Likewise.
	* combine.c (set_nonzero_bits_and_sign_copies, can_combine_p,
	combinable_i3pat, try_combine, find_split_point, COMBINE_RTX_EQUAL_P,
	subst, combine_simplify_rtx, simplify_if_then_else, simplify_set,
	make_extraction, recog_for_combine, gen_lowpart_for_combine,
	simplify_comparison, record_dead_and_set_regs_1,
	record_dead_and_set_regs, record_promoted_value,
	check_promoted_subreg, get_last_value_validate, get_last_value,
	reg_dead_at_p_1, reg_bitfield_target_p, distribute_notes,
	unmentioned_reg_p_1): Likewise.
	* conflict.c (mark_reg): Likewise.
	* cse.c (HASH, COST, COST_IN, approx_reg_cost_1, notreg_cost,
	mention_regs, insert_regs, lookup, lookup_for_remove, insert,
	merge_equiv_classes, flush_hash_table, invalidate,
	remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg,
	invalidate_for_call, use_related_value, canon_hash, exp_equiv_p,
	cse_rtx_varies_p, canon_reg, find_best_addr, fold_rtx, equiv_constant,
	record_jump_cond, cse_insn, addr_affects_sp_p,
	invalidate_from_clobbers, cse_process_notes, cse_around_loop,
	cse_set_around_loop, count_reg_usage, set_live_p, cse_change_cc_mode,
	cse_cc_succs, cse_condition_code_reg): Likewise.
	* cselib.c (cselib_reg_set_mode, rtx_equal_for_cselib_p,
	cselib_lookup, cselib_invalidate_regno, cselib_invalidate_rtx,
	cselib_record_set, cselib_record_sets): Likewise.
	* dbxout.c (dbxout_symbol_location, dbxout_parms, dbxout_reg_parms,
	dbxout_block): Likewise.
	* df.c (df_ref_record, df_def_record_1, df_uses_record): Likewise.
	* dojump.c (do_jump): Likewise.
	* dwarf2out.c (dwarf2out_frame_debug_expr, is_pseudo_reg,
	is_based_loc, rtl_for_decl_location): Likewise.
	* emit-rtl.c (set_reg_attrs_for_parm, set_decl_rtl,
	set_decl_incoming_rtl, mark_user_reg): Likewise.
	* explow.c (copy_all_regs, copy_all_regs, memory_address, force_reg,
	copy_to_suggested_reg, allocate_dynamic_stack_space,
	probe_stack_range, hard_function_value): Likewise.
	* expmed.c (store_bit_field, store_fixed_bit_field,
	store_split_bit_field, extract_bit_field, extract_fixed_bit_field,
	extract_split_bit_field, expand_divmod, emit_store_flag_force):
	Likewise.
	* expr.c (convert_move, convert_modes,
	block_move_libcall_safe_for_call_parm, emit_group_load, use_reg,
	use_group_regs, emit_move_insn, emit_move_insn_1,
	compress_float_constant, push_block, emit_single_push_insn,
	emit_push_insn, get_subtarget, expand_assignment, store_expr,
	store_constructor, store_field, force_operand, safe_from_p,
	expand_expr_real_1, expand_increment, do_store_flag, do_tablejump):
	Likewise.
	* final.c (profile_function, final_scan_insn, alter_subreg,
	get_mem_expr_from_op, output_asm_operand_names, output_operand,
	only_leaf_regs_used, leaf_renumber_regs_insn): Likewise.
	* flow.c (verify_wide_reg_1, mark_regs_live_at_end,
	find_regno_partial, propagate_one_insn, init_propagate_block_info,
	insn_dead_p, libcall_dead_p, mark_set_1, not_reg_cond,
	attempt_auto_inc, find_auto_inc, mark_used_regs,
	count_or_remove_death_notes_bb): Likewise.
	* function.c (find_temp_slot_from_address, update_temp_slot_address,
	preserve_temp_slots, put_var_into_stack, fixup_var_refs_insn,
	fixup_var_refs_1, fixup_stack_1, optimize_bit_field, flush_addressof,
	put_addressof_into_stack, purge_addressof_1, insns_for_mem_walk,
	purge_single_hard_subreg_set, instantiate_decl,
	instantiate_virtual_regs_1, aggregate_value_p, assign_parms,
	promoted_input_arg, setjmp_vars_warning, setjmp_args_warning,
	setjmp_protect, setjmp_protect_args, fix_lexical_addr,
	expand_function_start, diddle_return_value, clobber_return_register,
	expand_function_end, keep_stack_depressed, handle_epilogue_set,
	update_epilogue_consts): Likewise.
	* genemit.c (gen_exp, gen_insn): Likewise.
	* genrecog.c (make_insn_sequence): Likewise.
	* global.c (global_conflicts, expand_preferences, mark_reg_store,
	mark_reg_conflicts, set_preference, reg_becomes_live,
	build_insn_chain, mark_reg_change): Likewise.
	* haifa_sched.c (CONST_BASED_ADDRESS_P, find_set_reg_weight):
	Likewise.
	* ifcvt.c (noce_try_abs, noce_get_condition, noce_process_if_block):
	Likewise.
	* integrate.c (copy_rtx_and_substitute, try_constants,
	subst_constants, mark_stores, allocate_initial_values): Likewise.
	* jump.c (reversed_comparison_code_parts, delete_prior_computation,
	delete_computation, rtx_renumbered_equal_p, true_regnum,
	reg_or_subregno): Likewise.
	* lcm.c (reg_dies, reg_becomes_live): Likewise.
	* local-alloc.c (validate_equiv_mem_from_store, validate_equiv_mem,
	update_equiv_regs, no_equiv, block_alloc, combine_regs, reg_is_set,
	wipe_dead_reg, no_conflict_p): Likewise.
	* loop-iv.c (simple_reg_p, simple_set_p, kill_sets,
	iv_get_reaching_def, iv_analyze_biv, altered_reg_used, mark_altered,
	simple_rhs_p, simplify_using_assignment, implies_p): Likewise.
	* loop.c (scan_loop, combine_movables, rtx_equal_for_loop_p,
	move_movables, note_set_pseudo_multiple_uses, consec_sets_invariant_p,
	find_single_use_in_loop, count_one_set, loop_bivs_init_find,
	loop_givs_rescan, check_insn_for_bivs, check_insn_for_givs,
	valid_initial_value_p, simplify_giv_expr, consec_sets_giv,
	loop_regs_update, check_dbra_loop, maybe_eliminate_biv,
	maybe_eliminate_biv_1, record_initial, update_reg_last_use,
	canonicalize_condition, loop_regs_scan, load_mems, try_copy_prop,
	try_swap_copy_prop): Likewise.
	* optabs.c (expand_binop, expand_vector_binop, expand_vector_unop,
	expand_abs, emit_no_conflict_block, emit_libcall_block, expand_float):
	Likewise.
	* postreload.c (reload_cse_simplify, reload_cse_simplify_set,
	reload_cse_simplify_operands, reload_combine,
	reload_combine_note_store, reload_combine_note_use,
	reload_cse_move2add, move2add_note_store): Likewise.
	* print-rtl.c (print_rtx): Likewise.
	* ra-build.c (copy_insn_p, remember_move, init_one_web_common,
	contains_pseudo, handle_asm_insn): Likewise.
	* ra-debug.c (ra_print_rtx_object, dump_constraints,
	dump_static_insn_cost): Likewise.
	* ra-rewrite.c (slots_overlap_p, emit_colors,
	remove_suspicious_death_notes): Likewise.
	* recog.c (validate_replace_rtx_1, find_single_use_1, find_single_use,
	register_operand, scratch_operand, nonmemory_operand,
	constrain_operands): Likewise.
	* reg-stack (check_asm_stack_operands, remove_regno_note,
	emit_swap_insn, swap_rtx_condition, subst_stack_regs_pat,
	subst_asm_stack_regs): Likewise.
	* regclass.c (scan_one_insn, record_reg_classes, copy_cost,
	record_address_regs, reg_scan_mark_refs): Likewise.
	* regmove.c (discover_flags_reg, replacement_quality,
	copy_src_to_dest, reg_is_remote_constant_p, regmove_optimize,
	fixup_match_1): Likewise.
	* regrename.c (note_sets, clear_dead_regs, build_def_use, kill_value,
	kill_set_value, copyprop_hardreg_forward_1): Likewise.
	* reload.c (MATCHES, push_secondary_reload, find_reusable_reload,
	reload_inner_reg_of_subreg, can_reload_into, push_reload,
	combine_reloads, find_dummy_reload, hard_reg_set_here_p,
	operands_match_p, decompose, find_reloads, find_reloads_toplev,
	find_reloads_address, subst_indexed_address, find_reloads_address_1,
	find_reloads_subreg_address, find_replacement,
	refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p,
	refers_to_mem_for_reload_p, find_equiv_reg, regno_clobbered_p): Likewise.
	* reload1.c (replace_pseudos_in, reload, calculate_needs_all_insns,
	find_reg, delete_dead_insn, alter_reg, eliminate_regs,
	elimination_effects, eliminate_regs_in_insn, scan_paradoxical_subregs,
	forget_old_reloads_1, reload_reg_free_for_value_p, choose_reload_regs,
	emit_input_reload_insns, emit_output_reload_insns, do_input_reload,
	do_output_reload, emit_reload_insns, gen_reload,
	delete_address_reloads_1, inc_for_reload): Likewise.
	* reorg.c (update_reg_dead_notes, fix_reg_dead_note,
	update_reg_unused_notes, fill_slots_from_thread): Likewise.
	* resource.c (update_live_status, mark_referenced_resources,
	mark_set_resources, mark_target_live_regs): Likewise.
	* rtlanal.c (nonzero_address_p, get_jump_table_offset,
	global_reg_mentioned_p_1, reg_mentioned_p, reg_referenced_p,
	reg_set_p, set_noop_p, find_last_value, refers_to_regno_p,
	note_stores, dead_or_set_p, dead_or_set_regno_p, find_regno_note,
	find_reg_fusage, find_regno_fusage, replace_regs, regno_use_in,
	parms_set, find_first_parameter_load, keep_with_call_p,
	hoist_test_store, hoist_update_store, address_cost, nonzero_bits1,
	num_sign_bit_copies1): Likewise.
	* rtlhooks.c (gen_lowpart_general): Likewise.
	* sched-deps.c (deps_may_trap_p, sched_analyze_1, sched_analyze_insn,
	sched_analyze): Likewise.
	* sched-rgn.c (check_live_1, update_live_1, sets_likely_spilled_1):
	Likewise.
	* sdbout.c (sdbout_symbol, sdbout_parms, sdbout_reg_parms): Likewise.
	* simplify-rtx.c (simplify_replace_rtx, simplify_unary_operation,
	simplify_binary_operation, simplify_const_relational_operation,
	simplify_subreg): Likewise.
	* stmt.c (decl_conflicts_with_clobbers_p, expand_asm_operands,
	expand_end_stmt_expr, expand_return, expand_decl,
	expand_anon_union_decl): Likewise.
	* unroll.c (precondition_loop_p, calculate_giv_inc, copy_loop_body,
	find_splittable_regs, find_splittable_givs, find_common_reg_term,
	loop_iterations): Likewise.
	* var-tracking.c (variable_union, variable_part_different_p,
	variable_different_p, count_uses, add_uses, add_stores,
	compute_bb_dataflow, set_variable_part, delete_variable_part,
	emit_notes_in_bb, vt_get_decl_and_offset, vt_add_function_parameters):
	Likewise.
	* varasm.c (assemble_variable): Likewise.

From-SVN: r83195
2004-06-15 18:02:40 +00:00
Roger Sayle 0792ab197b expmed.c (synth_mult): Mask bits of the multiplier to the machine mode of the multiplication.
* expmed.c (synth_mult): Mask bits of the multiplier to the
	machine mode of the multiplication.  Don't consider shifts
	by more than (or equal to) the width of the operation's mode.

From-SVN: r83187
2004-06-15 15:06:14 +00:00
Roger Sayle 965703ed8e expmed.c (shift_cost, [...]): Additionally index by machine mode.
* expmed.c (shift_cost, shiftadd_cost, shiftsub_cost): Additionally
	index by machine mode.
	(init_expmed): Initialize shift_cost, shiftadd_cost and shiftsub_cost
	tables inside the loop over machine modes.
	(synth_mult, expand_mult_highpart_optab, expand_mult_highpart,
	expand_divmod): Index shift*_cost by the appropriate machine mode.

From-SVN: r83053
2004-06-13 02:46:08 +00:00
Roger Sayle 41c64ac012 expmed.c (synth_mult): Add an additional MODE argument for the machine mode of the multiplication.
* expmed.c (synth_mult): Add an additional MODE argument for the
	machine mode of the multiplication.  Update recursive calls.  Use
	mode instead of word_mode for determining operation costs.
	(choose_mult_variant): Update calls to synth_mult with "mode".

From-SVN: r83002
2004-06-11 21:34:23 +00:00
Richard Henderson bb394606fd * expmed.c (emit_store_flag): Cope with FLOAT_STORE_FLAG_VALUE.
From-SVN: r82854
2004-06-09 14:00:35 -07:00
Roger Sayle 5877771853 expmed.c (add_cost, [...]): Make arrays indexed by machine mode.
* expmed.c (add_cost, neg_cost, sdiv_pow2_cheap, smod_pow2_cheap):
	Make arrays indexed by machine mode.  Rename negate_cost to neg_cost.
	(init_expmed): Initialize these cost arrays as appropriate.
	(store_bit_field, extract_bit_field): Correct whitespace.
	(synth_mult, choose_mult_variant, expand_mult, expand_mult_highpart,
	expand_mult_highpart_optab, expand_divmod): Update uses of add_cost,
	neg_cost, sdiv_pow2_cheap, smod_pow2_cheap to index with mode,
	word_mode or compute_mode as appropriate.

From-SVN: r82743
2004-06-08 04:30:48 +00:00
Richard Henderson 5c64c9001b re PR rtl-optimization/15193 (Unary minus using pointer to V4SF vector causes -fforce-mem to exhaust all memory)
PR rtl-opt/15193
        * expmed.c (extract_bit_field): Fix vector_extract return.
        * config/i386/i386.md (negv4sf2): New pattern.

From-SVN: r82699
2004-06-07 10:21:05 -07:00
Kazu Hirata 9cf737f89f bb-reorder.c, [...]: Fix comment formatting.
* bb-reorder.c, builtins.c, c-common.c, c-gimplify.c,
	c-incpath.c, cgraphunit.c, ddg.c, defaults.h, dwarf2out.c,
	expmed.c, flags.h, gcc.c, gensupport.c, gimplify.c, global.c,
	passes.c, reg-stack.c, target.h, toplev.c, tree-alias-ander.c,
	tree-alias-common.c, tree-cfg.c, tree-complex.c, tree-dfa.c,
	tree-eh.c, tree-mudflap.c, tree-mudflap.h, tree-outof-ssa.c,
	tree-phinodes.c, tree-pretty-print.c, tree-ssa-alias.c,
	tree-ssa-ccp.c, tree-ssa-live.c, tree-ssa-live.h,
	tree-ssa-pre.c, tree.h, value-prof.h, varasm.c: Fix comment
	formatting.

From-SVN: r82463
2004-05-30 18:32:31 +00:00
Diego Novillo 6de9cd9a88 Merge tree-ssa-20020619-branch into mainline.
From-SVN: r81764
2004-05-13 02:41:07 -04:00
Ulrich Weigand 77278891d1 expmed.c (expand_mult_highpart_adjust): Do not assume OP1 is a CONST_INT.
* expmed.c (expand_mult_highpart_adjust): Do not assume OP1
	is a CONST_INT.
	(expand_mult_highpart_optab): Call expand_mult_highpart_adjust
	with NARROW_OP1 instead of OP1.

From-SVN: r81127
2004-04-24 01:03:11 +00:00
Richard Kenner 665acd1ef2 expmed.c (expand_mult_highpart_optab): Use narrower version of OP1 in two more places; remove unneeded force_reg
* expmed.c (expand_mult_highpart_optab): Use narrower version of OP1
	in two more places; remove unneeded force_reg

From-SVN: r80969
2004-04-21 13:02:19 -04:00
Richard Kenner 3d8f2528cc expmed.c (expand_mult_highpart_adjust): Make OP1 valid for MODE.
* expmed.c (expand_mult_highpart_adjust): Make OP1 valid for MODE.
	(expand_mult_highpart_optab): Likewise.
	(expand_mult_highpart): Make OP1 valid for WIDER_MODE, not MODE.

From-SVN: r80848
2004-04-19 08:02:02 -04:00
Richard Kenner 8df83eae1e builtins.c, [...]: Change most occurrences of TREE_UNSIGNED to TYPE_UNSIGNED.
* builtins.c, c-aux-info.c, c-common.c, c-cppbuiltin.c, c-decl.c:
	Change most occurrences of TREE_UNSIGNED to TYPE_UNSIGNED.
	* c-format.c, c-opts.c, c-pretty-print.c, c-typeck.c: Likewise.
	* calls.c, convert.c, dbxout.c, dojump.c, dwarf2out.c: Likewise.
	* expmed.c, expr.c, fold-const.c, function.c, integrate.c: Likewise.
	* optabs.c, sdbout.c, stmt.c, stor-layout.c, tree-dump.c: Likewise.
	* tree.c, config/iq2000/iq2000.c, config/m32r/m32r.c: Likewise.
	* config/mips/mips.c, config/rs6000/rs6000.c: Likewise.
	* config/s390/s390.c, config/sparc/sparc.c, objc/objc-act.c: Likewise.
	* stor-layout.c (layout_type, case COMPLEX_TYPE): Test for
	REAL_TYPE, not INTEGER_TYPE.
	(layout_type, case VECTOR_TYPE): Simplify code.
	* tree.c (build_vector_type_for_mode): Remove dup unsigned setting.
	* tree.h: Update comments.
	(STRIP_NOPS): Use TYPE_UNSIGNED.
	(TYPE_UNSIGNED): New macro.
	(TYPE_TRAP_SIGNED): Remove now redundant check.
	(SAVE_EXPR_NOPLACEHOLDER): Don't use TREE_UNSIGNED.

	* cp/call.c (joust): Use TYPE_UNSIGNED, not TREE_UNSIGNED.
	* cp/class.c (check_bitfield_decl): Likewise.
	* cp/cvt.c (type_promotes_to): Likewise.
	* cp/decl.c (finish_enum): Likewise.
	* cp/mangle.c (write_builtin_type): Likewise.
	* cp/semantics.c (finish_switch_cond, finish_unary_op_expr): Likewise.
	* cp/typeck.c (type_after_usual_arithmetic_conversions): Likewise.
	(build_binary_op): Likewise.

	* f/com.c (ffecom_arrayref_): Use TYPE_UNSIGNED, not TREE_UNSIGNED.
	(ffecom_expr_): Likewise.

	* java/jcf-write.c (generate_bytecode_insns): Use TYPE_UNSIGNED.

	* treelang/treetree.c (tree_lang_signed_or_unsigned_type):
	Use TYPE_UNSIGNED, not TREE_UNSIGNED.

	* ada/decl.c (gnat_to_gnu_entity, make_type_from_size):
	Use TYPE_UNSIGNED, not TREE_UNSIGNED.
	* ada/trans.c (tree_transform, convert_with_check): Likewise.
	* ada/utils.c (gnat_signed_or_unsigned_type): Likewise.
	(build_vms_descriptor, unchecked_convert): Likewise.
	* ada/utils2.c (nonbinary_modular_operation): Likewise.

From-SVN: r80287
2004-03-31 22:50:43 -05:00
Ulrich Weigand f258e38b1d expmed.c (choose_mult_variant): Pass MULT_COST as argument instead of using register multiplication cost.
* expmed.c (choose_mult_variant): Pass MULT_COST as argument instead
	of using register multiplication cost.
	(expand_mult): Adapt choose_mult_variant call.
	(expand_mult_highpart): Call choose_mult_variant with WIDER_MODE
	of MODE; pass appropriate cost bound.  Adjust result when
	performing signed multiplication by a negative constant.
	Don't use intermediate modes larger than word_mode.

From-SVN: r79792
2004-03-21 19:31:29 +00:00
Kazu Hirata d1a6adeb67 c-common.c, [...]: Fix comment typos.
* c-common.c, cfgcleanup.c, cgraphunit.c, c-pretty-print.c,
	expmed.c, ggc-common.c, jump.c, passes.c, recog.c, regmove.c,
	reorg.c, tree.h: Fix comment typos.

From-SVN: r79730
2004-03-20 05:21:41 +00:00
Richard Sandiford 8efc8980df expmed.c (choose_mult_variant, [...]): New, split from...
* expmed.c (choose_mult_variant, expand_mult_const): New, split from...
	(expand_mult): ...here.
	(extract_high_half): New, split out from expand_mult_highpart.
	(expand_highpart_optab): Likewise.  Don't clobber target prematurely.
	(expand_highpart): Evaluate the cost of a shift/add sequence,
	then see if any of the specialized optabs are cheaper.

From-SVN: r79673
2004-03-19 09:59:00 +00:00
Roger Sayle ae2bcd98fa alias.c (get_alias_set): Replace calls via (*lang_hooks.foo) () with lang_hooks.foo ().
* alias.c (get_alias_set): Replace calls via (*lang_hooks.foo) ()
	with lang_hooks.foo ().
	* builtins.c (expand_builtin_va_arg): Likewise.
	* c-common.c (fname_as_string, c_common_truthvalue_conversion,
	c_common_type_for_mode, c_common_nodes_and_builtins,
	handle_mode_attribute, handle_vector_size_attribute): Likewise.
	* c-convert.c (convert): Likewise.
	* c-format.c (check_format_types): Likewise.
	* c-objc-common.c (c_tree_printer): Likewise.
	* c-typeck.c (build_unary_op, build_conditional_expr,
	build_binary_op): Likewise.
	* calls.c (try_to_integrate, expand_call,
	emit_library_call_value_1): Likewise.
	* cgraph.c (cgraph_node_name, cgraph_function_possibly_inlined_p):
	Likewise.
	* cgraphunit.c (record_call_1, cgraph_analyze_function,
	cgraph_expand_function): Likewise.
	* convert.c (convert_to_pointer, convert_to_integer): Likewise.
	* coverage.c (build_fn_info_type, build_ctr_info_type,
	build_gcov_info, create_coverage): Likewise.
	* dbxout.c (dbxout_init): Likewise.
	* diagnostic.c (diagnostic_report_current_function): Likewise.
	* dojump.c (do_jump): Likewise.
	* dwarf2out.c (dwarf2_name): Likewise.
	* except.c (init_eh): Likewise.
	* explow.c (expr_size, int_expr_size): Likewise.
	* expmed.c (make_tree, const_mult_add_overflow_p, expand_mult_add):
	Likewise.
	* expr.c (store_expr, store_constructor, safe_from_p,
	expand_expr_real, do_store_flag, try_casesi): Likewise.
	* function.c (push_function_context_to, pop_function_context_from,
	free_after_parsing, assign_stack_local_1, assign_stack_temp_for_type,
	put_var_into_stack, allocate_struct_function, current_function_name):
	Likewise.
	* integrate.c (copy_decl_for_inlining, expand_inline_function):
	Likewise.
	* langhooks.c (lhd_clear_binding_stack, write_global_declarations,
	lhd_print_error_function): Likewise.
	* opts.c (handle_option, decode_options): Likewise.
	* passes.c (open_dump_file): Likewise.
	* print-tree.c (print_node): Likewise.
	* stmt.c (expand_fixup, fixup_gotos, expand_asm_operands,
	expand_decl_cleanup, emit_case_nodes): Likewise.
	* stor-layout.c (variable_size): Likewise.
	* toplev.c (announce_function, wrapup_global_declarations,
	check_global_declarations, compile_file, default_tree_printer,
	process_options, lang_dependent_init, finalize): Likewise.
	* tree-dump.c (dequeue_and_dump): Likewise.
	* tree-inline.c (remap_decl, remap_block, copy_body_r,
	initialize_inlined_parameters, declare_return_variable,
	inlinable_function_p, expand_call_inline, optimize_inline_calls,
	walk_tree, copy_tree_r): Likewise.
	* tree-optimize.c (tree_rest_of_compilation): Likewise.
	* tree.c (decl_assembler_name, tree_size, size_in_bytes, staticp,
	unsafe_for_reeval, get_unwidened, get_narrower, get_callee_fndecl,
	variably_modified_type_p, dump_tree_statistics): Likewise.
	* varasm.c (assemble_variable, compare_constant, copy_constant,
	force_const_mem, compute_reloc_for_constant, output_constant,
	output_addressed_constants, initializer_constant_valid_p): Likewise.

From-SVN: r79481
2004-03-14 22:26:14 +00:00
Kazu Hirata bee07d3f4f combine.c (SHIFT_COUNT_TRUNCATED): Remove.
* combine.c (SHIFT_COUNT_TRUNCATED): Remove.
	* defaults.h (SHIFT_COUNT_TRUNCATED): Provide the default.
	* expmed.c: Assume SHIFT_COUNT_TRUNCATED is always defined.
	* fold-const.c: Likewise.
	* simplify-rtx.c: Likewise.

From-SVN: r78230
2004-02-21 18:41:48 +00:00
Kazu Hirata d9221e016b alias.c, [...]: Update copyright.
* alias.c, basic-block.h, c-common.c, c-common.h,
	c-cppbuiltin.c, c-opts.c, c-pragma.c, c-pretty-print.c,
	calls.c, cfg.c, cfgcleanup.c, cfgrtl.c, cgraph.h, collect2.c,
	combine.c, cppcharset.c, cpphash.h, cppinit.c, cpplib.c,
	cpplib.h, cppmacro.c, crtstuff.c, cselib.c, cselib.h,
	defaults.h, df.c, dominance.c, et-forest.c, expmed.c, expr.c,
	expr.h, fix-header.c, function.h, gcc.c, gcse.c, genattrtab.c,
	genautomata.c, genconditions.c, genemit.c, genflags.c,
	gengtype.c, gengtype.h, genopinit.c, genrecog.c, gensupport.c,
	ggc-zone.c, graph.c, haifa-sched.c, input.h, integrate.c,
	langhooks-def.h, langhooks.c, langhooks.h, line-map.c,
	line-map.h, local-alloc.c, optabs.c, optabs.h, postreload.c,
	ra.h, recog.c, reg-stack.c, regmove.c, reload.c, reorg.c,
	rtl.c, sched-deps.c, sched-ebb.c, sdbout.c, system.h,
	target.h, targhooks.c, toplev.h, tree-inline.c, unwind-pe.h,
	unwind.h, varray.c, varray.h: Update copyright.

From-SVN: r76302
2004-01-21 20:40:04 +00:00
Jan Hubicka 997404de62 expmed.c (store_bit_field, [...]): Use new named patterns
* expmed.c (store_bit_field, extract_bit_field): Use new named patterns
	* expr.c (store_constructor): Use vec_init pattern.
	* genopinit.c (optabs): Initailize vec_set/vec_extract/vec_init.
	* optabs.h (optab_index): ADD OTI_vec_set/OTI_vec_extract/OTI_vec_init
	(vec_set_optab, vec_extract_optab, vec_init_optab): New.
	* i386.md (vec_setv2df, vec_extractv2df, vec_setv4sf, vec_extractv4sf):
	New patterns.
	(sse2_unpc?pd): Fix pattern.
	(sse2_movlpd): Kill.
	(sse2_movsd): Deal with movlpd too.
	* i386.c (ix86_expand_builtin): Use sse2_movsd instead of sse2_movlpd.
	(ix86_expand_vector_init): New.
	* emmintrin.h (__mm_set_pd, __mm_set_ps): Use vector extensions.
	* md.texi (vec_set, vec_extract): Document

From-SVN: r75304
2004-01-01 14:13:44 +00:00
James E Wilson 367d6d0bd7 Fix IA-64 glibc ICE PR target/13132
Fix IA-64 glibc ICE
	PR target/13132
	* expmed.c (extract_bit_field): Only call mode_for_size for scalar
	integer modes.

From-SVN: r74443
2003-12-08 14:39:51 -08:00
James E Wilson 0b69c29f22 Undo accidental GET_MODE_BITSIZE damage.
(store_bit_field, extract_bit_field): Revert last two
changes.

From-SVN: r73463
2003-11-11 12:54:38 -08:00
Graham Stott 81bfdfbee7 Fix bootstrap failure.
* expmed.c (store_bit_field): Don't compare bitsize against
       modes with zero bit-size.

       (extract_bit_field): Likewise

From-SVN: r72937
2003-10-25 23:14:14 +00:00
Zack Weinberg 02befdf47f genmodes.c (struct mode_data): Add contained and next_cont fields.
* genmodes.c (struct mode_data): Add contained and next_cont
	fields.
	(complete_mode): Maintain linked list of modes that have a
	given component.
	(emit_mode_unit_size): Delete.
	(emit_mode_nunits): New.
	(emit_insn_modes_c): Update to match.
	(emit_mode_adjustments): Propagate size and alignment
	adjustments from component modes to their containers.
	* machmode.h (mode_unit_size): Delete.
	(mode_nunits): New.
	(GET_MODE_NUNITS): Just return the value in the table.
	(GET_MODE_UNIT_SIZE): Compute using GET_MODE_INNER and
	GET_MODE_SIZE.
	* expmed.c (store_bit_field, extract_bit_field): Can use a
	plain move instruction if bitsize >= GET_MODE_BITSIZE of
	destination/source mode, respectively.
	* varasm.c (assemble_real): Write out the full size of the
	constant, not just its bitsize.
	(output_constant): Honor TYPE_MODE of TREE_REAL_CSTs.

	* config/ia64/ia64-modes.def: Define XFmode as well as TFmode.
	Use ADJUST_BYTESIZE and ADJUST_ALIGNMENT to set size and
	alignment of XF and TF modes in compliance with ia64 ABIs.
	Can now hardwire the format of both modes.
	* config/ia64/ia64.c: Change TFmode to XFmode wherever appropriate.
	(general_tfmode_operand, destination_tfmode_operand)
	(tfreg_or_fp01_operand, spill_tfmode_operand): Rename to
	general_xfmode_operand, destination_xfmode_operand,
	xfreg_or_fp01_operand, spill_xfmode_operand respectively.
	(ia64_init_builtins): Make TYPE_PRECISION of fpreg_type
	and float80_type be 96 so they get XFmode.  Use !TARGET_HPUX,
	not INTEL_EXTENDED_IEEE_FORMAT, to decide how to define
	__float128.
	* config/ia64/ia64.h: Default TARGET_HPUX to 0.
	Change TFmode to XFmode wherever appropriate.  Remove all
	references to INTEL_EXTENDED_IEEE_FORMAT.
	(LONG_DOUBLE_TYPE_SIZE): Varies with TARGET_HPUX.
	(LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Define (always 96).
	(PREDICATE_CODES): Update to match function renames.
	* config/ia64/ia64.md: Change TF to XF throughout; rename all
	patterns to match.  Remove all references to
	INTEL_EXTENDED_IEEE_FORMAT.  Update predicate calls to match
	function renames.
	* config/ia64/ia64-protos.c: Update all prototypes to match
	renamed functions.
	* config/ia64/hpux.h: Redefine TARGET_HPUX to 1.
	Remove all references to INTEL_EXTENDED_IEEE_FORMAT.
	* config/ia64/lib1funcs.asm: Add __divxf3 as new name for
	__divtf3; keep old name for backward compatibility.
	(L__compat): New section providing forwarding stubs for
	__fixtfti, __fixunstfti, __floattitf.
	* config/ia64/t-ia64: Add __compat to LIB1ASMFUNCS.

From-SVN: r72916
2003-10-25 02:03:40 +00:00
Richard Sandiford 9f5e2e1108 expmed.c (store_bit_field): Don't search for an integer mode unless we need the result.
* expmed.c (store_bit_field): Don't search for an integer mode
	unless we need the result.

From-SVN: r71819
2003-09-26 13:28:45 +00:00
Mark Mitchell 5ae6cd0d1b re PR target/11184 ([ia64 hpux] ICE on __builtin_apply building libobjc)
PR target/11184
	* builtins.c (expand_builtin_apply): Use convert_memory_address
	before returning the value.

	* alias.c (find_base_value): Simplify use of
	convert_memory_address.
	(find_base_term): Likewise.
	* builtins.c (expand_builtin_stejmp_setup): Likewise.
	(expand_builtin_longjmp): Likewise.
	(expand_builtin_prefetch): Likewise.
	(get_memory_rtx): Likewise.
	(expand_builtin_return): Likewise.
	(expand_builtin_memcpy): Likewise.
	(expand_builtin_strncpy): Likewise.
	(expand_builtin_memset): Likewise.
	(expand_builtin_va_arg): Likewise.
	(expand_builtin_va_copy): Likewise.
	(expand_builtin_alloca): Likewise.
	* calls.c (expand_call): Likewise.
	* except.c (expand_builtin_extract_return_addr): Likewise.
	(expand_builtin_eh_return): Likewise.
	* explow.c (convert_memory_address): Define even when
	POINTER_EXTEND_UNSIGNED is not defined.  Do nothing if the address
	is already in the right mode.
	* explow.c (memory_address): Simplify use of convert_memory_address.
	(probe_stack_range): Likewise.
	* expmed.c (make_tree): Likewise.
	* expr.c (emit_block_move_in_libcall): Likewise.
	(expand_assignment): Likewise.
	(expand_expr): Likewise.
	* function.c (assign_parms): Likewise.
	(expand_function_end): Likewise.
	* integrate.c (copy_rtx_and_substitute): Likewise.
	* stmt.c (expand_computed_goto): Likewise.

	PR target/11184
	* gcc.dg/builtin-apply1.c: New test.

From-SVN: r71539
2003-09-18 20:43:13 +00:00
Roger Sayle 31ff3e0b77 re PR rtl-optimization/1823 (-ftrapv aborts with pointer difference due to division optimization)
PR optimization/1823
	* expmed.c (expand_divmod <EXACT_DIV_EXPR>): Use an unsigned
	multiplication to implement division by constant integer.

Co-Authored-By: Richard Henderson <rth@redhat.com>

From-SVN: r71116
2003-09-05 18:28:48 +00:00
Kazu Hirata beb235f896 c-decl.c: Fix comment formatting.
* c-decl.c: Fix comment formatting.
	* cfgrtl.c: Likewise.
	* combine.c: Likewise.
	* convert.c: Likewise.
	* dominance.c: Likewise.
	* dwarf2out.c: Likewise.
	* dwarfout.c: Likewise.
	* expmed.c: Likewise.
	* fold-const.c: Likewise.
	* gcov.c: Likewise.
	* genattrtab.c: Likewise.
	* ggc-common.c: Likewise.
	* mips-tfile.c: Likewise.
	* regmove.c: Likewise.

From-SVN: r70677
2003-08-22 06:45:14 +00:00
Roger Sayle f2593a6649 fold-const.c (fold <PLUS_EXPR>): Transform x+x into x*2.0.
* fold-const.c (fold <PLUS_EXPR>): Transform x+x into x*2.0.
	Optimize x*c+x and x+x*c into x*(c+1) and x*c1+x*c2 into x*(c1+c2)
	for floating point expressions with -ffast-math.
	(fold <MULT_EXPR>): Don't transform x*2.0 into x+x.
	* expmed.c (expand_mult): Wrap long line.  Expand x*2.0 as x+x.

	* gcc.dg/20030804-1.c: New test case.

From-SVN: r70158
2003-08-04 23:42:48 +00:00