aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/avr/libgcc.S
AgeCommit message (Collapse)AuthorFilesLines
2009-01-12re PR target/29141 (static constructors beyond 64k fail)Anatoly Sokolov1-9/+83
PR target/29141 * config/avr/t-avr (LIB1ASMFUNCS): Add _tablejump_elpm. * config/avr/libgcc.S (__do_global_ctors, __do_global_dtors): Add variant for devices with 3-byte PC. (__tablejump_elpm__) : New. From-SVN: r143306
2008-04-07avr.h (avr_mega_p): Remove declaration.Anatoly Sokolov1-1/+1
* config/avr/avr.h (avr_mega_p): Remove declaration. (AVR_MEGA): Remove macro. * config/avr/avr.c (avr_mega_p): Remove variable. (avr_override_options): Remove inicializion of avr_mega_p. Use AVR_HAVE_JMP_CALL instead of AVR_MEGA. (print_operand): Use AVR_HAVE_JMP_CALL instead of AVR_MEGA. (avr_jump_mode): (Ditto.). (avr_output_progmem_section_asm_op): (Ditto.). (avr_asm_init_sections): (Ditto.). (avr_asm_init_sections): (Ditto.). (avr_rtx_costs): (Ditto.). * config/avr/avr.md: (Ditto.). * config/avr/avr.h: Use '__AVR_HAVE_JMP_CALL__' instead of '__AVR_MEGA__'. From-SVN: r133966
2008-03-15avr.c (avr_arch_types): Add avr6 entry.Bjoern Haase1-0/+14
* gcc/gcc/config/avr/avr.c (avr_arch_types): Add avr6 entry. (avr_arch): Add ARCH_AVR6. (avr_mcu_types): Add 'atmega2560' and 'atmega2561' entry. (initial_elimination_offset): Initialize and use 'avr_pc_size' instead of fixed value 2. (print_operand_address): Use gs() asm specifier instead of pm(). (avr_assemble_integer): (Ditto.). (avr_output_addr_vec_elt): (Ditto.). (print_operand): Handle "!" code. * gcc/gcc/config/avr/avr.h (TARGET_CPU_CPP_BUILTINS): Add __AVR_3_BYTE_PC__, __AVR_2_BYTE_PC__ and __AVR_HAVE_JMP_CALL__. (AVR_HAVE_EIJMP_EICALL): Define. (AVR_3_BYTE_PC): Redefine. (AVR_2_BYTE_PC): (Ditto.). (PRINT_OPERAND_PUNCT_VALID_P): Add '!' code. (LINK_SPEC): Add atmega2560 and atmega2561. (CRT_BINUTILS_SPEC): Add atmega2560 (crtm2560.o) and atmega2561 (crtm2561.o). * gcc/gcc/config/avr/avr.md (call_insn): Use eicall instead of icall for 3 byte PC devices. (call_value_insn): (Ditto.). (*tablejump_enh): Use eijmp instead of ijmp for 3 byte PC devices. (indirect_jump): Use only for for 2 byte PC devices. (*tablejump): (Ditto.). (*indirect_jump_avr6): Add insn. (*tablejump_rjmp): Don't use for 3 byte PC devices. * gcc/gcc/config/avr/libgcc.S (__prologue_saves__): Use eijmp instead of ijmp for 3 byte PC devices. (__tablejump2__): (Ditto.). * gcc/gcc/config/avr/t-avr (MULITLIB_OPTIONS): Add avr6 architecture. (MULITLIB_DIRNAMES): (Ditto.). (MULTILIB_MATCHES): Add atmega2560 and atmega2561 to list. Co-Authored-By: Anatoly Sokolov <aesok@post.ru> From-SVN: r133248
2008-02-22libgcc.S (__RAMPZ__): Define.Anatoly Sokolov1-7/+43
* config/avr/libgcc.S (__RAMPZ__): Define. (__do_copy_data): Add for devices with 128KB code memory. From-SVN: r132555
2008-01-19* config/avr/avr.S (_exit): Disable interrupt.Anatoly Sokolov1-1/+3
From-SVN: r131651
2007-01-17avr.h (AVR_HAVE_LPMX): New macro.Anatoly Sokolov1-6/+6
* config/avr/avr.h (AVR_HAVE_LPMX): New macro. (AVR_ENHANCED): Rename to ... (AVR_HAVE_MUL): ... new. (avr_enhanced_p): Rename to ... (avr_have_mul_p): ... new. (TARGET_CPU_CPP_BUILTINS): Use 'avr_have_mul_p' instead of 'avr_enhanced_p' for "__AVR_ENHANCED__". Define "__AVR_HAVE_MUL__". * config/avr/avr.c (avr_enhanced_p): Rename to ... (avr_have_mul_p): ... new. (base_arch_s): Rename 'enhanced' to 'have_mul'. (avr_override_options): Use 'avr_have_mul_p' and 'have_mul' instead of 'avr_enhanced_p' and 'enhanced'. (ashlhi3_out, ashrhi3_out, lshrhi3_out, avr_rtx_costs): Use AVR_HAVE_MUL instead of AVR_ENHANCED. * avr.md (*tablejump_enh): Use AVR_HAVE_LPMX instead of AVR_ENHANCED. (mulqi3, *mulqi3_enh, *mulqi3_call, mulqihi3, umulqihi3, mulhi3, *mulhi3_enh, *mulhi3_call, mulsi3, *mulsi3_call): Use AVR_HAVE_MUL instead of AVR_ENHANCED. (*tablejump_enh): Use AVR_HAVE_LPMX instead of AVR_ENHANCED. * libgcc.S: Use __AVR_HAVE_MUL__ instead of __AVR_ENHANCED__. (__tablejump__): Use __AVR_HAVE_LPMX__ instead of __AVR_ENHANCED__. From-SVN: r120865
2006-06-19libgcc.S: Correct my wrong previous commit.Denis Chertykov1-7/+7
* config/avr/libgcc.S : Correct my wrong previous commit. From-SVN: r114774
2005-06-25Update FSF address.R. Kelley Cook1-2/+2
From-SVN: r101314
2002-06-01Support for C++ constructors/destructors.Marek Michalkiewicz1-5/+107
* config/avr/avr.c (avr_output_function_epilogue): Jump to exit() instead of looping if main() returns. (asm_file_start): Output global symbols that cause .data and .bss initialization code to be linked in, unconditionally for now. (avr_asm_out_ctor, avr_asm_out_dtor): New functions. * config/avr/avr.h (CTORS_SECTION_ASM_OP, DTORS_SECTION_ASM_OP): New. (TARGET_ASM_CONSTRUCTOR, TARGET_ASM_DESTRUCTOR): New. (LIBSTDCXX): New. * config/avr/libgcc.S (_exit): Split in .fini9 and .fini0 sections. (__tablejump__): New. (__do_copy_data, __do_clear_bss): New. (__do_global_ctors, __do_global_dtors): New. * config/avr/t-avr (LIB1ASMFUNCS): Add _copy_data, _clear_bss, _ctors, _dtors. From-SVN: r54156
2001-03-31* config/avr/libgcc.S (__mulhi3): Optimize previous change.Marek Michalkiewicz1-2/+1
From-SVN: r40976
2001-03-28libgcc.S (__mulhi3): Correct tests to exit the loop when multiplier or ↵Marek Michalkiewicz1-1/+3
multiplicand is zero. * config/avr/libgcc.S (__mulhi3): Correct tests to exit the loop when multiplier or multiplicand is zero. From-SVN: r40933
2001-01-21avr.c (ret_cond_branch): New argument (reverse) added.Denis Chertykov1-1/+1
* config/avr/avr.c (ret_cond_branch): New argument (reverse) added. If REVERSE nonzero then condition code in X must be reversed. (encode_section_info): Optimise if/else. (avr_function_value): Fix formatting. * config/avr/avr.md (branch): Call to ret_cond_branch changed. (difficult_branch): Likewise. (rvbranch): Likewise. (difficult_rvbranch): Likewise. * config/avr/avr-protos.h (ret_cond_branch): Prototype changed. * config/avr/libgcc.S: Fix comment. From-SVN: r39163
2001-01-20avr.h (INIT_TARGET_OPTABS): Remove most of it, was the same as the default ↵Marek Michalkiewicz1-273/+234
library function names. * config/avr/avr.h (INIT_TARGET_OPTABS): Remove most of it, was the same as the default library function names. * config/avr/avr.md: Document special characters after '%'. (mulqi3, mulhi3, mulsi3): Call libgcc.S functions ourselves, knowing which of the call-used registers are really clobbered. (divmodqi4, udivmodqi4, divmodhi4, udivmodhi4, divmodsi4, udivmodsi4): New. Both quotient and remainder from one libgcc.S call. * config/avr/libgcc.S: Optimize mul/divmod for the new insns above, clobber as few registers as possible. * config/avr/t-avr (LIB1ASMFUNCS): Adjust for the above changes. From-SVN: r39155
2000-11-14avr.c (avr_case_values_threshold): New.Marek Michalkiewicz1-4/+6
* config/avr/avr.c (avr_case_values_threshold): New. (avr_override_options): Set it depending on options, make it large when not optimizing to work around "unable to generate reloads". * config/avr/avr.h (TARGET_SWITCHES): Add -mno-tablejump option. (EXTRA_SECTION_FUNCTIONS): Make the .progmem.gcc_sw_table section executable if not AVR_MEGA. Make sure jump tables are word-aligned. (JUMP_TABLES_IN_TEXT_SECTION): Define as 0, not 1. (ASM_OUTPUT_ADDR_VEC_ELT): Optimize, use "rjmp" if not AVR_MEGA. (avr_case_values_threshold): Declare as extern int. (CASE_VALUES_THRESHOLD): Define as avr_case_values_threshold. * config/avr/avr.md (tablejump): Removed. (*tablejump_rjmp): New for jump tables made from "rjmp" instructions. (*tablejump_lib, *tablejump_enh, *tablejump): Change to expect the index in the table, not multiplied by 2. (casesi): Change to match the above insns. Always enable. * config/avr/libgcc.S (__tablejump__): Rename to __tablejump2__. Change to expect the word address of the table, multiply it by 2 here and not in the caller. Change "adiw" to faster "inc". From-SVN: r37465
2000-09-02avr.md ("*negsi2"): substitute %@ to __zero_reg__Marek Michalkiewicz1-120/+164
* config/avr/avr.md ("*negsi2"): substitute %@ to __zero_reg__ * config/avr/libgcc.S: Lost part of the previous patch. From-SVN: r36116
2000-08-29avr-protos.h: (avr_output_ascii) Removed.Denis Chertykov1-2/+32
* config/avr/avr-protos.h: (avr_output_ascii) Removed. (avr_progmem_p): New prototype. (output_movsisf): Prototype declaration changed. (output_movqi): New prototype. (output_movhi): New prototype. (call_insn_operand): Likewise. (final_prescan_insn): Likewise. (avr_simplify_comparision_p): Likewise. (avr_normalize_condition): Likewise. (compare_eq_p): Likewise. (out_shift_with_cnt): Likewise. (const_int_pow2_p): Likewise. (output_reload_inhi): Prototype declaration changed. * config/avr/avr.c: (debug_hard_reg_set): Prototype declared. (ldi_reg_rtx): New. rtx for r31. (avr_init_stack): Initialize as "__stack". (function_prologue): Use it. Replace all TARGET_ENHANCED with AVR_ENHANCED. (avr_mcu_name): Initialize as "avr2". (avr_enhanced_p, avr_mega_p): New variables. (mcu_types, avr_override_options): Handle all known MCU types. Also handle avr1 (only preprocess, assemble and link). (print_operand): Using of `%K' in output template removed. (out_movqi_r_mr): Optimized. (out_movhi_r_mr): Likewise. (output_movqi): New function. (output_movhi): Likewise. (out_movsi_r_mr): Optimized. (output_movsisf): Compute insn length for `adjust_insn_length' (out_movqi_mr_r): Optimized. (out_movhi_mr_r): Optimized. (adjust_insn_length): Use output_movsisf, output_movqi, output_movhi for insn length adjusting. (reg_unused_after): Use dead_or_set_p. (preferred_reload_class): Now havn't any restriction. (reg_was_0): New function. (io_address_p): Likewise. (const_int_pow2_p): Likewise. (output_reload_inhi): Likewise. (output_reload_insisf): Likewise. * config/avr/avr.h (MULTILIB_DEFAULTS): Define. (LIB_SPEC): Use -lc for all supported devices. (LIBGCC_SPEC): Use -lgcc for all supported devices. (AVR_MEGA): Define as avr_mega_p. (AVR_ENHANCED): New, define as avr_enhanced_p. (TARGET_SWITCHES): Remove -menhanced, now handled by -mmcu=... (CPP_SPEC, LINK_SPEC): Handle all known MCU types. (CRT_BINUTILS_SPECS): Handle all known MCU types. Rename gcrt1-*.o to make file names unique on 8.3 filesystems. (EXTRA_SPECS): Add CPP_AVR[1-5]_SPEC. (ASM_SPEC): Pass -mmcu=... to the assembler. Change all -DAVR_* to -D__AVR_*__. (INIT_TARGET_OPTABS), config/avr/libgcc.S: Rename library functions to start with two underscores. (ASM_OUTPUT_COMMON): Outputs `.comm VAR,VAR-SIZE,1' to avoid alignment. (ASM_WEAKEN_LABEL): Declared for __attribute__((weak)). (SUPPORTS_WEAK): Likewise. (LDI_REG_REGNO): New. Register r31 will be used as temporary register for loading constants to r0-r14. * config/avr/avr.md: Replace all TARGET_ENHANCED with AVR_ENHANCED. (*mov_r_sp): Removed. Handled by output_movhi. (*mov_sp_r): Likewise. (*mov_sp_r_no_interrupts): Likewise (*mov_sp_r_tiny): Likewise. (*movqi): Use output_movqi. (*reload_inqi): New. (*movhi): Use output_movhi. (*reload_inhi): New. (*negsi2): Optimized. (*negsf2): Likewise. Added peepholes (define_peephole2) for loading constants to r0-r14 and for using `cpse' command. * config/avr/libgcc.S: Rename library functions to start with two underscores. Add support for enhanced core. (_moqhi3): Fix typo, now _modqi3. (__divsi_raw): Use __zero_reg__ as loop counter, smaller by 1 word. (__prologue_saves__): Remove test for stack adjust by 0. (__tablejump__): New. * config/avr/t-avr: Build libgcc2 with -mcall-prologues. Add multilib support. From-SVN: r36047
2000-07-03avr.c (out_adj_frame_ptr): Make "frame pointer change too big for ↵Marek Michalkiewicz1-8/+8
-mtiny-stack" a warning, if larger than 63. * config/avr/avr.c (out_adj_frame_ptr): Make "frame pointer change too big for -mtiny-stack" a warning, if larger than 63. (out_set_stack_ptr): Change the logic so -mno-interrupts is always safe to use on possible future devices. (function_prologue): Write SPH before SPL, for consistency. If interrupt_func_p true, we know we have enabled interrupts. (avr_num_arg_regs): New function. Round up to even number of bytes if no -mpack-args or if calling a libgcc function. (function_arg, function_arg_advance): Use it. (output_movsisf, ashlsi3_out, ashrsi3_out, lshrsi3_out): Output "movw" if available. (out_tsthi, out_tstsi, ashlqi3_out, lshrqi3_out): Change uses of TEST_HARD_REG_CLASS macro to test_hard_reg_class function. (asm_output_section_name): Add blanks for consistent output. (encode_section_info): Set TREE_READONLY for progmem data to avoid gas warnings about changed section attributes. (avr_hard_regno_mode_ok): Force non-QImode data to start in even numbered registers on devices with "movw". * config/avr/avr.h (MASK_*): Define bits for target_flags. (TARGET_SWITCHES): Mark help strings for translation. Add new -mpack-args and -menhanced switches. (TARGET_OPTIONS): Mark help strings for translation. (progmem_section): Add section attributes. * config/avr/avr.md (*movhi, call_insn, call_value_insn): Output "movw" if available. (mulqi3, mulqihi3, umulqihi3, mulhi3, *tablejump_enh): New patterns. * config/avr/libgcc.S (_mulqi3, _divqi3): Update to the new call convention (arguments aligned on even registers). (_cleanup, _exit): Make weak symbols libc can override. From-SVN: r34847
2000-06-24avr-protos.h (avr_hard_regno_mode_ok): New prototype.Marek Michalkiewicz1-4/+4
* config/avr/avr-protos.h (avr_hard_regno_mode_ok): New prototype. * config/avr/avr.c (out_adj_frame_ptr, out_set_stack_ptr): New functions, common code moved from function_{prologue,epilogue} and extended to support the -mtiny-stack option. (function_prologue, function_epilogue): Use them. Use lo8/hi8 consistently for asm output readability. (avr_hard_regno_mode_ok): New function. * config/avr/avr.h (TARGET_SWITCHES): Fix typo. Add -mtiny-stack. (UNITS_PER_WORD): Define as 4 (not 1) when compiling libgcc2.c. (HARD_REGNO_MODE_OK): Call the avr_hard_regno_mode_ok function. * config/avr/avr.md (*mov_sp_r): Add support for -mtiny-stack. Write SPH before SPL. (*movqi): No need to disable interrupts for just one "out" in alternative 5. Change length attribute from 4 to 1. * config/avr/libgcc.S (__prologue_saves__, __epilogue_restores__): Write SPH before SPL. From-SVN: r34678
2000-06-07avr.c (asm_output_section_name): output section attributes.Denis Chertykov1-1/+1
* config/avr/avr.c (asm_output_section_name): output section attributes. * config/avr/libgcc.S (.text.libgcc): declare section attributes. From-SVN: r34445
2000-05-15Update to libgcc copyright exception clause.Jeff Law1-12/+6
From-SVN: r33916
2000-03-02Denis Chertykov <denisc@overta.ru>Denis Chertykov1-118/+96
* avr.c (print_operand): Use print_operand_address instead of output_addr_const. * avr/libgcc.S: Cleanup code. From-SVN: r32305
2000-02-11Denis Chertykov <denisc@overta.ru>Denis Chertykov1-0/+666
* README.AVR: New file with information about the avr ports. * config/avr: New directory with avr port files. From-SVN: r31935