Commit Graph

387 Commits

Author SHA1 Message Date
Geoff Keating
3b5286d750 expmed.c (expand_mult_highpart): Use op1 instead of wide_op1 when mode instead of wider_mode is being used.
* expmed.c (expand_mult_highpart): Use op1 instead of wide_op1 when
mode instead of wider_mode is being used.

From-SVN: r34851
2000-07-03 19:33:09 +00:00
Bernd Schmidt
0b4565c9d8 Vector conversions support
From-SVN: r34680
2000-06-24 19:26:42 +00:00
Jason Merrill
f9e158c377 simplify-rtx.c (simplify_ternary_operation): Cast to unsigned.
* simplify-rtx.c (simplify_ternary_operation): Cast to unsigned.
        * stor-layout.c (place_field): Likewise.
        * integrate.h (struct inline_remap): Make regno_pointer_align unsigned.
        * expr.c (store_expr): Make align unsigned.
        * explow.c (plus_constant_wide): Make low words unsigned.
        * expmed.c (choose_multiplier): Likewise.
        * fold-const.c (fold):  Likewise.
        * tree.h (build_int_2): Likewise.
        * tree.c (build_int_2_wide, tree_int_cst_msb): Likewise.
        * emit-rtl.c (gen_reg_rtx): Add cast to unsigned char*.
        (init_emit): Change cast to unsigned char*.
        * varasm.c (compare_constant_1): Add cast to char*.
        * gcse.c (delete_null_pointer_checks): Change cast to unsigned int*.
        * reload1.c (reload): Likewise.

        * rtl.h (MEM_SET_IN_STRUCT_P): Use do { } while (0).

From-SVN: r33684
2000-05-04 17:15:05 -04:00
Richard Kenner
6912b84bf1 expmed.c (emit_store_flag): If comparing two-word integer with zero, can optimize NE, EQ, GE, and LT.
* expmed.c (emit_store_flag): If comparing two-word integer
	with zero, can optimize NE, EQ, GE, and LT.

From-SVN: r33230
2000-04-18 15:14:58 -04:00
Richard Kenner
29105cea6a expmed.c (init_expmed): Don't free objects we make.
* expmed.c (init_expmed): Don't free objects we make.
	* emit-rtl.c (gen_rtx_CONST_INT, init_emit_once): Minor cleanups.

From-SVN: r33057
2000-04-10 07:51:53 -04:00
Richard Kenner
0e805f815e expmed.c (store_bit_field, [...]): Fix more cases of alignment in bytes.
* expmed.c (store_bit_field, store_fixed_bit_field): Fix more
	cases of alignment in bytes.

From-SVN: r32836
2000-03-30 16:46:37 -05:00
Richard Kenner
2b968770d7 * expmed.c (store_fixed_bit_field): STRUCT_ALIGN is in bits.
From-SVN: r32830
2000-03-30 09:12:28 -05:00
Richard Kenner
19caa751a8 builtins.c (get_pointer_alignment): Use host_integerp & tree_low_cst.
* builtins.c (get_pointer_alignment): Use host_integerp & tree_low_cst.
	(expand_builtin_apply): Pass alignment to emit_block_move in bits.
	(expand_builtin_memcpy, expand_builtin_va_copy): Likewise.
	(expand_builtin_memset): Likewise, but to clear_storage.
	* calls.c (save_fixed_argument_area): Likewise, to move_by_pieces.
	(restore_fixed_argument_area): Likewise.
	(store_unaligned_arguments_into_pseudos): Likewise, to store_bit_field.
	(load_register_parameters): Likewise, to emit_group_load.
	(expand_call): Likewise, to emit_group_store and emit_block_move.
	(emit_library_call_value_1): Likewise, to emit_block_move.
	(store_one_arg): Likewise, and to emit_push_insn.
	* expmed.c (extract_bit_field): Alignment is in bits, not bytes.
	(extract_fixed_bit_field, extract_split_bit_field): Likewise.
	* expr.c (move_by_pieces, move_by_pieces_ninsns): Likewise.
	(emit_block_move, emit_group_load, emit_group_store): Likewise.
	(clear_by_pieces, clear_storage, emit_push_insn): Likewise.
	(expand_assigment, store_expr, store_constructor_field): Likewise.
	(expand_expr_unaligned, do_jump, do_compare_and_jump): Likewise.
	(store_constructor, store_field, get_inner_reference): Likewise.
	Use host_integerp and tree_low_cst; sizes and positions HOST_WIDE_INT.
	(expand_expr, case COMPONENT_REF): Likewise.
	(copy_blkmode_from_regs): Use UNSIGNED_HOST_WIDE_INT for sizes
	and positions; reindent code.
	* expr.h (emit_cmp_insn, emit_cmp_and_jump_insns): Alignment unsigned.
	* function.c (purge_addressof_1): Pass bit align to store_bit_field.
	(assign_parms): Likewise to emit_group_store.
	* optbas.c (prepare_cmp_insn): Alignment is in bits.
	(emit_cmp_and_jump_insns, emit_cmp_insn): Likewise, and also unsigned.
	* stmt.c (expand_value_return): Pass align in bits to emit_group_load.
	(expand_return): Likewise to {extract,store}_bit_field.
	* stor-layout.c (get_mode_alignment): Minor cleanup.
	* config/rs6000/rs6000.h (SLOW_UNALIGNED_ACCESS): Align is in bits.
	* config/sh/sh.h (MOVE_BY_PIECES_P): Likewise.
	* ch/expr.c (chill_expand_expr): Pass bit alignment to emit_block_move.

From-SVN: r32827
2000-03-30 06:47:08 -05:00
Richard Kenner
751312371e expmed.c (extract_bit_field): Ensure BITS_PER_WORD is signed in MAX.
* expmed.c (extract_bit_field): Ensure BITS_PER_WORD is signed in MAX.
	* config/arm/pe.c (arm_pe_return_in_memory): Use host_integerp and
	int_bit_position.
	* config/mips/mips.c (function_arg): Likewise; also remove cast
	and make variables unsigned or HOST_WIDE_INT and use tree_low_cst.
	(mips_function_value): Use int_byte_position and make HOST_WIDE_INT.
	* config/mips/abi64.h (SETUP_INCOMING_VARARGS): Offsets are unsigned.
	* config/mips/mips.h (BITS_PER_WORD, UNITS_PER_WORD): Cast to unsigned.
	(UNITS_PER_FPREG, INT_TYPE_SIZE, LONG_TYPE_SIZE): Likewise.
	(POINTER_SIZE, POINTER_BOUNDARY,PARM_BOUNDARY): Likewise.
	(GP_REG_P, FP_REG_P, MD_REG_P, ST_REG_P): Ensure subtraction signed.
	(struct mips_arg): arg_number, arg_words, fp_arg_words, and
	num_adjusts now unsigned.
	(FUNCTION_ARG_BOUNDARY): Remove unneeded cast.
	* config/sparc/sparc.c (struct function_arg_record_value_parms):
	NREGS now unsigned.
	(function_arg_record_value_1): STARTBITPOS arg now HOST_WIDE_INT
	as is BITPOS variable; use host_integerp and int_bit_position.
	(function_arg_record_value_2): Likewise.
	(function_arg_record_value_3): Arg BITPOS now HOST_WIDE_INT.
	Variable REGNO now unsigned.
	(function_arg_record_value): NREGS now unsigned.

From-SVN: r32748
2000-03-26 11:46:27 -05:00
Richard Kenner
770ae6cc71 * Rework fields used to describe positions of bitfields and
modify sizes to be unsigned and use HOST_WIDE_INT.
	* alias.c (reg_known_value_size): Now unsigned.
	* c-typeck.c (build_unary_op, case ADDR_EXPR): Use byte_position.
	(really_start_incremental_init): Use bitsize_zero_node.
	(push_init_level, pop_init_level, output_init_element): Likewise.
	Use bitsize_unit_node and bitsize_one_node.
	(output_pending_init_elements, process_init_element): Likewise.
	* combine.c (combine_max_regno, reg_sign_bit_copies): Now unsigned.
	(make_extraction): Position and length HOST_WIDE_INT and unsigned
	HOST_WIDE_INT, respectively.
	(get_pos_from_mask): Passed in value is unsigned HOST_WIDE_INT.
	(num_sign_bit_copies): Returns unsigned.
	BITWIDTH now unsigned; rework arithmetic.
	Remove recursive call from arg to MAX.
	(combine_instructions, init_reg_last_arrays): NREGS now unsigned.
	(setup_incoming_promotions, can_combine_p, try_combine, simplify_set):
	REGNO now unsigned.
	(set_nonzero_bit_and_sign_copies): NUM now unsigned.
	(find_split_point, expand_compound_operation, make_extraction): LEN
	now unsigned HOST_WIDE_INT, POS now HOST_WIDE_INT.
	(make_field_assignment): Likewise.
	(combine_simplify_rtx): Add cast.
	(expand_compound_operation): MODEWIDTH now unsigned; rework arithmetic.
	(force_to_mode): WIDTH now unsigned; add cast.
	(if_then_else_cond): SIZE now unsigned.
	(nonzero_bits): MODE_WIDTH, RESULT_WIDTH, and WIDTH now unsigned.
	(extended_count): Now returns unsigned.
	(simplify_shift_const): COUNT unsigned; arg is now INPUT_COUNT.
	Add SIGNED_COUNT variable; MODE_WORDS and FIRST_COUNT now unsigned.
	(simplify_comparison): MODE_WIDTH now unsigned.
	(update_table_tick): REGNO and ENDREGNO now unsigned; new var R.
	(mark_used_regs_combine): Likewise; rework arithmetic.
	(record_value_for_reg): REGNO, ENDREGNO, and I now unsigned.
	(record_dead_and_set_regs, reg_dead_at_p, distribute_notes): Likewise.
	(record_promoted_value): REGNO now unsigned.
	(get_last_value_validate): REGNO, ENDREGNO, and J now unsigned.
	(get_last_value): REGNO now unsigned.
	(use_crosses_set_p): REGNO and ENDREGNO now unsigned.
	(reg_dead_regno, reg_dead_endregno): Now unsigned.
	(remove_death): Arg REGNO now unsigned.
	(move_deaths):  REGNO, DEADREGNO, DEADEND, OUREND, and I now unsigned.
	(reg_bitfield_target_p): REGNO, REGNO, ENDREGNO, and ENDTREGNO
	now unsigned.
	* convert.c (convert_to_integer): INPREC and OUTPREC now unsigned.
	* cse.c (struct qty_table_elem): FIRST_REG and LAST_REG now unsigned.
	(struct cse_reg_info): REGNO now unsigned.
	(cached_regno): Now unsigned.
	(REGNO_QTY_VALID_P): Add cast.
	(make_new_qty, make_regs_eqv, delete_reg_eqiv): Regno args unsigned.
	(remove_invalid_regs): Likewise.
	(remove_invalid_subreg_refs): Likewise; arg WORD also unsigned
	as are variables END and I.
	(get_cse_reg_info, insert): Likewise.
	(mention_regs, invalidate_for_call): REGNO, ENDREGNO, and I unsigned.
	(canon_hash): Likewise.
	(insert_regs, lookup_for_remove): REGNO now unsigned.
	(invalidate): REGNO, ENDREGNO, TREGNO, and TENDREGNO now unsigned.
	New variable RN.
	* dbxout.c (dbxout_parms, dbxout_reg_parms): Don't check for REGNO < 0.
	* dwarf2out.c (dwarf2ou_frame_debug_expr): Remove cast.
	* emit-rtl.c (subreg_realpart_p): Add cast.
	(operand_subword): Arg I is now unsigned as is var PARTWORDS.
	(operand_subword_force): Arg I is now unsigned.
	* except.c (eh_regs): Variable I is now unsigned.
	* explow.c (hard_function_value): BYTES is unsigned HOST_WIDE_INT.
	* expmed.c (store_fixed_bit_field): Position is HOST_WIDE_INT;
	length is unsigned HOST_WIDE_INT; likewise for internal variables.
	(store_split_bit_field, extract_fixed_bit_field): Likewise.
	(extract_split_bit_field, store_bit_field, extract_bit_field):
	Likewise.
	* expr.c (store_constructor_fields, store_constructor, store_field):
	Positions are HOST_WIDE_INT and lengths are unsigned HOST_WIDE_INT.
	(expand_assignment, expand_expr, expand_expr_unaligned): Likewise.
	(do_jump): Likewise.
	(move_by_pieces, move_by_pieces_ninsns, clear_by_pieces):
	MAX_SIZE is now unsigned.
	(emit_group_load): BYTEPOS is HOST_WIDE_INT; BYTELEN is unsigned.
	(emit_group_store): Likewise.
	(emit_move_insn): I now unsigned.
	(store_constructor): Use host_integerp, tree_low_cst, and
	bitsize_unit_node.
	(get_inner_reference): Return bitpos and bitsize as HOST_WIDE_INT.
	Rework all calculations to use trees and new fields.
	* expr.h (promoted_input_arg): Regno now unsigned.
	(store_bit_field, extract_bit_field): Adjust types of pos and size.
	(mark_seen_cases): Arg is HOST_WIDE_INT.
	* flow.c (verify_wide_reg_1): REGNO now unsigned.
	* fold-const.c (decode_field_reference): Size and pos HOST_WIDE_INT;
	precisions and alignments are unsigned.
	(optimize_bit_field_compare, fold_truthop): Likewise.
	(int_const_binop): Adjust threshold for size_int_type_wide call.
	(fold_convert): Likewise.
	(size_int_type_wide): Make table larger and fix thinko that only
	had half of table used.
	(all_ones_mask_p, fold): Precisions are unsigned.
	* function.c (put_reg_info_stack): REGNO is unsigned.
	(instantiate_decl): Size is HOST_WIDE_INT.
	(instantiate_virtual_regs): I is unsigned.
	(assign_parms): REGNO, REGNOI, and REGNOR are unsigned.
	(promoted_input_arg): REGNO is unsigned.
	* function.h (struct function): x_max_parm_reg is now unsigned.
	* gcse.c (max_gcse_regno): Now unsigned.
	(struct null_pointer_info): min_reg and max_reg now unsigned.
	(lookup_set, next_set): REGNO arg now unsigned.
	(compute_hash_table): REGNO and I now unsigned.
	(handle_avail_expr): regnum_for_replacing now unsigned.
	(cprop_insn): REGNO now unsigned.
	(delete_null_pointer_checks_1): BLOCK_REG now pointer to unsigned.
	* ggc-common.c (ggc_mark_tree_children, case FIELD_DECL): New case.
	* global.c (set_preference): SRC_REGNO, DEST_REGNO, and I now unsigned.
	* hard-reg-set.h (reg_class_size): Now unsigned.
	* integrate.c (mark_stores): LAST_REG and I now unsigned; new UREGNO.
	* jump.c (mark_modified_reg): I now unsigned; add cast.
	(rtx_equal_for_thread_p): Add cast.
	* loop.c (max_reg_before_loop): Now unsigned.
	(struct_movable): REGNO now unsigned.
	(try_copy_prop): REGNO arg unsigned.
	(regs_match_p): XN and YN now unsigned.
	(consec_sets_invariant_p, maybe_eliminate_biv): REGNO now unsigned.
	(strength_reduce): Likewise; NREGS also unsigned.
	(first_increment_giv, last_increment_giv unsigned): Now unsigned.
	* loop.h (struct iv_class): REGNO now unsigned.
	(max_reg_before_loop, first_increment_giv, last_increment_giv):
	Now unsigned.
	* machmode.h (mode_size, mode_unit_size): Now unsigned.
	(mode_for_size, smallest_mode_for_size): Pass size as unsigned.
	* optabs.c (expand_binop): I and NWORDS now unsigned.
	(expand_unop): I now unsigned.
	* print-tree.c (print_node): Don't print DECL_FIELD_BITPOS, but do
	print DECL_FIELD_OFFSET and DECL_FIELD_BIT_OFFSET.
	* real.c (significand_size): Now returns unsigned.
	* real.h (significand_size): Likewise.
	* regclass.c (reg_class_size): Now unsigned.
	(choose_hard_reg_mode): Both operands now unsigned.
	(record_reg_classes): REGNO and NR now unsigned.
	(reg_scan): NREGS now unsigned.
	(reg_scan_update): old_max_regno now unsigned.
	(reg_scan_mark_refs): Arg MIN_REGNO and var REGNO now unsigned.
	* reload.c (find_valid_class): BEST_SIZE now unsigned.
	(find_dummy_reload): REGNO, NWORDS, and	I now unsigned.
	(hard_reg_set_here_p): Args BEG_REGNO and END_REGNO now unsigned.
	Likewise for variable R.
	(refers_to_regno_for_reload_p): Args REGNO and END_REGNO now unsigned,
	as are variables INNER_REGNO and INNER_ENDREGNO; add new variable R.
	(find_equiv_reg): Add casts.
	(regno_clobbered_p): Arg REGNO now unsigned.
	* reload.h (struct reload): NREGS now unsigned.
	(refers_to_regno_for_reload_p): Regno args are unsigned.
	(regno_clobbered_p): Likewise.
	* reload1.c (reg_max_ref_width, spill_stack_slot_width): Now unsigned.
	(compute_use_by_pseudos): REGNO now unsigned.
	(find_reg): I and J now unsigned, new variable K, and change loop
	variables accordingly; THIS_NREGS now unsigned.
	(alter_reg): INHERENT_SIZE and TOTAL_SIZE now unsigned.
	(spill_hard_reg): REGNO arg now unsigned; add casts.
	(forget_old_reloads_1): REGNO, NR, and I now unsigned.
	(mark_reload_reg_in_use): Arg REGNO and vars NREGS and I now unsigned.
	(clear_reload_reg_in_use): Arg REGNO and vars NREGS, START_REGNO,
	END_REGNO, CONFLICT_START, and CONFLICT_END now unsigned.
	(reload_reg_free_p, reload_reg_reaches_end_p): Arg REGNO now unsigned.
	(choose_reload_regs): MAX_GROUP_SIZE now unsigned.
	(emit_reload_insns): REGNO now unsigned.
	(reload_cse_move2add): Add cast.
	(move2add_note_store): REGNO and I now unsigned; new variable ENDREGNO
	and rework loop.
	* resource.c (mark_referenced_resources, mark_set_resources): New
	variable R; REGNO and LAST_REGNO now unsigned.
	(mark_target_live_regs): J and REGNO now unsigned.
	* rtl.c (mode_size, mode_unit_size): Now unsigned.
	* rtl.h (union rtunion_def): New field rtuint.
	(XCUINT): New macro.
	(ADDRESSOF_REGNO, REGNO, SUBREG_WORD): New XCUINT.
	(operand_subword, operand_subword_force): Word number is unsigned.
	(choose_hard_reg_mode): Operands are unsigned.
	(refers_to-regno_p, dead_or_set_regno_p): Regno arg is unsigned.
	(find_regno_note, find_regno_fusage, replace_regs): Likewise.
	(regno_use_in, combine_instructions, remove_death): Likewise.
	(reg_scan, reg_scan_update): Likewise.
	(extended_count): Return is unsigned.
	* rtlanal.c (refers_to_regno_p): Args REGNO and ENDREGNO and vars I,
	INNER_REGNO, and INNER_ENDREGNO now unsigned; new variable X_REGNO.
	(reg_overlap_mentioned_p): REGNO and ENDREGNO now unsigned.
	(reg_set_last_first_regno, reg_set_last_last_regno): Now unsigned.
	(reg_reg_last_1): FIRS and LAST now unsigned.
	(dead_or_set_p): REGNO, LAST_REGNO, and I now unsigned.
	(dead_or_set_regno_p): Arg TEST_REGNO and vars REGNO and ENDREGNO
	now unsigned.
	(find_regno_note, regno_use_in): Arg REGNO now unsigned.
	(find_regno_fusage): Likewise; also var REGNOTE now unsigned.
	(find_reg_fusage): Variables REGNO, END_REGNO, and I now unsigned.
	(replace_regs): Arg NREGS now unsigned.
	* sdbout.c (sdbout_parms, sdbout_reg_parms): Don't check REGNO < 0.
	* simplify-rtx.c (simplify_unary_operation): WIDTH now unsigned.
	(simplify_binary_operation): Likewise.
	(cselib_invalidate_regno): Arg REGNO and variables ENDREGNO, I, and
	THIS_LAST now unsigned.
	(cselib_record_set): Add cast.
	* ssa.c (ssa_max_reg_num): Now unsigned.
	(rename_block): REGNO now unsigned.
	* stmt.c (expand_return): Bit positions unsigned HOST_WIDE_INT;
	sizes now unsigned.
	(all_cases_count): Just return -1 not -2.
	COUNT, MINVAL, and LASTVAL now HOST_WIDE_INT.
	Rework tests to use trees whenever possible.
	Use host_integerp and tree_low_cst.
	(mark_seen_cases): COUNT arg now HOST_WIDE_INT;
	Likewise variable NEXT_NODE_OFFSET; XLO now unsigned.
	(check_for_full_enumeration_handing): BYTES_NEEDED, I to HOST_WIDE_INT.
	* stor-layout.c (mode_for_size): SIZE arg now unsigned.
	(smallest_mode_for_size): Likewise.
	(layout_decl): Simplify handing of a specified DECL_SIZE_UNIT.
	KNOWN_ALIGN is now an alignment, so simplify code.
	Don't turn off DECL_BIT_FIELD if field is BLKmode, but not type.
	(start_record_layout): Renamed from new_record_layout_info.
	Update to new fields.
	(debug_rli, normalize_rli, rli_size_unit_so_far, rli_size_so_far):
	New functions.
	(place_union_field): Renamed from layout_union_field.
	Update to use new fields in rli.
	(place_field): Renamed from layout_field.
	Major rewrite to use new fields in rli; pass alignment to layout_decl.
	(finalize_record_size): Rework to use new fields in rli and handle
	union.
	(compute_record_mode): Rework to simplify and to use new DECL fields.
	(finalize_type_size): Make rounding more consistent.
	(finish_union_layout): Deleted.
	(layout_type, case VOID_TYPE): Don't set TYPE_SIZE_UNIT either.
	(layout_type, case RECORD_TYPE): Call new function names.
	(initialize_sizetypes): Set TYPE_IS_SIZETYPE.
	(set_sizetype): Set TYPE_IS_SIZETYPE earlier.
	(get_best_mode): UNIT is now unsigned; remove casts.
	* tree.c (bit_position): Compute from new fields.
	(byte_position, int_byte_position): New functions.
	(print_type_hash_statistics): Cast to remove warning.
	(build_range_type): Use host_integerp and tree_low_cst to try to hash.
	(build_index_type): Likewise; make subtype of sizetype.
	(build_index_2_type): Pass sizetype to build_range_type.
	(build_common_tree_nodes): Use size_int and bitsize_int to
	initialize nodes; add bitsize_{zero,one,unit}_node.
	* tree.h (DECL_FIELD_CONTEXT): Use FIELD_DECL_CHECK.
	(DECL_BIT_FIELD_TYPE, DECL_QUALIFIER, DECL_FCONTEXT): Likewise.
	(DECL_PACKED, DECL_BIT_FIELD): Likewise.
	(DECL_FIELD_BITPOS): Deleted.
	(DECL_FIELD_OFFSET, DECL_FIELD_BIT_OFFSET): New fields.
	(DECL_RESULT, DECL_SAVED_INSNS): Use FUNCTION_DECL_CHECK.
	(DECL_FRAME_SIZE, DECL_FUNCTION_CODE, DECL_NO_STATIC_CHAIN): Likewise.
	(DECL_INLINE, DECL_BUILT_IN_NONANSI, DECL_IS_MALLOC): Likewise.
	(DECL_BUILT_IN_CLASS, DECL_STATIC_CONSTRUCTOR): Likewise.
	(DECL_STATIC_DESTRUCTOR, DECL_NO_CHECK_MEMORY_USAGE): Likewise.
	(DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_LIMIT_STACK) Likewise.
	(DECL_ORIGINAL_TYPE, TYPE_DECL_SUPPRESS_DEBUG): Use TYPE_DECL_CHECK.
	(DECL_ARG_TYPE_AS_WRITEN, DECL_ARG_TYPE): Use PARM_DECL_CHECK.
	(DECL_INCOMING_RTL, DECL_TRANSPARENT_UNION): Likewise.
	(DECL_ALIGN): Adjust to new field in union.
	(DECL_OFFSET_ALIGN): New field.
	(DECL_ERROR_ISSUED, DECL_TOO_LATE): Use LABEL_DECL_CHECK.
	(DECL_IN_TEXT_SECTION): Use VAR_DECL_CHECK.
	(union tree_decl): Add struct for both aligns.
	(enum tree_index): Add TI_BITSIZE_{ZERO,ONE,UNIT}.
	(bitsize_zero_node, bitsize_one_node, bitsize_unit_node): Added.
	(struct record_layout_info): Rework fields to have offset
	alignment and byte and bit position.
	(start_record_layout, place_field): Renamed from old names.
	(rli_size_so_far, rli_size_unit_so_far, normalize_rli): New decls.
	(byte_position, int_byte_position): Likewise.
	(get_inner_reference): Change types of position and length.
	* unroll.c (unroll_loop): New variable R; use for some loops.
	MAX_LOCAL_REGNUM and MAXREGNUM now unsigned.
	(calculate_giv_inc): Arg REGNO now unsigned.
	(copy_loop_body): REGNO and SRC_REGNO now unsigned.
	* varasm.c (assemble_variable): Clean up handling of size using
	host_integerp and tree_low_cst.
	(decode_addr_const): Use byte, not bit, position.
	(output_constructor): bitpos and offsets are HOST_WIDE_INT;
	use tree_low_cst and int_bit_position.
	* objc/objc-act.c (build_ivar_list_initializer): Use byte_position.
	* ch/actions.c (check_missing_cases): BYTES_NEEDED is HOST_WIDE_INT.
	* ch/typeck.c (expand_constant_to_buffer): Use int_byte_position.
	(extract_constant_from_buffer): Likewise.
	* cp/class.c (build_vbase_pointer_fields): layout_field now
	place_field.
	(get_vfield_offset): Use byte_position.
	(set_rtti_entry): Set OFFSET to ssizetype zero.
	(get_binfo_offset_as_int): Deleted.
	(dfs_record_base_offsets): Use tree_low_cst.
	(dfs_search_base_offsets): Likewise.
	(layout_nonempty_base_or_field): Reflect changes in RLI format
	and call byte_position.
	(layout_empty_base): Convert offset to ssizetype.
	(build_base_field): use rli_size_unit_so_far.
	(dfs_propagate_binfo_offsets): Do computation in proper type.
	(layout_virtual_bases): Pass ssizetype to propagate_binfo_offsets.
	(layout_class_type): Reflect changes in RLI names and fields.
	(finish_struct_1): Set DECL_FIELD_OFFSET.
	* cp/dump.c (dequeue_and_dump): Call bit_position.
	* cp/expr.c (cplus_expand_constant): Use byte_position.
	* cp/rtti.c (expand_class_desc): Use bitsize_one_node.
	* cp/typeck.c (build_component_addr): Use byte_position and don't
	special case for zero offset.
	* f/com.c (ffecom_tree_canonize_ptr_): Use bitsize_zero_node.
	(ffecom_tree_canonize_ref_): Likewise.
	* java/class.c (make_field_value): Use byte_position.
	* java/expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
	(java_array_data_offset): Likewise.
	* java/java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
	bzero call.

From-SVN: r32742
2000-03-25 13:34:13 -05:00
Jeff Law
ef58a5234d Copyright fixes.
From-SVN: r32174
2000-02-25 23:04:48 -07:00
Richard Kenner
c8d8ed65a5 bitmap.c (bitmap_operation): Avoid using -1 for index since unsigned.
* bitmap.c (bitmap_operation): Avoid using -1 for index since unsigned.
	* cppinit.c (new_pending_define): Add cast to avoid warning.
	* expmed.c (extract_bit_field): Likewise.
	* flow.c (enum reorder_skip_type): New type.
	(skip_insns_between_blcok): New it.
	Rework to avoid warning about possibly undefined variable.
	* function.c (assign_parms): Make thisparm_boundary unsigned.
	* genrecog.c (write_switch): Cast XWINT result to int.
	* lcm.c: Many static fcns and vars now #ifdef OPTIMIZE_MODE_SWITCHING.
	* mips-tfile.c (init_file): Make two versions of FDR intializer:
	one for MIPS and one for Alpha.
	(get_tag, copy_object): Add casts to avoid warnings.
	* optabs.c (init_one_libfunc): Cast NAME to (char *).
	* reload.c (find_reloads): Make TYPE enum reload_type.
	* sbitmap.c (dump_sbitmap): J is unsigned; don't use "1L".
	* unroll.c (unroll_loop): Initialize UNROLL_NUMBER.
	* varasm.c (compare_constant_1): Add cast to avoid warning.
	* config/alpha/alpha.c (alpha_emit_xfloating_libcall): Cast FUNC
	to (char *).
	(alpha_expand_unaligned_load, alpha_expand_unaligned_store):
 	Cast switch operand of size to int.
	(alpha_expand_epilogue): Always initialize fp_offset and sa_reg.
	* config/alpha/alpha.h (INITIAL_ELIMINATION_OFFSET): Add abort
	in unhandled case.

From-SVN: r32060
2000-02-18 20:27:00 -05:00
Richard Kenner
729a212576 combine.c (make_extraction, [...]): Avoid warning on mixed-signedness conditionals.
* combine.c (make_extraction, force_to_mode): Avoid warning on
	mixed-signedness conditionals.
	(make_field_assignment, nonzero_bits): Likewise.
	* expmed.c (store_fixed_bit_field): ALIGN arg now unsigned.
	(store_split_bit_field, extract_split_bit_field): Likewise.
	(extract_fixed_bit_field, store_bit_field,
	* expr.c: Change alignment to be unsigned everywhere.
	(move_by_pieces, store_constructor_field, store_constructor):
	Alignment parm is unsigned.
	(emit_block_move, emit_group_load, emit_group_store): Likewise.
	(clear_storage, emit_push_insn, compare_from_rtx): Likewise.
	(do_compare_rtx_and_jump): Likewise.
	(move_by_pieces_ninsns, clear_by_pieces): Likewise.
	Compare align with GET_MODE_ALIGNMENT.
	(expand_expr_unaligned): Pointer to alignment is pointer to unsigned.
	(get_inner_reference): Likewise.
	(copy_blkmode_from_reg, emit_push_insn): Remove unneeded casts.
	(expand_assignment): Local vars for alignment now unsigned.
	(store_constructor, store_field, expand_expr, do_jump): Likewise.
	(do_compare_and_jump): Likewise.
	(store_field): Call new function expr_align.
	* expr.h (emit_block_move, emit_group_load, emit_group_store):
	Alignment arg now unsigned.
	(clear_storage, emit_push_insn, compare_from_rtx): Likewise.
	(do_compare_rtx_and_jump, store_bit_field): Likewise.
	(extract_bit_field): Likewise.
	* fold-const.c (add_double): Add cast to eliminate signedness warning.
	* machmode.h (GET_MODE_ALIGNMENT): Result is unsigned.
	(get_best_mode): Alignment arg is unsigned.
	* rtl.h (move_by_pieces): Likewise.
	* store-layout.c (maximum_field_alignment, set_alignment):
	Now unsigned.
	(layout_decl): Alignment arg is now unsigned.
	Remove unneeded casts.
	(layout_record, layout_union, layout_type): Remove unneeded casts.
	Local alignment variables now unsigned.
	(get_best_mode): Alignment arg now unsigned.
	* tree.c (expr_align): New function.
	* tree.h (expr_align): Likewise.
	(maximum_field_alignment, set_alignment): Now unsigned.
	(get_inner_reference): Alignment argument is now pointer to unsigned.
	* varasm.c (assemble_variable): Add cast to eliminate warning.

From-SVN: r31904
2000-02-10 17:05:40 -05:00
Jim Wilson
5e4900c7f4 Fix ia64 compiler problem with gcc.c-torture/compile/920410-1.c.
* expmed.c (store_bit_field): If op0 and fieldmode are the same size,
	then store directly into op0.

From-SVN: r31903
2000-02-10 13:09:52 -08:00
Richard Henderson
1eb8759b1b rtl.def: Add unordered fp comparisions.
* rtl.def: Add unordered fp comparisions.
        * tree.def: Likewise.
	* tree.h: Add ISO C 9x unordered fp comparision builtins.

	* builtins.c (expand_tree_builtin): New function.
	* c-typeck.c (build_function_call): Use it.
	(build_binary_op): Support unordered compares.
	* c-common.c (c_common_nodes_and_builtins): Add unordered compares.

	* combine.c (known_cond): Handle reverse_condition returning UNKNOWN.
	(reversible_comparison_p): Allow UNORDERED/ORDERED to be reversed.
	* cse.c (fold_rtx): Check FLOAT_MODE_P before reversing.
	(record_jump_equiv): Handle reverse_condition returning UNKNOWN.
	* jump.c (reverse_condition): Don't abort for UNLE etc, but
	return UNKNOWN.
	(swap_condition): Handle unordered compares.
	(thread_jumps): Check can_reverse before reversing.
	* loop.c (get_condition): Likewise.  Allow UNORERED/ORDERED to be
	reversed for FP.

	* optabs.c (can_compare_p): New argument CODE.  Verify branch or
	setcc is present before acking for cmp_optab.  Update all callers.
	(prepare_float_lib_cmp, init_optabs): Handle UNORDERED.
	* expmed.c (do_cmp_and_jump): Update for can_compare_p.
	* expr.c (expand_expr): Likewise.  Support unordered compares.
	(do_jump, do_store_flag): Likewise.
	* expr.h (enum libfunc_index): Add unordered compares.

	* Makefile.in (FPBIT_FUNCS): Add _unord_sf.
	(DPBIT_FUNCS): Add _unord_df.
	* config/fp-bit.c (_unord_f2): New.
	* fp-test.c (main): Try unordered compare builtins.

	* alpha-protos.h (alpha_fp_comparison_operator): Declare.
	* alpha.c (alpha_comparison_operator): Check mode properly.
	(alpha_swapped_comparison_operator): Likewise.
	(signed_comparison_operator): Likewise.
	(alpha_fp_comparison_operator): New.
	(alpha_emit_conditional_branch): Handle unordered compares.
	* alpha.h (PREDICATE_CODES): Update.
	* alpha.md (fp compares): Use alpha_fp_comparison_operator.
	(bunordered, bordered): New.

	* cp/call.c (build_over_call): Use expand_tree_builtin.
	* cp/typeck.c (build_function_call_real): Likewise.
	(build_binary_op_nodefault): Handle unordered compares.

	* gcc.c-torture/execute/ieee/fp-cmp-4.c: New.

From-SVN: r31591
2000-01-24 12:10:04 -08:00
Kaveh R. Ghazi
711d877c9e eh-common.h: PROTO -> PARAMS.
* eh-common.h: PROTO -> PARAMS.
	* emit-rtl.c: Likewise.
	* errors.c: Likewise.
	* errors.h: Likewise.
	* except.c: Likewise.
	* except.h: Likewise.
	* explow.c: Likewise.
	* expmed.c: Likewise.
	* expr.c: Likewise.
	* expr.h: Likewise.
	* final.c: Likewise.
	* fix-header.c: Likewise.
	* flow.c: Likewise.
	* fold-const.c: Likewise.
	* function.c: Likewise.
	* function.h: Likewise.
	* gcc.c: Likewise.
	* gcov-io.h: Likewise.
	* gcov.c: Likewise.
	* gcse.c: Likewise.

From-SVN: r31419
2000-01-14 17:14:43 +00:00
David Edelsohn
e1565e6588 expmed.c (SLOW_UNALIGNED_ACCESS): Add mode and align parameters to default definition.
* expmed.c (SLOW_UNALIGNED_ACCESS): Add mode and align parameters
	to default definition.
	(store_bit_field): Call SLOW_UNALIGNED_ACCESS with mode and alignment.
	(store_fixed_bit_field): Call macro with word_mode and alignment.
	(extract_bit_field): Call macro with relevant mode and alignment.
	* expr.c (SLOW_UNALIGNED_ACCESS): Add mode and align parameters
	to default definition.
	(move_by_pieces): Call SLOW_UNALIGNED_ACCESS with word_mode
	and alignment.
	(move_by_pieces_ninsns): Likewise.
	(clear_by_pieces): Likewise.
	(emit_push_insn): Likewise.
	(store_field): Call macro with relevant mode and alignment.
	(expand_expr): Likewise.
	(expand_expr_unaligned): Likewise.

	* rs6000.h (HANDLE_PRAGMA_PACK): Define.
	(SLOW_UNALIGNED_ACCESS): Define.
	(CASE_VECTOR_MODE): Always use 32-bit offsets.
	(ASM_FILE_END): Generate 64-bit symbol in 64-bit mode.
	(EXTRA_SECTOIN_FUNCTIONS): Indent .csect pseudo-op.
	(toc_section): Likewise and .toc pseudo-op.
	(ASM_DECLARE_FUNCTION): Likewise.  Align text more strictly in
	64-bit mode.
	(TEXT_SECTION_ASM_OP): Likewise.
	(ASM_OUTPUT_ADD_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Always use
	32-bit offsets.

	* a29k.h (SLOW_UNALIGNED_ACCESS): Add MODE and ALIGN parameters.
	* alpha.h (SLOW_UNALIGNED_ACCESS): Likewise.
	* arm/thumb.h (SLOW_UNALIGNED_ACCESS): Likewise.
	* gmicro.h (SLOW_UNALIGNED_ACCESS): Likewise.
	* fr30.h (SLOW_UNALIGNED_ACCESS): Likewise.

From-SVN: r31211
2000-01-04 15:09:19 -05:00
Jeff Law
ccc50f7d72 Update copyrights
From-SVN: r31195
2000-01-04 01:10:30 -07:00
Mark Mitchell
13799af323 system.h (CEIL): Define.
* system.h (CEIL): Define.
	* builtins.c (CEIL): Remove.
	* expmed.c (CEIL): Likewise.
	* expr.c (CEIL): Likewise.
	* stor-layout.c (CEIL): Likewise.

From-SVN: r31167
2000-01-02 19:38:36 +00:00
Bernd Schmidt
3bdf58486d Avoid losing pending stack adjusts.
From-SVN: r31156
2000-01-01 12:12:10 +00:00
Geoff Keating
3306eb80e9 expmed.c (extract_bit_field): Allow for the case of non-integer objects that are smaller than a word (like...
* expmed.c (extract_bit_field): Allow for the case of non-integer
        objects that are smaller than a word (like SFmode on a 64-bit
        machine).

From-SVN: r30185
1999-10-26 00:48:38 -06:00
Bernd Schmidt
1c0290eaac Use cbranch patterns when available
From-SVN: r29613
1999-09-23 11:34:49 +00:00
Bernd Schmidt
6baf1cc8f8 Make it possible to prototype port-specific functions (and convert i386 to use this)
From-SVN: r29514
1999-09-20 10:00:03 +00:00
Richard Henderson
a995e389c4 Replace insn_foo with insn_data.foo.
From-SVN: r29358
1999-09-12 05:46:08 -07:00
Jeff Law
c5c7673583 Merge in gcc2-ss-010999
From-SVN: r29150
1999-09-06 23:49:18 -06:00
Finn Hakansson
6d649d2678 combine.c (simplify_shift_const): Remove extra semicolon.
* combine.c (simplify_shift_const): Remove extra semicolon.
        * dwarf2out.c (remove_AT): Likewise.
        * expmed.c (expand_mult): Likewise.
        * gcov.c (create_program_flow_graph): Likewise.
        * reorg.c (mostly_true_jump): Likewise.

From-SVN: r29050
1999-09-02 00:47:15 -06:00
Bernd Schmidt
b30f05db01 Combined compare & jump infrastructure
From-SVN: r28752
1999-08-18 17:51:27 +00:00
Geoffrey Keating
0865c6314e Unroll my commit of 1999/08/01 16:14:58, there was a communications mixup
about its status.

From-SVN: r28403
1999-08-02 15:44:50 +00:00
Geoff Keating
465e27163d rs6000.c (num_insns_constant_wide): Correct for type promotion.
* config/rs6000/rs6000.c (num_insns_constant_wide): Correct
	for type promotion.
	(add_operand): Get test correct for 64-bit HOST_WIDE_INT.
	(non_add_cint_operand): Likewise.
	(logical_operand): Likewise.
	(non_logical_cint_operand): Likewise.
	(print_operand): Correct printf()s for 64-bit HOST_WIDE_INT.
	(print_operand_address): Correct printf() for 64-bit HOST_WIDE_INT.
	(rs6000_select_rtx_section): Suppress warning.
	(small_data_operand): Suppress warning.
	(rs6000_got_register): Suppress warning.
	* config/rs6000/rs6000.md (andsi3): HOST_WIDE_INT is a signed
	type, so `J' is generally the wrong constraint for a SImode value;
	use `L' instead.
	(andsi3_internal2): Likewise.
	(andsi3_internal3): Likewise.
	(iorsi3_internal1): Likewise.
	(xorsi3_internal1): Likewise.
	(movsi): Likewise.
	(movsf_softfloat): Likewise.
	various unnamed compare insns: Likewise.
	(movsi+2): Preserve sign bits of SImode constant.
	(floatsidf2_internal+1): Sign-extend SImode constant correctly.
	(movdf+1): Preserve high bits of DFmode constant.
	(movdi_32+1): Sign-extend properly.
	various unnamed compare insns: Sign-extend properly.

	* unroll.c (loop_iterations): Convert HOST_WIDE_INT to unsigned
	properly for mode.
	* expmed.c (expand_mult_highpart): Convert HOST_WIDE_INT from unsigned
	properly for mode.
	(expand_divmod): Likewise.
	* optabs.c (expand_fix): Keep HOST_WIDE_INT constants properly signed.
	(expand_binop): Sometimes there is work to do when changing
	the mode of a CONST_INT.

From-SVN: r28375
1999-08-01 16:14:58 +00:00
David Edelsohn
c8e7fe5816 * expmed.c (expand_divmod): Ensure unsigned value fits in reg_note.
From-SVN: r27796
1999-06-27 21:09:43 -06:00
Zack Weinberg
01198c2f1f c-aux-info.c, [...]: Include toplev.h for real declaration of trim_filename.
1999-04-17 20:11 -0400  Zack Weinberg  <zack@rabi.columbia.edu>
	* c-aux-info.c, emit-rtl.c, explow.c, expmed.c, gcse.c,
	haifa-sched.c, optabs.c, reorg.c, resource.c, sched.c: Include
	toplev.h for real declaration of trim_filename.
	* Makefile.in: Update dependencies.

From-SVN: r26523
1999-04-17 17:14:58 +00:00
Andrew Macleod
7e5bda2c38 rtl.texi (RTX_FRAME_RELATED_P): Add documentation.
d
Thu Mar 25 14:04:54 EST 1999  Andrew MacLeod  <amacleod@cygnus.com>
	* rtl.texi (RTX_FRAME_RELATED_P): Add documentation.
	* rtl.h (struct rtx_def): Update comment for frame_related field.
	(set_unique_reg_note): Declare prototype.
	* dwarf2out.c (dwarf2out_frame_debug_expr): Split out from
	'dwarf2out_frame_debug' to handle only expressions, and process
	component parts of a PARALLEL expression.
	(dwarf2out_frame_debug): Process insns only, and call
	new function 'dwarf2out_frame_debug_expr' for patterns.
	* emit-rtl.c (set_unique_reg_note): New function to add a reg note,
	but if there is an existingone, deletes it first.
	* expmed.c (expand_mult, expand_divmod): Use set_unique_reg_note.
	* optabs.c (add_equal_note, expand_binop): Use set_unique_reg_note.
	(emit_no_conflict_block, emit_libcall_block): Use set_unique_reg_note.
	(expand_fix):  Use set_unique_reg_note.

From-SVN: r25979
1999-03-25 12:04:25 +00:00
Kaveh R. Ghazi
91813b2835 Warning fixes:
* calls.c (initialize_argument_information): Mark parameters
        `num_actuals' and `n_named_args' with ATTRIBUTE_UNUSED.
        * dbxout.c (dbxout_start_new_source_file): Likewise for parameter
        `filename'.
        (dbxout_finish): Likewise for parameters `file' and `filename'.
        (dbxout_prepare_symbol): Likewise for parameter `decl'.
        (dbxout_begin_function): Likewise.
        * explow.c (hard_function_value): Likewise for parameter `func'.
        * function.c (locate_and_pad_parm): Likewise for parameter `fndecl'.
        * expmed.c (expand_divmod): Omit unused argument to `expand_abs'.
        * expr.c (expand_expr): Likewise.
        * expr.h (expand_abs): Delete unused argument from prototype.
        * optabs.c (expand_abs): Remove unused parameter `unsignedp'.
        * sdbout.c (sdbout_init): Mark parameter `syms' with ATTRIBUTE_UNUSED.
        (sdbout_end_block): Likewise for parameter `n'.
        * toplev.c (debug_define): Likewise for parameters `lineno' and
        `buffer'.
        (debug_undef): Likewise.
        * varasm.c (named_section): Likewise for parameter 'reloc'.
        (assemble_external): Likewise for parameter `decl'.
        (assemble_alias): Likewise for parameter `target'.

From-SVN: r25858
1999-03-19 08:50:14 +00:00
Jeffrey A Law
c5d5d46141 except.c (start_catch_handler): Use emit_cmp_and_jump_insns.
* except.c (start_catch_handler): Use emit_cmp_and_jump_insns.
        * explow.c (probe_stack_range): Likewise.
        * expmed.c (do_cmp_and_jump): Likewise.
        * expr.c (store_expr, expand_expr, expand_builtin): Likewise.
        (do_tablejump): Likewise.
        * stmt.c (expand_expr_stmt, expand_end_case): Likewise.
        (do_jump_if_equal, emit_case_nodes): Likewise.
        * optabs.c (emit_cmp_and_jump_insns): Clarify comments.  If UNSIGNEDP,
        then convert comparison to an unsigned code before emitting the jump.
        (expand_float, expand_fix): Use emit_cmp_and_jump_insns.

From-SVN: r25205
1999-02-14 13:08:39 -07:00
J"orn Rennecke
5353610bac loop.c (strength_reduce): If scan_start points to the loop exit test...
* loop.c (strength_reduce): If scan_start points to the loop exit
	test, be wary of subversive use of gotos inside expression statements.
	Don't set maybe_multiple for a backward jump that does not
	include the label under consideration into its range.
	* unroll.c (biv_total_increment): Make use of maybe_multiple field.

From-SVN: r24196
1998-12-08 14:50:03 +00:00
Jim Wilson
7be7a07d27 Fix sparc builtin_memcpy miscompilation.
* expmed.c (store_bit_field): If need to add a SUBREG, then remove
	existing SUBREG if we can, otherwise abort.

From-SVN: r23215
1998-10-21 12:27:19 -07:00
Richard Henderson
470032d72e function.c (purge_addressof_1): Fix typo in inequality: do bitfield optimization for equal mode sizes.
* function.c (purge_addressof_1): Fix typo in inequality: do
        bitfield optimization for equal mode sizes.
        * expmed.c (store_bit_field): Don't take subregs of subregs in
        the movstrict case.  Tidy a potential problem in the multi-word case.
        (extract_bit_field): Likewise.

From-SVN: r23066
1998-10-13 16:06:47 -07:00
Kaveh R. Ghazi
c84e271261 Warning fixes:
* Makefile.in (gencheck.o): Depend on gansidecl.h.
	* c-common.c (print_char_table): Add missing initializers.
	(scan_char_table): Likewise.
	(time_char_table): Likewise.
	* c-decl.c (c_decode_option): Mark parameter `argc' with
	ATTRIBUTE_UNUSED.
	(declare_parm_level): Mark parameter `definition_flag' with
	ATTRIBUTE_UNUSED.
	* c-lex.c (readescape): Use `(unsigned)1' in shift.
	(yylex): Likewise.  Cast `sizeof' to an (int) when comparing
	against one.
	* calls.c (store_one_arg): Remove unused parameter `fndecl'.  All
	callers changed.
	(emit_call_1): Mark parameters `fndecl' and `funtype' with
	ATTRIBUTE_UNUSED.
	(expand_call): Cast result of MIN() to (unsigned int) when
	comparing against an unsigned value.
	* cccp.c (pcfinclude): Remove unused parameter `limit'.  All
	callers changed.
	(make_definition): Remove unused parameter `op'.  All callers
	changed.
	(create_definition): Cast REST_EXTENSION_LENGTH to (long) when
	comparing against the result of pointer arithmetic.
	* config/mips/mips.h (FUNCTION_ARG_BOUNDARY): Cast to (unsigned)
	when comparing against one.
	* dwarf2out.c (dwarf2out_frame_debug): Cast REGNO() and
 	HARD_FRAME_POINTER_REGNUM to (unsigned) when comparing against
 	one.
	(output_die): Move variable `i' into the scope in which it is
	used.  Change its type to `unsigned'.
	(output_die): Cast the result of `strlen' to (int) when passing it
	to ASM_OUTPUT_ASCII().
	(output_pubnames): Likewise.
	(output_line_info): Likewise.
	* emit-rtl.c (global_rtl): Add missing initializers.
	* explow.c (promote_mode): Mark parameter `for_call' with
	ATTRIBUTE_UNUSED.
	* expmed.c (expand_shift): Cast the result of GET_MODE_BITSIZE to
 	`unsigned HOST_WIDE_INT' when comparing against one.
	(synth_mult): Change type of variable `cost' to int.
	(emit_store_flag): Use `(unsigned HOST_WIDE_INT) 1' in shift.
	* expr.c (copy_blkmode_from_reg): Cast BITS_PER_WORD to (unsigned)
	when comparing against one.
	(get_inner_reference): Change variable `alignment' to unsigned.
	(expand_expr): Cast the result of GET_MODE_ALIGNMENT to (unsigned
	int) when comparing against one.
	(expand_builtin_setjmp): Change type of variable `i' to size_t.
	* fold-const.c (div_and_round_double): Cast BASE to
	(HOST_WIDE_INT) when comparing against one.
	* gencheck.c: Include gansidecl.h.
	(main): Mark parameter `argv' with ATTRIBUTE_UNUSED.
	* optabs.c (gen_cond_trap): Mark parameters `code', `op2' and
	`tcode' with ATTRIBUTE_UNUSED.
	* real.c (edivm): Cast constant value to (unsigned long) in
	expression compared against an unsigned value.
	* stmt.c (expand_return): Cast BITS_PER_WORD to (unsigned) when
	comparing against one.
	(expand_end_case): Cast CASE_VALUES_THRESHOLD to (unsigned int)
	when comparing against one.
	* stor-layout.c (mode_for_size): Cast MAX_FIXED_MODE_SIZE to
	(unsigned int) when comparing against one.  Likewise for
	GET_MODE_BITSIZE.
	(smallest_mode_for_size): Likewise.
	(save_storage_status): Mark parameter `p' with ATTRIBUTE_UNUSED.
	(restore_storage_status): Likewise.
	* toplev.c (debug_args): Add missing initializer.
	(f_options): Spelling correction.  Add missing initializers.
	(documented_lang_options): Likewise.
	(debug_end_source_file): Mark parameter `lineno' with
	ATTRIBUTE_UNUSED.
	* tree.c (valid_machine_attribute): Mark parameters `attr_args',
	`decl' and `type' with ATTRIBUTE_UNUSED.
	* varasm.c (decode_reg_name): Cast `sizeof' expression to (int)
	when comparing against one.
	(assemble_variable): Mark parameter `top_level' with
	ATTRIBUTE_UNUSED.
	(assemble_external_libcall): Mark parameter `fun' with
	ATTRIBUTE_UNUSED.
	(output_constant_pool): Mark parameters `fnname' and `fndecl' with
	ATTRIBUTE_UNUSED.

From-SVN: r23054
1998-10-13 15:25:25 +00:00
Richard Henderson
d006aa54ba expmed.c (store_bit_field): Pun non-integral str_rtx modes.
* expmed.c (store_bit_field): Pun non-integral str_rtx modes.
        Take extra care for op0 now possibly being a subreg.
        (extract_bit_field): Likewise.
        * function.c (purge_addressof_1): Revert Oct 4 change.  Drop
        the reg to memory if there is no equal sized integral mode.
        * stor-layout.c (int_mode_for_mode): New function.
        * machmode.h: Prototype it.

From-SVN: r22962
1998-10-09 08:50:25 -07:00
Torbjorn Granlund
32fdf36bb6 expmed.c (expand_divmod): Don't widen for computing remainder if we seem to have a divmod pattern for...
* expmed.c (expand_divmod): Don't widen for computing remainder
        if we seem to have a divmod pattern for needed mode.

From-SVN: r22828
1998-10-04 18:08:56 -06:00
Nick Clifton
f916eeb6db Add comment provided by Jim Wilson.
From-SVN: r22560
1998-09-23 16:24:09 +00:00
Jeffrey A Law
0d8e55d8cd combine.c (make_extraction): If no mode is specified for an operand of insv...
* combine.c (make_extraction): If no mode is specified for
        an operand of insv, extv, or extzv, default it to word_mode.
        (simplify_comparison): Similarly.
        * expmed.c (store_bit_field): Similarly.
        (extract_bit_field): Similarly.
        * function.c (fixup_var_regs_1): Similarly.
        * recog.c (validate_replace_rtx_1): Similarly.
        * mips.md (extv, extzv, insv expanders): Default modes for most
        operands.  Handle TARGET_64BIT.
        (movdi_uld, movdi_usd): New patterns.

From-SVN: r22439
1998-09-15 16:47:10 -06:00
David S. Miller
172f4957e1 expmed.c (make_tree): Sign extend even if TREE_UNSIGNED...
* expmed.c (make_tree) [CONST_INT]: Sign extend even if
	TREE_UNSIGNED, when bitsize of type's mode is larger than
	HOST_BITS_PER_WIDE_INT.

From-SVN: r21904
1998-08-21 20:17:56 -07:00
Jeff Law
9ec36da574 * Merge from gcc2 June 9, 1998 snapshot. See ChangeLog.13 for
details.

From-SVN: r20808
1998-06-29 15:40:49 -06:00
John Carr
55a6ba9ff3 expr.c (get_memory_rtx): New function.
* expr.c (get_memory_rtx): New function.
	(expand_builtin): Call get_memory_rtx for MEM arguments to builtin
	string functions.
	* expmed.c (init_expmed): Initialize all elements of *_cost arrays.

From-SVN: r20700
1998-06-24 13:32:56 +00:00
Jeffrey A Law
c16ddde3e3 calls.c (expand_call): Initialize "src" and "dest".
* calls.c (expand_call): Initialize "src" and "dest".
        * stmt.c (expand_return): Likewise.
        * expmed.c (extract_split_bit_field): Similarly for "result"
        * gcse.c (compute_hash_table): Mark first arg as unused.
        * jump.c (jump_optimize): Initialize reversep.
        * tree.c (make_node): Initialize length.

From-SVN: r20629
1998-06-19 18:35:42 -06:00
Jeff Law
38e012594e typo typo fixes fixes
From-SVN: r19601
1998-05-06 15:09:07 -06:00
Jeff Law
f5963e6170 * Check in merge from gcc2. See ChangeLog.12 for details.
From-SVN: r19553
1998-05-05 17:18:02 -06:00
Jeff Law
d77fac3be2 expr.c (store_constructor_field): Add prototype.
* expr.c (store_constructor_field): Add prototype.
        (memory_use_mode): Likewise.
        * expmed.c (synth_mult): Add prototype.
        (choose_multiplier, invert_mod2n): Likewise.

From-SVN: r19250
1998-04-16 17:07:05 -06:00
Jeff Law
e5e809f419 * Check in merge from gcc2. See ChangeLog.11 and ChangeLog.12
for details.

        * haifa-sched.c: Mirror recent changes from gcc2.

From-SVN: r18984
1998-04-04 06:32:39 -07:00
Jeff Law
31031eddac dummy commit before merge
From-SVN: r18980
1998-04-03 09:37:26 -07:00
Kaveh R. Ghazi
670ee92097 Major cutover to using system.h:
* Makefile.in (alias.o, bitmap.o, c-aux-info.o, c-common.o,
        c-decl.o, c-iterate.o, c-lang.o, c-lex.o, c-pragma.o, c-typeck.o,
        caller-save.o, calls.o, collect2.o, combine.o, cse.o, dbxout.o,
        dwarf2out.o, dwarfout.o, emit-rtl.o, except.o, explow.o, expmed.o,
        expr.o, final.o, flow.o, function.o, getpwd.o, global.o,
        integrate.o, jump.o, local-alloc.o, loop.o, optabs.o, pexecute.o,
        prefix.o, print-rtl.o, print-tree.o, profile.o, real.o, recog.o,
        reg-stack.o, regclass.o, regmove.o, reload.o, reload1.o, reorg.o,
        rtl.o, rtlanal.o, sdbout.o, stmt.o, stor-layout.o, stupid.o,
        tlink.o, toplev.o, tree.o, unroll.o, varasm.o, xcoffout.o): Depend
        on system.h.
        * alias.c, bitmap.c, c-aux-info.c, c-common.c, c-decl.c,
        c-iterate.c, c-lang.c, c-lex.c, c-pragma.c, c-typeck.c,
        caller-save.c, calls.c, collect2.c, combine.c, cse.c, dbxout.c,
        dwarf2out.c, dwarfout.c, emit-rtl.c, except.c, explow.c, expmed.c,
        expr.c, final.c, flow.c, function.c, gcc.c, getpwd.c, global.c,
        integrate.c, jump.c, local-alloc.c, loop.c, optabs.c, pexecute.c,
        prefix.c, print-rtl.c, print-tree.c, profile.c, real.c, recog.c,
        reg-stack.c, regclass.c, regmove.c, reload.c, reload1.c, reorg.c,
        rtl.c, rtlanal.c, sched.c, sdbout.c, stmt.c, stor-layout.c,
        stupid.c, tlink.c, toplev.c, tree.c, unroll.c, varasm.c,
        xcoffout.c: Include system.h.  Organize include ordering so
        that stdarg/varargs comes before other system headers.  Remove
        spurious casts of functions assured of a prototype in system.h.

From-SVN: r18726
1998-03-20 14:58:42 +00:00
Richard Henderson
38a448ca5d alias.c: Change all uses of gen_rtx(FOO...) to gen_rtx_FOO...
* alias.c: Change all uses of gen_rtx(FOO...) to gen_rtx_FOO;
change gen_rtx(expr...) to gen_rtx_fmt_foo(expr...).
* caller-save.c, calls.c, combine.c, cse.c: Likewise.
* dwarf2out.c, except.c, explow.c, expmed.c, expr.c: Likewise.
* final.c, flow.c, function.c, genpeep.c, haifa-sched.c: Likewise.
* halfpic.c, integrate.c, jump.c, local-alloc.c, loop.c: Likewise.
* profile.c, recog.c, reg-stack.c, regclass.c, regmove.c: Likewise.
* reload.c, reload1.c, reorg.c, sched.c, stmt.c, stupid.c: Likewise.
* unroll.c, varasm.c: Likewise.
* config/alpha/alpha.c, config/alpha/alpha.md: Likewise.

From-SVN: r17357
1998-01-14 15:10:50 -08:00
Richard Henderson
166cdf4ab4 * expmed.c (expand_shift): If SHIFT_COUNT_TRUNCATED, drop a SUBREG.
From-SVN: r17107
1997-12-15 10:39:02 -08:00
Jeff Law
956d69504d Merge from gcc-2.8
From-SVN: r16987
1997-12-06 17:31:01 -07:00
Jeff Law
e9a25f70a0 Update mainline egcs to gcc2 snapshot 971021.
From-SVN: r16278
1997-11-02 14:19:36 -07:00
Jim Wilson
3bf1b08254 Patches to fix minor optimizer bugs
Patches to fix minor optimizer bugs
	* expmed.c (extract_bit_field): Don't make flag_force_mem disable
	extzv for memory operands.
	* cse.c (simplify_ternary_operation, case IF_THEN_ELSE): Collapse
	redundant conditional moves to single operand.

From-SVN: r16129
1997-10-20 16:49:48 -07:00
David S. Miller
e13a25d5a3 expmed.c (expand_divmod): If compute_mode is not the same as mode...
* expmed.c (expand_divmod): If compute_mode is not the same as
        mode, handle the case where convert_modes() causes op1 to no
        longer be a CONST_INT.

From-SVN: r15672
1997-09-23 01:25:25 -06:00
Jeff Law
db7cafb0ad version.c: Bump for snapshot.
* version.c: Bump for snapshot.

        * expmed.c (expand_divmod): Make op1_is_pow2 depend on unsignedp
        for negative constants.  Promote EXACT_DIV_EXPR to TRUNC_DIV_EXPR
        when op1_is_pow2.

        * final.c (shorten_branches): During first pass, assume worst
        possible alignment for ADDR_VEC and ADDR_VEC_DIFF insns.

        * Makefile.in (distclean): Remove various things left around
        by running the testsuite.

From-SVN: r15136
1997-09-07 16:10:34 -06:00
Mike Stump
db3cf6fb33 reformat a little to match GNU coding standards.
From-SVN: r14024
1997-05-06 23:05:54 +00:00
Richard Kenner
dc38b29226 (expand_divmod): prefer divmod in same mode over div in wider mode.
From-SVN: r13638
1997-02-15 08:42:02 -05:00
Richard Kenner
12dd565fc5 (emit_store_flag): Properly test for STORE_FLAG_VALUE of just sign bit.
From-SVN: r13552
1997-01-27 09:04:44 -05:00
Richard Kenner
c7554b2898 (store_fixed_bit_field): If not SLOW_UNALIGNED_ACCESS, treat
everything as maximally aligned.

From-SVN: r13371
1997-01-04 18:58:26 -05:00
Jeff Law
e4565aff52 * expmed.c (emit_store_flag_force): Fix typos/thinkos.
From-SVN: r13296
1996-12-12 10:57:58 -07:00
Torbjorn Granlund
04a8ee2ff6 (emit_store_flag_force): New function.
From-SVN: r12987
1996-10-21 22:18:56 +00:00
Jim Wilson
4dbebeb224 (store_bit_field): don't make flag_force_mem disable insv
for memory operands.

From-SVN: r12843
1996-09-25 13:23:32 -07:00
Torbjorn Granlund
24dcc9c5c1 (expand_mult_highpart): Revert last change.
From-SVN: r12512
1996-07-17 14:26:56 +00:00
Mike Stump
0f41302f47 formatting tweaks
From-SVN: r12390
1996-07-03 22:07:53 +00:00
Richard Kenner
2d226eb101 (expand_mult_highpart): Use op1 not wide_op1 in expansion of
mul_highpart.

From-SVN: r12361
1996-06-28 14:24:24 -04:00
Jim Wilson
f8fe20b224 (extract_bit_field): Check TRULY_NOOP_TRUNCATION before
making a SUBREG of a REG.

From-SVN: r12338
1996-06-27 15:48:57 -07:00
Richard Kenner
3cd456066e (store_split_bit_field): Don't assume the alignment of VALUE is the
same as the record.

From-SVN: r12017
1996-05-17 17:24:12 -04:00
Richard Kenner
373e7d695e Fix typo in comment.
From-SVN: r11927
1996-05-05 13:18:02 -04:00
Torbjorn Granlund
dc1d615071 (expand_divmod, case TRUNC_DIV_EXPR): Move some code
to avoid shifting by a too large count.

From-SVN: r11645
1996-03-30 12:48:15 +00:00
Richard Kenner
fdb5537fe0 (negate_rtx): Fix typo in previous change.
From-SVN: r11624
1996-03-27 07:45:08 -05:00
Richard Kenner
a39a7484b1 (negate_rtx): Don't try to negate a constant ourself; instead call
simplify_unary_operation.

From-SVN: r11611
1996-03-24 08:16:26 -05:00
Richard Kenner
1d6eaf3dea (emit_store_flag): If expanding (GE X 0) will need two insns, don't use subtarget for the result of the first insn.
(emit_store_flag): If expanding (GE X 0) will need two
insns, don't use subtarget for the result of the first insn.
Move a likely constant to the start of a condition.

From-SVN: r11562
1996-03-18 20:04:00 -05:00
Jim Wilson
34ea783bd5 (extract_bit_field): For multi-word bitfield, clobber target before
storing to it.

From-SVN: r11059
1996-01-17 15:56:06 -08:00
Richard Kenner
e28ea75bd1 (extract_bit_field): Don't abort if not MEM_IN_STRUCT_P.
From-SVN: r11022
1996-01-16 09:09:47 -05:00
Torbjorn Granlund
a295d3317e (expand_mult_highpart): When doing widening multiply,
put constant in a register.
(expand_mult_highpart): When mode is word_mode use gen_highpart
instead of right shift by size.

From-SVN: r10789
1995-12-17 16:41:09 +00:00
Richard Kenner
1d269b0cdc (store_bit_field): Don't use insv for BLKmode value.
(store_split_bit_field): Set total_bits to BITS_PER_FOR for BLKmode value.

From-SVN: r10732
1995-12-15 08:05:34 -05:00
Torbjorn Granlund
34f016ed1f (expand_divmod...
(expand_divmod, case TRUNC_DIV_EXPR): Only reject
larger-than-HOST_BITS_PER_WIDE_INT modes for general constants,
not for powers-of-2.

From-SVN: r10727
1995-12-14 23:39:17 +00:00
Richard Kenner
a45cf58ce9 (expand_divmod): Don't use TARGET if it's the wrong mode.
From-SVN: r10708
1995-12-13 16:11:05 -05:00
Richard Kenner
1433f0f959 (SHIFT_COUNT_TRUNCATED): Use #ifdef not #if.
From-SVN: r10119
1995-07-13 19:26:03 -04:00
Richard Kenner
940d9d638b Update FSF address.
From-SVN: r9959
1995-06-15 07:33:25 -04:00
Richard Kenner
db2f8a07b4 (emit_store_flag): Always set LAST.
From-SVN: r9947
1995-06-14 16:37:00 -04:00
Richard Kenner
37811a734e (store_split_bit_field): When adjust arg in BYTES_BIT_ENDIAN case...
(store_split_bit_field): When adjust arg in BYTES_BIT_ENDIAN case, use
number of bits in arg for MEM operands and BITS_PER_WORD for other
operands.
(extract_fixed_bit_field): Undo last change.

From-SVN: r9911
1995-06-08 19:21:13 -04:00
Richard Kenner
f737b1326e (expand_divmod): Always check result of emit_store_flag.
From-SVN: r9905
1995-06-08 18:58:06 -04:00
Richard Kenner
374de9e2b8 (extract_fixed_bit_field): For REG case, compute total_bits from mode
instead of assuming BITS_PER_WORD.

From-SVN: r9865
1995-06-01 18:51:41 -04:00
Richard Kenner
d8f1376cd9 (expand_mult_highpart): Use wide_op1 for all multiplies.
(expand_divmod): Undo Nov 12 change.  Instead, add special case
for division by MIN_INT in signed TRUNC_DIV_EXPR case.

From-SVN: r9857
1995-05-31 20:57:17 -04:00
Richard Kenner
9faa82d8c0 Fix typos in comments.
From-SVN: r9712
1995-05-16 08:39:54 -04:00
Michael Meissner
91e6623506 If expensive optimizations, use different pseudos when making store flag insns.
From-SVN: r9562
1995-05-02 17:41:19 +00:00
Michael Meissner
641916126a Get correct bit offset for big endian (SUBREG (REG))
From-SVN: r9299
1995-04-03 20:19:05 +00:00
Doug Evans
d01bc86269 (store_split_bit_field): If value is VOIDmode, pass word_mode to force_reg.
From-SVN: r8940
1995-02-13 21:47:31 +00:00
Richard Kenner
668443c98a (expand_divmod): Always call expand_twoval_binop with psuedos as
targets.

From-SVN: r8905
1995-02-11 13:09:17 -05:00
Torbjorn Granlund
71af73bb7f (mul_cost, div_cost): New variables.
(mul_widen_cost, mul_highpart_cost): New variables.
(init_expmed): Init new variables.
(expand_mult_highpart): New argument, MAX_COST.
Use new argument in several places.  Simplify code that tries
widening multiply variants.
(expand_divmod): New variables MAX_COST, EXTRA_COST.
Initialize MAX_COST dependent on REM_FLAG.
Calculate and pass cost in all calls of expand_mult_highpart.

From-SVN: r8868
1995-02-06 02:37:27 +00:00
Doug Evans
767880cde6 Add 1995 to copyright.
From-SVN: r8760
1995-01-14 06:27:58 +00:00
Doug Evans
77295decc8 (extract_bit_field, fields bigger than word case): Count subwords in target.
(extract_bit_field, fields bigger than word case): Count
subwords in target.  Zero remaining upper bits if unsigned.

From-SVN: r8756
1995-01-14 06:19:31 +00:00
Jim Wilson
2f97afcb1e (expand_mult_highpart): Use convert_modes instead of
gen_lowpart to do conversions.

From-SVN: r8704
1994-12-29 11:06:04 -08:00
Doug Evans
6405e07b8d (emit_store_flag): Set mode after canonicalizing op0/op1 so op1 is constant.
From-SVN: r8646
1994-12-12 18:17:32 +00:00
Richard Kenner
39e7161505 (expand_shift): Open-code rotate even if by a variable.
From-SVN: r8579
1994-11-29 16:49:53 -05:00
Jim Wilson
5970d32e6e (store_bit_field, extract_bit_field): Consistently use
SLOW_UNALIGNED_ACCESS instead of STRICT_ALIGNMENT.

From-SVN: r8568
1994-11-28 16:58:04 -08:00
Jim Wilson
03f3609810 (expand_shift): Re-enable truncation of immediate shift count.
From-SVN: r8527
1994-11-19 15:37:10 -08:00
Ian Lance Taylor
f76b9db287 Check target endianness at run time, not compile time
From-SVN: r8470
1994-11-16 21:10:09 +00:00
Richard Kenner
69f619018a (expand_divmod, case ROUND_DIV_EXPR): Implement.
From-SVN: r8442
1994-11-15 16:50:23 -05:00
Richard Kenner
e80316129f (expand_divmod, case TRUNC_DIV_EXPR): Promote signed division by
0x80000000 to unsigned.

From-SVN: r8430
1994-11-12 06:35:09 -05:00
Richard Kenner
73f277280f (expand_divmod): Special case for signed CEIL_DIV_EXPR when divisor is
power of 2.

From-SVN: r8123
1994-09-22 18:56:08 -04:00
Jim Wilson
485fafaa15 (store_split_bit_field): Use number of bits in arg not
BITS_PER_WORD to adjust arg in BYTES_BIG_ENDIAN case.

From-SVN: r8086
1994-09-15 10:45:25 -07:00
Per Bothner
ad83e87b61 expmed.c (store_bit_field): Semi-revert Aug 25 change: Make it apply only for BLKmode, not integral modes.
* expmed.c (store_bit_field):  Semi-revert Aug 25 change:
Make it apply only for BLKmode, not integral modes.

From-SVN: r8007
1994-08-31 16:29:53 -07:00
Richard Kenner
4db3bddcbe (store_split_bit_field): Always adjust arg to extract_fixed_bit_field
in BYTES_BIG_ENDIAN case.

From-SVN: r8005
1994-08-31 18:54:44 -04:00
Per Bothner
556a4cb2c9 Always store into multi-word bitfields starting with low addresses.
From-SVN: r7985
1994-08-25 17:15:35 -07:00
Jim Wilson
ceb1d26880 (expand_mult): Accept DImode for synth_mult only if CONST_DOUBLE_HIGH is zero.
(expand_mult): Accept DImode for synth_mult only if
CONST_DOUBLE_HIGH is zero.  Reject negative values for synth_mult
if the mode is larger than HOST_BITS_PER_INT.  Don't do the
negate_variant if the mode is larger than HOST_BITS_PER_INT.

From-SVN: r7860
1994-08-05 09:29:21 -07:00
Richard Kenner
39e0911f45 ({store,extract}_bit_field): Don't use bitfield insn if OP0 is
register and bitfield spans it.

From-SVN: r7837
1994-07-30 18:09:27 -04:00
Richard Kenner
98310eaac7 (expand_mult): Properly set ADD_TARGET for add_variant.
From-SVN: r7802
1994-07-27 23:33:05 -04:00
Richard Kenner
4e430df869 (expand_divmod): Don't make REG_NOTE if last insn's destination isn't
QUOTIENT.

From-SVN: r7798
1994-07-27 14:06:24 -04:00
Torbjorn Granlund
412381d963 (expand_divmod, case CEIL_DIV_EXPR): Handle emit_store_flag returning 0.
From-SVN: r7768
1994-07-13 20:55:07 +00:00
Doug Evans
4ee16841d4 (extract_split_bit_field): Set UNIT to BITS_PER_WORD for register values.
(store_split_bit_field): Likewise.  Call operand_subword_force.

From-SVN: r7684
1994-07-08 21:16:01 +00:00
Richard Kenner
5b0ce75844 (expand_mult_highpart): Build constant forms of CNST1 in MODE or
WIDE_MODE, as appropriate.

From-SVN: r7676
1994-07-07 22:19:57 -04:00
Torbjorn Granlund
515dfc7a23 (expand_divmod): Clear out TARGET also if OP1 is a constant,
when TARGET == OP0.

From-SVN: r7661
1994-07-06 07:20:48 +00:00
Torbjorn Granlund
9176af2fd8 (expand_divmod): Fix typo setting op1_is_pow2.
(expand_divmod): Handle powers-of-two specifically for CEIL_*_EXPR.

From-SVN: r7658
1994-07-05 23:19:00 +00:00
Torbjorn Granlund
c8dbc8ca7f (expand_divmod): Always return gen_lowpart (mode, ...).
From-SVN: r7640
1994-07-02 13:33:56 +00:00
Torbjorn Granlund
ab0b65811b (expand_divmod): Put OP0 in a register when computing
remainder, or when OP1 is constant.

From-SVN: r7628
1994-07-01 11:40:45 +00:00
Richard Kenner
e9c1141151 (expand_divmod): Don't set REG_NOTES unless we generated a quotient.
From-SVN: r7627
1994-07-01 06:45:56 -04:00
Torbjorn Granlund
55c2d311c4 (expand_mult): Generalize to call synth_mult also for OP1 - 1.
(ceil_log2): New function.
(choose_multiplier): New function.
(invert_mod2n): New function.
(expand_mult_highpart_adjust): New function.
(expand_mult_highpart): New function.
(EXACT_POWER_OF_2_OR_ZERO_P): New macro.
(expand_divmod): Almost completely rewritten.
(expand_shift): Don't truncate immediate shift count, it doesn't work
for types smaller than int.

From-SVN: r7598
1994-06-29 00:23:02 +00:00
Richard Kenner
711a5e64b8 (expand_shift): Don't try extzv for lshr.
From-SVN: r7514
1994-06-18 10:31:51 -04:00
Richard Kenner
4c9a05bc55 Cast pointer operands to bzero, bcopy, and bcmp to (char *).
From-SVN: r7472
1994-06-14 18:19:28 -04:00
Richard Kenner
7831ef177b (expand_divmod): Correctly set CAN_CLOBBER_OP0 when we've converted OP0
to COMPUTE_MODE.

From-SVN: r7349
1994-05-26 11:55:34 -04:00
Jim Wilson
2305bcadd5 (store_fixed_bit_field): Delete code to handle MODE_FLOAT values here.
(store_fixed_bit_field): Delete code to handle
MODE_FLOAT values here.
(store_bit_field): Put it here instead.

From-SVN: r7279
1994-05-11 14:50:11 -07:00
Richard Kenner
82c68a7824 Add prototypes for static functions.
From-SVN: r7118
1994-04-21 15:31:56 -04:00
Richard Kenner
a34958c911 (expand_shift): No longer reference lshl_optab.
From-SVN: r7022
1994-04-10 08:04:35 -04:00
Jim Wilson
5f57dff07b (store_split_bit_field): If OP0 is a SUBREG, then compute WORD from the base register, instead of from the SUBREG.
(store_split_bit_field): If OP0 is a SUBREG, then
compute WORD from the base register, instead of from the SUBREG.
(extract_split_bit_field): Likewise.
(extract_bit_field): Sign-extend multiword bitfield if necessary.

From-SVN: r6668
1994-02-27 16:55:33 -08:00
Jim Wilson
3bd98790b0 (store_fixed_bit_field): Adjust BITPOS so that it
fits inside MODE before adjusting OFFSET to get an aligned address.

From-SVN: r6658
1994-02-27 14:46:49 -08:00
Jim Wilson
a5f00f07f1 (store_fixed_bit_field): Move float mode to integral
mode conversion from near end of function to top of function.

From-SVN: r6657
1994-02-27 14:44:49 -08:00
Torbjorn Granlund
2ab0a5c41c (expand_shift): Truncate immediate count if SHIFT_COUNT_TRUNCATED.
From-SVN: r6538
1994-02-12 12:40:58 +00:00
Doug Evans
bac7cdfd7d (store_bit_field, insv case): Don't use PUT_MODE on
xop0 when it is a SUBREG, generate a new SUBREG.

From-SVN: r6478
1994-02-03 22:14:46 +00:00
Richard Kenner
52786026fa (synth_mult): Delay allocation of algorithm structures until they are needed.
(synth_mult): Delay allocation of algorithm structures until they are
needed.  Reorder early-exit tests to avoid comparing value that is not
yet set.

From-SVN: r6464
1994-02-02 13:24:14 -05:00
Jim Wilson
bc8a0e39b7 (store_split_bit_field): Reject gen_lowpart_common
output if it returns the input value.

From-SVN: r6430
1994-01-24 16:33:14 -08:00
Jim Wilson
9033081d38 (store_split_bit_field): For BYTES_BIG_ENDIAN, only
pad on left if value not in memory.

From-SVN: r6429
1994-01-24 16:24:18 -08:00
Richard Kenner
c0a085741f (expand_mult): Preserve useful sub-expressions when
expanding a synthesized mult.

From-SVN: r6287
1993-12-23 18:27:51 -05:00
Richard Stallman
3d709ff063 (store_split_bit_field): Properly load a constant VALUE
into a WORD_MODE pseudo.

From-SVN: r6092
1993-11-15 01:55:03 +00:00
Richard Stallman
29d40fa4d8 (expand_divmod): If rem_flag, always force op0 to a register.
From-SVN: r6053
1993-11-10 21:28:27 +00:00
Richard Stallman
937aa51bba (expand_divmod): Use target as copy_to_suggested_reg
argument only if it has the same mode as op0.

From-SVN: r5984
1993-11-03 20:24:18 +00:00
Torbjorn Granlund
c0b262c166 (synth_mult): When factoring T, break from loop after first factor.
(expand_mult): Increase max cost to 12 again.

From-SVN: r5961
1993-11-01 11:18:32 +00:00
Richard Stallman
b348776522 (store_bit_field): When calling operand_subword_force,
if VALUE has a non-void mode, pass that mode.

From-SVN: r5939
1993-10-30 06:04:18 +00:00
Richard Stallman
d4c6dfec80 (init_expmed): Use register 10000, not FIRST_PSEUDO_REGISTER that gets special treatment in rtx_cost.
(init_expmed): Use register 10000, not FIRST_PSEUDO_REGISTER
that gets special treatment in rtx_cost.
(expand_mult): Decrease max cost to 8.

From-SVN: r5897
1993-10-26 17:39:52 +00:00
Richard Kenner
e10f6dd1a9 (expand_divmod): Create RESULT in proper mode when trying
quotient-and-remainder insn.

From-SVN: r5862
1993-10-21 13:48:04 -04:00
Richard Stallman
733484b5d6 (extract_split_bit_field): Change shift count calculation
in little-endian case.

From-SVN: r5794
1993-10-18 20:17:08 +00:00
Richard Stallman
c2ec26b8af (expand_shift): Use convert_modes.
(emit_store_flag): Likewise.

From-SVN: r5309
1993-09-12 12:51:14 +00:00
Richard Stallman
81722fa979 (emit_store_flag, expand_divmod): Use convert_modes.
From-SVN: r5295
1993-09-09 19:19:51 +00:00
Richard Kenner
4b46230e9d (make_tree, case CONST_INT): Properly set high part if unsigned.
From-SVN: r5280
1993-09-08 06:15:49 -04:00
Jeff Law
bd5d175ab8 expmed.c (store_bit_field): Do not use bitfield instructions for STRICT_ALIGNMENT machines if...
* expmed.c (store_bit_field): Do not use bitfield instructions for
	STRICT_ALIGNMENT machines if the MEM's alignment isn't as big as
	the MEM's mode.

From-SVN: r5213
1993-08-25 17:38:10 -06:00
Richard Stallman
c7e33f8937 (SLOW_UNALIGNED_ACCESS): Define, but allow override.
(store_bit_field): Test that instead of STRICT_ALIGNMENT.
Also, allow fetching as non-bitfield if memory is aligned enough.
(extract_bit_field): Install code here like that in store_bit_field.

From-SVN: r5131
1993-08-11 05:22:55 +00:00
Richard Kenner
bc1c7e9300 (expand_divmod): Clean up code and documentation, especially in areas
related to when copies are made.

From-SVN: r5098
1993-08-07 07:43:53 -04:00
Richard Kenner
819126a607 (mult_is_very_cheap): Delete.
(mult_cost): Delete.
(init_expmed): Delete computation of mult_cost and mult_is_very_cheap.
(expand_mult): Compute mult_cost here for every constant multiplier.
(synth_mult): Return found algorithms through a struct pointer.

From-SVN: r5045
1993-07-30 06:49:23 -04:00
Doug Evans
0eb61c19ed expmed.c (store_split_bitfield): Fix handling of bitfields that cross word boundaries...
* expmed.c (store_split_bitfield): Fix handling of bitfields that
 cross word boundaries, can only handle a word at a time.
 (extract_split_bitfield): Likewise.

From-SVN: r5012
1993-07-28 16:39:07 +00:00
Richard Stallman
06c94bceeb (store_split_bit_field, extract_split_bit_field):
Handle fields split across more than 2 aligned units.

From-SVN: r4840
1993-07-05 03:30:59 +00:00
Richard Stallman
e49a094d25 (MAX_BITS_PER_WORD): Define earlier.
(shift_cost, shiftadd_cost, shiftsub_cost): Use MAX_BITS_PER_WORD.

From-SVN: r4657
1993-06-10 17:00:40 +00:00
Torbjorn Granlund
63610db99b (synth_mult): Move code to add or subtract at leftmost 1-bit to before...
(synth_mult): Move code to add or subtract at
leftmost 1-bit to before factoring code to decrease the allowed cost
quickly.  Restrict it to handle only odd numbers.
(init_expmed): Limit mult_cost to make synth_mult run faster.

From-SVN: r4636
1993-06-05 09:52:14 +00:00
Richard Stallman
172a1cb0ef (init_expmed): Supply missing arg to rtx_cost.
From-SVN: r4385
1993-05-08 19:32:22 +00:00
Richard Kenner
e54d80d014 (store_split_bit_field): Properly handle VALUE when it is a
CONST_DOUBLE.

From-SVN: r4354
1993-05-06 05:47:46 -04:00
Jim Wilson
401db79156 (extract_fixed_bit_field): Adjust BITPOS so that it
fits inside MODE before adjusting OFFSET to get an aligned address.

From-SVN: r4216
1993-04-25 14:07:22 -07:00
Richard Stallman
f2dd837227 (expand_divmod): When adjusting op0 for trunc_div or trunc_mod...
(expand_divmod): When adjusting op0 for trunc_div or
trunc_mod, using shifts (not branches), make a new pseudo for the
result.  Don't use target for adjusted_op0.

From-SVN: r4081
1993-04-11 08:08:54 +00:00
Torbjorn Granlund
dac57de003 (init_expmed): Fix typo in last change.
From-SVN: r3801
1993-03-20 16:22:37 +00:00
Richard Kenner
5eebe2eb03 (synth_mult): Don't try to make recursive call if we would be shifting by a negative number.
(synth_mult): Don't try to make recursive call if we would be shifting
by a negative number.
(expand_mult): Don't negate VAL if it is negative.

From-SVN: r3788
1993-03-19 17:30:21 -05:00
Richard Kenner
b385aeda3f (zero_cost): New variable.
(init_expmed): Always pass some insn to recog.
Set shift_cost[0], shiftadd_cost[0] and shiftsub_cost[0] to something
reasonable.
Compute zero_cost.
(enum alg_code): Remove alg_none; add alg_zero and alg_m.
(struct algorithm): Rename field COEFF to LOG.
(synth_mult): Use new ops alg_zero and alg_m for multiplication by zero and
one, respectively.
Use MIN when helpful.
Be consistent and don't test cost before recursive call.
Don't special-case shift counts of zero; already handled elsewhere.
(expand_mult): First operation is always alg_zero or alg_m; remaining
operations can't be one of those.
Use proper subtargets for computations.
Remove special-cases for shift counts of zero.
Track value computed so far and make REG_EQUAL notes.

From-SVN: r3786
1993-03-19 06:27:23 -05:00
Richard Kenner
b2fb324cbf (lea_max_mul): Delete.
(init_expmed): Delete unused variable I.
(enum alg_code): New tag alg_shift.  Document it.
(synth_mult): Delete unused variable N.  Handle new trivial case
first, for T <= 1.  Generalize shifting code to shift whenever a
number is even; use alg_shift for this.  Set best_alg->ops only in
trivial case.  Clean up cost calculation code for the `simple case' at
the end; use shiftadd_cost when appropriate.  Combine declarations of
Q and move to top of function.  Eliminate use of Q in factoring cases.
If we are getting too long a sequence for `struct algorithm' to
record, fail.
(expand_mult): Handle alg_shift instead of alg_add_t_m2 as first
operation.  In RLT emit loop, handle alg_shift; special case LOG == 0
for alg_add_t_m2 and alg_sub_t_m2.

From-SVN: r3750
1993-03-15 18:38:07 -05:00
Richard Kenner
7963ac373a (shift_cost): Now a vector.
(shiftadd_cost): New vector for cost of (N * a + b) instructions.
(shiftsub_cost): New vector for cost of (N * a - b) instructions.
(lea_cost): Removed.
(init_expmed): Initialize new vectors.  Use ASHIFT, not LSHIFT.
Remove code initializing lea_cost.
(enum alg_code): New definition.
(synth_mult): Rewrite for better algorithms and faster operation.
(expand_mult): Rewrite code for constant multiplication.

From-SVN: r3735
1993-03-14 21:26:55 -05:00
Richard Kenner
c8c1bde3bb (emit_store_flag): Fix typo in testing BRANCH_COST.
From-SVN: r3533
1993-02-25 17:52:02 -05:00
Richard Stallman
522ae84c3d (emit_store_flag): Add missing arg to convert_move.
From-SVN: r3437
1993-02-08 04:34:45 +00:00
Richard Kenner
c2615a67c7 (emit_store_flag): Swap operands if first is a constant and second is not.
Abort if compare_from_rtx didn't return an rtx with the code we expect.

From-SVN: r3371
1993-01-27 19:23:02 -05:00
Richard Stallman
8deb7047a6 (emit_store_flag): Reset ICODE using returned COMPARISON.
From-SVN: r3315
1993-01-24 00:03:35 +00:00
Richard Kenner
cbec710efc (expand_shift): If rotating by a constant, try both directions of rotate...
(expand_shift): If rotating by a constant, try both directions of
rotate; if can't open-code a rotate, do it as a pair of shifts
followed by an IOR.

From-SVN: r2971
1992-12-28 06:07:52 -05:00
Richard Stallman
f5df292efc (store_bit_field): If VALUE needs to be narrowed, do
it with gen_lowpart, not an explicit SUBREG.

From-SVN: r2920
1992-12-27 03:55:29 +00:00
Richard Stallman
3b2f07926a (struct algorithm): Make coeff a HOST_WIDE_INT.
From-SVN: r2806
1992-11-26 15:34:10 +00:00
Richard Kenner
2c414fba8e (expand_mult): Bound second synth_mult cost by cost of algorithm from
first call.

(expand_divmod): When doing logical operations, the size of
COMPUTE_MODE should be used, not MODE.

From-SVN: r1869
1992-08-17 07:34:23 -04:00
Tom Wood
3d32ffd13f (expand_divmod): Eliminate the generation of branches
when possible.

From-SVN: r1687
1992-07-25 10:14:05 +00:00
Richard Stallman
b3d4e1b2a1 (expand_shift, expand_set_flag):
Call protect_from_queue before convert_to_mode.

From-SVN: r1606
1992-07-17 04:24:33 +00:00
Charles Hannum
b1ec3c9262 entered into RCS
From-SVN: r1472
1992-07-06 20:04:10 +00:00
Richard Kenner
4b980e20ad *** empty log message ***
From-SVN: r1318
1992-06-28 06:10:54 -04:00
Richard Stallman
d8064a5d0a *** empty log message ***
From-SVN: r1101
1992-05-27 20:52:20 +00:00
Richard Kenner
c2a47e48d5 *** empty log message ***
From-SVN: r1045
1992-05-22 06:33:37 -04:00
Richard Stallman
66c1f88e8e *** empty log message ***
From-SVN: r1007
1992-05-18 05:34:36 +00:00
Richard Stallman
b7a091350e *** empty log message ***
From-SVN: r979
1992-05-14 21:37:58 +00:00
Richard Stallman
56a2f04910 *** empty log message ***
From-SVN: r787
1992-04-19 01:16:25 +00:00
Richard Stallman
aeedc93fba *** empty log message ***
From-SVN: r779
1992-04-18 19:40:49 +00:00
Richard Kenner
717702e6ae *** empty log message ***
From-SVN: r680
1992-04-04 04:43:06 -05:00
Richard Stallman
36d747f619 *** empty log message ***
From-SVN: r573
1992-03-23 02:16:03 +00:00
Torbjorn Granlund
44037a668c Initial revision
From-SVN: r401
1992-03-06 19:37:23 +00:00