Skip to content
Snippets Groups Projects
  1. Jan 14, 2013
  2. Jan 10, 2013
  3. Jan 07, 2013
    • Georg-Johann Lay's avatar
      re PR target/55897 ([avr] Allocate __memx data to .progmemx.data) · e5669488
      Georg-Johann Lay authored
      	PR target/55897
      	* config/avr/avr.h (ADDR_SPACE_COUNT): New enum.
      	(avr_addrspace_t): Add .section_name field.
      	* config/avr/avr.c (progmem_section): Use ADDR_SPACE_COUNT as
      	array size.
      	(avr_addrspace): Same.  Initialize .section_name.  Remove last
      	NULL entry.  Put __memx into .progmemx.data.
      	(progmem_section_prefix): Remove.
      	(avr_asm_init_sections): No need to initialize progmem_section.
      	(avr_asm_named_section): Use avr_addrspace[].section_name to get
      	section name prefix.
      	(avr_asm_select_section): Ditto.  And use get_unnamed_section to
      	retrieve the progmem section.
      	* avr-c.c (avr_cpu_cpp_builtins): Use ADDR_SPACE_COUNT as loop
      	boundary to run over avr_addrspace[].
      	(avr_register_target_pragmas): Ditto.
      
      From-SVN: r194991
      e5669488
  4. Jan 04, 2013
  5. Oct 17, 2012
    • Georg-Johann Lay's avatar
      avr-arch.h (avr_extra_arch_macro): Remove prototype. · eb5af262
      Georg-Johann Lay authored
      	* config/avr/avr-arch.h (avr_extra_arch_macro): Remove prototype.
      	* config/avr/avr.c (avr_extra_arch_macro): Remove variable.
      	(avr_option_override): Remove setting of avr_extra_arch_macro.
      	* config/avr/avr-c.c (avr_extra_arch_macro): Replace with
      	avr_current_device->macro.
      
      From-SVN: r192532
      eb5af262
  6. Sep 05, 2012
    • Georg-Johann Lay's avatar
      re PR target/54461 ([avr] add configure option for better AVR-Libc integration) · b588ae30
      Georg-Johann Lay authored
      	PR target/54461
      	* configure.ac (noconfigdirs,target=avr-*-*): Add target-newlib,
      	target-libgloss if not configured --with-avrlibc=no.
      	* configure: Regenerate.
      
      libgcc/
      	PR target/54461
      	* config.host (tmake_file,host=avr-*-*): Add avr/t-avrlibc if
      	not configured --with-avrlibc=no.
      	* config/avr/t-avrlibc: New file.
      	* Makefile.in (FPBIT_FUNCS): filter-out LIB2FUNCS_EXCLUDE.
      	(DPBIT_FUNCS): Ditto.
      	(TPBIT_FUNCS): Ditto.
      
      gcc/
      	PR target/54461
      	* config.gcc (tm_file,target=avr-*-*): Add avr/avrlibc.h if
      	not configured --with-avrlibc=no.
      	(tm_defines,target=avr-*-*): Add WITH_AVRLIBC if not configured
      	--with-avrlibc=no.
      	* config/avr/avrlibc.h: New file.
      	* config/avr/avr-c.c: Build-in define __WITH_AVRLIBC__ if
      	not configured --with-avrlibc=no.
      	* doc/invoke.texi (AVR Built-in Macros): Document __WITH_AVRLIBC__
      
      From-SVN: r190967
      b588ae30
  7. Mar 28, 2012
    • Georg-Johann Lay's avatar
      re PR target/52737 ([avr]: -mtiny-stack shall not influence multilib selection) · 7fd6378e
      Georg-Johann Lay authored
      	PR target/52737
      	* contrib/gcc_update (files_and_dependencies):
      	Remove gcc/config/avr/t-multilib from touch data.
      
      gcc/
      	PR target/52737
      	* config.gcc (tm_file): Remove avr/multilib.h.
      
      	* doc/invoke.texi (AVR Options): Adjust
      	documentation of -mtiny-stack.
      
      	* config/avr/genmultilib.awk: Remove code to generate multilib.h.
      	(BEGIN): Use -msp8 as multilib option instead of -mtiny-stack.
      	* config/avr/t-avr: Remove generation of multilib.h.
      	* config/avr/t-multilib: Regenerate.
      	* config/avr/multilib.h: Remove.
      	* config/avr/avr.opt (-msp8): New option.
      	(avr_sp8): New variable.
      	* config/avr/driver-avr.c (avr_device_to_sp8): New function.
      	* config/avr/avr.h (AVR_HAVE_SPH): New define.
      	(AVR_HAVE_8BIT_SP): Also set by avr_sp8 i.e. -msp8.
      	(avr_device_to_sp8): New prototype.
      	(EXTRA_SPEC_FUNCTIONS): Add { "device_to_sp8", avr_device_to_sp8 }
      	(DRIVER_SELF_SPECS): New define.
      	* config/avr/avr-c.c (avr_cpu_cpp_builtins): New built-in defines:
      	__AVR_SP8__, __AVR_HAVE_SPH__.
      	* config/avr/avr.c (output_movhi): Use AVR_HAVE_SPH instead of
      	AVR_HAVE_8BIT_SP to decide if SP_H is present.
      	(avr_file_start): Ditto.
      	
      libgcc/
      	PR target/52737
      	* config/avr/lib1funcs.S: Use __AVR_HAVE_SPH__ for SP_H checks
      	instead of __AVR_HAVE_8BIT_SP__.
      
      From-SVN: r185907
      7fd6378e
  8. Mar 01, 2012
  9. Feb 28, 2012
    • Georg-Johann Lay's avatar
      builtins.def: New file. · 639d0302
      Georg-Johann Lay authored
      	* config/avr/builtins.def: New file.
      	* config/avr/t-avr (avr.o, avr-c.o): Depend on it.
      	* config/avr/avr.c (enum avr_builtin_id): Use it.
      	(avr_init_builtins): Use it. And use avr_bdesc.
      	(bdesc_1arg): Remove.
      	(bdesc_2arg): Remove.
      	(bdesc_3arg): Remove.
      	(struct avr_builtin_description): Add field n_args.
      	(avr_bdesc): New static variable using builtins.def.
      	(avr_expand_builtin): Use it.
      	Don't call avr_expand_delay_cycles if op0 is not CONST_INT.
      	(avr_fold_builtin): Fold AVR_BUILTIN_SWAP.
      	Don't fold AVR_BUILTIN_INSERT_BITS if arg0 is not INTEGER_CST.
      
      From-SVN: r184616
      639d0302
    • Georg-Johann Lay's avatar
      re PR target/49868 (Implement named address space to place/access data in flash memory) · bae3b1bf
      Georg-Johann Lay authored
      	PR target/49868
      	PR target/52261
      	* doc/extend.texi (AVR Named Address Spaces): No more try to fix
      	address spaces located outside of device flash.
      	* config/avr/avr.h (base_arch_s): Remove field n_segments.
      	(mcu_type_s): Add field n_flash.
      	* config/avr/avr-devices.c (avr_arch_types): Remove .n_segments.
      	Set .have_elpm and .have_elpmx to 1 for avrxmega4 and avrxmega5.
      	(AVR_MCU): Add N_FLASH argument.
      	* config/avr/avr-mcus.def (AVR_MCU): Add initializer for .n_flash.
      	* config/avr/avr-c.c (avr_cpu_cpp_builtins): Only define built-in
      	macro __FLASH<n> if that address space makes sense for the device.
      	* config/avr/avr.c (avr_out_lpm): Don't try to fix address spaces
      	outside of target flash.
      	(avr_asm_named_section): Ditto.
      	(avr_asm_select_section): Ditto.
      	(avr_addr_space_convert): Ditto.
      	(avr_emit_movmemhi): Ditto.
      	(avr_nonconst_pointer_addrspace, avr_pgm_check_var_decl): Error if
      	address space is outside of device flash.
      	(avr_insert_attributes): Ditto.
      	(avr_xload_libgcc_p): Use avr_current_device->n_flash instead of
      	avr_current_arch->n_segments.
      
      From-SVN: r184614
      bae3b1bf
  10. Feb 15, 2012
    • Georg-Johann Lay's avatar
      re PR target/52261 ([avr] Add support for AVR Xmega cores) · 2da8c1ad
      Georg-Johann Lay authored
      
      libgcc/
      	PR target/52261
      	* config/avr/lib1funcs.S (__prologue_saves__): Handle AVR_XMEGA
      	(__epilogue_restores__): Ditto.
      
      gcc/
      	PR target/52261
      	* config/avr/avr-devices.c (avr_arch_types): Add avrxmega2,
      	avrxmega4, avrxmega5, avrxmega6, avrxmega7.
      	Rewrite initializers for .macro.
      	* config/avr/avr-mcus.def (AVR_MCU): Add known MCUs:
      	avrxmega2: atxmega16a4, atxmega16d4, atxmega16x1, atxmega32a4
      	atxmega32d4, atxmega32x1.
      	avrxmega4: atxmega64a3, atxmega64d3.
      	avrxmega5: atxmega64a1, atxmega64a1u.
      	avrxmega6: atxmega128a3, atxmega128d3, atxmega192a3, atxmega192d3,
      	atxmega256a3, atxmega256a3b, atxmega256a3bu, atxmega256d3.
      	avrxmega7: atxmega128a1, atxmega128a1u.
      
      	* config/avr/multilib.h: Regenerate.
      	* config/avr/t-multilib: Regenerate.
      	* config/avr/avr-tables.opt: Regenerate.
      
      	* config/avr/avr.h (enum avr_arch): Add: ARCH_AVRXMEGA2,
      	ARCH_AVRXMEGA4,	ARCH_AVRXMEGA5, ARCH_AVRXMEGA6, ARCH_AVRXMEGA7.
      	(struct base_arch_s): Rename reserved to xmega_p.
      	Rename reserved2 to have_rampd.
      	(AVR_XMEGA): New define.
      	(AVR_HAVE_RAMPD, AVR_HAVE_RAMPX, AVR_HAVE_RAMPY): New defines.
      	(AVR_HAVE_RAMPZ): Change definition to fit xmega.
      
      	* config/avr/predicates.md (io_address_operand): Take into
      	account SFR offset.
      	(low_io_address_operand): Ditto.
      	(high_io_address_operand): Ditto.
      	
      	* config/avr/avr.md (isa): Add alternatives no_xmega, xmega.
      	(enabled, movhi_sp_r): Use them.
      
      	* config/avr/avr-c.c (avr_cpu_cpp_builtins): Use
      	cpp_define_formatted to built-in define __AVR_ARCH__.
      	(__AVR_XMEGA__): New built-in define.
      	(__AVR_HAVE_RAMPD__): New built-in define.
      	(__AVR_HAVE_RAMPX__): New built-in define.
      	(__AVR_HAVE_RAMPY__): New built-in define.
      	(__AVR_HAVE_RAMPZ__): Change condition when to built-in define it.
      
      	* config/avr/avr.c (avr_addr_t): Add ccp, rampd, rampx, rampy.
      	(avr_option_override): Initialize them.
      	(sreg_rtx, rampd_rtx, rampx_rtx, rampy_rtx): New GTY rtx.
      	(avr_init_expanders): Initialize them. No more block several calls.
      	(emit_push_sfr): New static function.
      	(avr_prologue_setup_frame): Use it to push SREG, RAMPD/X/Y/Z as needed.
      	Handle AVR_XMEGA.
      	(expand_epilogue): Handle AVR_XMEGA. Pop RAMPD/X/Y/Z as needed.
      	(avr_print_operand): Print addreeses as symbols for
      	RAMPX, RAMPY, RAMPD, CCP.
      	(output_movhi): Handle AVR_XMEGA when writing to SP.
      	(avr_out_movhi_mr_r_xmega): New static function.
      	(out_movhi_mr_r): Forward to avr_out_movhi_mr_r_xmega for AVR_XMEGA.
      	(avr_file_start): Print symbol defines for __RAMPX__,  __RAMPY__,
      	__RAMPD__,  __CCP__ as needed.
      
      
      Co-Authored-By: default avatarAnatoly Sokolov <aesok@post.ru>
      Co-Authored-By: default avatarEric Weddington <eric.weddington@atmel.com>
      
      From-SVN: r184269
      2da8c1ad
    • Georg-Johann Lay's avatar
      builtin_insert_bits-1.c: New test. · 0c578db6
      Georg-Johann Lay authored
      gcc/testsuite/
      	* gcc.target/avr/torture/builtin_insert_bits-1.c: New test.
      	* gcc.target/avr/torture/builtin_insert_bits-2.c: New test.
      
      gcc/
      	* doc/extend.texi (AVR Built-in Functions): Remove doc for
      	__builtin_avr_map8, __builtin_avr_map16.
      	Document __builtin_avr_insert_bits.
      	* config/avr/avr.md (map_bitsqi, map_bitshi): Remove.
      	(insert_bits): New insn.
      	(adjust_len.map_bits): Rename to insert_bits.
      	(UNSPEC_MAP_BITS): Rename to UNSPEC_INSERT_BITS.
      	* avr-protos.h (avr_out_map_bits): Remove.
      	(avr_out_insert_bits, avr_has_nibble_0xf): New.
      	* config/avr/constraints.md (Cxf,C0f): New.
      	* config/avr/avr.c (avr_cpu_cpp_builtins): Remove built-in
      	defines __BUILTIN_AVR_MAP8, __BUILTIN_AVR_MAP16.
      	New built-in define __BUILTIN_AVR_INSERT_BITS.
      	* config/avr/avr.c (TARGET_FOLD_BUILTIN): New define.
      	(enum avr_builtin_id): Add AVR_BUILTIN_INSERT_BITS.
      	(avr_move_bits): Rewrite.
      	(avr_fold_builtin, avr_map_metric, avr_map_decompose): New static
      	functions.
      	(avr_map_op_t): New typedef.
      	(avr_map_op): New static variable.
      	(avr_out_insert_bits, avr_has_nibble_0xf): New functions.
      	(adjust_insn_length): Handle ADJUST_LEN_INSERT_BITS.
      	(avr_init_builtins): Add definition for __builtin_avr_insert_bits.
      	(bdesc_3arg, avr_expand_triop_builtin): New.
      	(avr_expand_builtin): Use them. And handle AVR_BUILTIN_INSERT_BITS.
      	(avr_revert_map, avr_swap_map, avr_id_map, avr_sig_map): Remove.
      	(avr_map_hamming_byte, avr_map_hamming_nonstrict): Remove.
      	(avr_map_equal_p, avr_map_sig_p): Remove.
      	(avr_out_swap_bits, avr_out_revert_bits, avr_out_map_bits): Remove.
      	(bdesc_2arg): Remove AVR_BUILTIN_MAP8, AVR_BUILTIN_MAP16.
      	(adjust_insn_length): Remove handling for ADJUST_LEN_MAP_BITS.
      	(enum avr_builtin_id): Remove AVR_BUILTIN_MAP8, AVR_BUILTIN_MAP16.
      	(avr_init_builtins): Remove __builtin_avr_map8, __builtin_avr_map16.
      	(avr_expand_builtin): Remove AVR_BUILTIN_MAP8, AVR_BUILTIN_MAP16.
      
      From-SVN: r184264
      0c578db6
  11. Jan 02, 2012
    • Georg-Johann Lay's avatar
      re PR target/51345 ([avr] Devices with 8-bit SP need their own multilib(s)) · 884f56d1
      Georg-Johann Lay authored
      contrib/
      	PR target/51345
      	* gcc_update (files_and_dependencies): Add
      	gcc/config/avr/t-multilib, gcc/config/avr/multilib.h.
      	
      libgcc/
      	PR target/51345
      	* config/avr/lib1funcs.S: Remove FIXME comments.
      	(SPEED_DIV): Depend on __AVR_HAVE_8BIT_SP__.
      gcc/	
      	PR target/51345
      	* config.gcc (tm_file target=avr]): Add avr/avr-multilib.h
      	(tmake_file target=avr): Add avr/t-multilib.
      
      	* config/avr/avr-c.c (avr_cpu_cpp_builtins): Use AVR_HAVE_8BIT_SP
      	to built-in define __AVR_HAVE_8BIT_SP__, __AVR_HAVE_16BIT_SP__.
      	* config/avr/genmultilib.awk: New file.
      	* config/avr/t-multilib: New auto-generated file.
      	* config/avr/multilib.h: New auto-generated file.
      	* config/avr/t-avr (AVR_MCUS): New variable.
      	(genopt.sh): Use it.
      	(s-mlib): Depend on t-multilib.
      	(t-multilib, multilib.h): New dependencies.
      	(s-avr-mlib): New rule to build t-multilib, multilib.h from AVR_MCUS.
      	(MULTILIB_OPTIONS): Remove.
      	(MULTILIB_MATCHES): Remove.
      	(MULTILIB_DIRNAMES): Remove.
      	(MULTILIB_EXCEPTIONS): Remove:
      	* config/avr/genopt.sh: Don't use hard coded file name;
      	pass AVR_MCUS from t-avr instead.
      
      From-SVN: r182797
      884f56d1
  12. Dec 06, 2011
    • Georg-Johann Lay's avatar
      re PR target/51409 ([avr] Build fails if configured for other languages than from c-family) · 562f552b
      Georg-Johann Lay authored
      	PR target/51409
      	PR target/49868
      	* config/avr/avr.h (ADDR_SPACE_PGM, ADDR_SPACE_PGM1,
      	ADDR_SPACE_PGM2, ADDR_SPACE_PGM3, ADDR_SPACE_PGM4,
      	ADDR_SPACE_PGM5, ADDR_SPACE_PGMX): Write as enum.
      	(avr_addrspace_t): New typedef.
      	(avr_addrspace): New declaration.
      	* config/avr/avr-c.c (avr_toupper): New static function.
      	(avr_register_target_pragmas, avr_cpu_cpp_builtins): Use
      	avr_addrspace to get address space information.
      	* config/avr/avr.c (avr_addrspace): New variable.
      	(avr_out_lpm, avr_pgm_check_var_decl, avr_insert_attributes,
      	avr_asm_named_section, avr_section_type_flags,
      	avr_asm_select_section, avr_addr_space_address_mode, 
      	avr_addr_space_convert, avr_emit_movmemhi): Use it.
      	(avr_addr_space_pointer_mode): Forward to avr_addr_space_address_mode.
      	(avr_pgm_segment): Remove.
      
      From-SVN: r182051
      562f552b
  13. Nov 28, 2011
    • Georg-Johann Lay's avatar
      extend.texi (AVR Built-in Functions): Add documentation for __builtin_avr_map8... · 49b2772e
      Georg-Johann Lay authored
      extend.texi (AVR Built-in Functions): Add documentation for __builtin_avr_map8 and __builtin_avr_map16.
      
      	* doc/extend.texi (AVR Built-in Functions): Add documentation for
      	__builtin_avr_map8 and __builtin_avr_map16.
      	* config/avr/avr.md: Document new %t and %T asm output codes.
      	(define_c_enum "unspec"): Add UNSPEC_MAP_BITS.
      	(adjust_len): Add map_bits.
      	(map_bitsqi, map_bitshi): New insns.
      	* config/avr/avr-protos.h (avr_out_map_bits): New.
      	* config/avr/avr-protos.c (print_operand): Implement %t and %T.
      	(adjust_insn_length): Handle ADJUST_LEN_MAP_BITS.
      	(avr_double_int_push_digit): New function.
      	(avr_map, avr_revert_map, avr_swap_map, avr_id_map): New functions.
      	(avr_sig_map, avr_map_hamming_byte): New functions.
      	(avr_out_swap_bits, avr_out_revert_bits, avr_move_bits,
      	avr_out_map_bits): New functions.
      	(enum avr_builtin_id): Add AVR_BUILTIN_MAP8, AVR_BUILTIN_MAP16.
      	(avr_init_builtins): Populate __builtin_avr_map8, __builtin_avr_map16.
      	(bdesc_2arg): Add __builtin_avr_map8, __builtin_avr_map16 ...
      	(avr_expand_builtin): ...and expand them.
      	* config/avr/avr-c.c (avr_cpu_cpp_builtins): New built-in defines:
      	__BUILTIN_AVR_MAP8, __BUILTIN_AVR_MAP16.
      
      From-SVN: r181773
      49b2772e
  14. Nov 21, 2011
    • Georg-Johann Lay's avatar
      avr.h (struct base_arch_s): Add field sfr_offset. · 5436efaa
      Georg-Johann Lay authored
      	* config/avr/avr.h (struct base_arch_s): Add field sfr_offset.
      	* config/avr/avr-devices.c: Ditto. And initialize it.
      	* config/avr/avr-c.c (avr_cpu_cpp_builtins): New built-in define
      	__AVR_SFR_OFFSET__.
      	* config/avr/avr-protos.h (out_movqi_r_mr, out_movqi_mr_r): Remove.
      	(out_movhi_r_mr, out_movhi_mr_r): Remove.
      	(out_movsi_r_mr, out_movsi_mr_r): Remove.
      	* config/avr/avr.md (*cbi, *sbi): Use %i instead of %m-0x20.
      	(*insv.io, *insv.not.io): Ditto.
      	* config/avr/avr.c (out_movsi_r_mr, out_movsi_mr_r): Make static.
      	(print_operand): Implement "%i" to print address as I/O address.
      	(output_movqi): Clean up call of out_movqi_mr_r.
      	(output_movhi): Clean up call of out_movhi_mr_r.
      	(avr_file_start): Use avr_current_arch->sfr_offset instead of
      	magic -0x20. Use TMP_REGNO, ZERO_REGNO instead of 0, 1.
      	(avr_out_sbxx_branch): Use %i instead of %m-0x20.
      	(out_movqi_r_mr, out_movqi_mr_r): Ditto. And make static.
      	(out_movhi_r_mr, out_movhi_mr_r): Ditto. And use avr_asm_len.
      	(out_shift_with_cnt): Clean up code: Use avr_asm_len.
      	(output_movsisf): Use output_reload_insisf for all CONSTANT_P sources.
      	(avr_out_movpsi): USE avr_out_reload_inpsi for all CONSTANT_P sources.
      	Clean up call of avr_out_store_psi.
      	(output_reload_in_const): Don't cut symbols longer than 2 bytes.
      	(output_reload_insisf): Filter CONST_INT_P or CONST_DOUBLE_P to
      	try if setting pre-cleared register is advantageous.
      	(avr_out_plus_1): Use gen_int_mode instead of GEN_INT.
      
      From-SVN: r181552
      5436efaa
  15. Nov 18, 2011
    • Georg-Johann Lay's avatar
      re PR target/49868 (Implement named address space to place/access data in flash memory) · 7bc6df2c
      Georg-Johann Lay authored
      gcc/
      	PR target/49868
      	* config/avr/avr.h (base_arch_s): Add field n_segments.
      	(ADDR_SPACE_PGM1, ADDR_SPACE_PGM2, ADDR_SPACE_PGM3,
      	ADDR_SPACE_PGM4, ADDR_SPACE_PGM5, ADDR_SPACE_PGMX): New address spaces.
      	(AVR_HAVE_ELPM, AVR_HAVE_ELPMX): New defines.
      	(INIT_EXPANDERS): New define.
      	* config/avr/avr-protos.h (avr_mem_pgmx_p): New.
      	(avr_init_expanders): New.
      	(avr_emit_movmemhi, avr_out_movmem): New.
      	(avr_xload_libgcc_p): New.
      	* config/avr/avr-c.c (avr_register_target_pragmas): Register
      	address spaces __pgm1, __pgm2,  __pgm3,  __pgm4  __pgm5,  __pgmx.
      	(avr_cpu_cpp_builtins): Add built-in defines __PGM1,
      	__PGM2, __PGM3, __PGM4, __PGM5, __PGMX.
      	* config/avr/avr-devices.c (avr_arch_types): Set field n_segments.
      
      	* config/avr/avr.c (AVR_SECTION_PROGMEM): Change define to cover
      	3 bits instead of just 1.
      	(xstring_empty, xstring_e, rampz_rtx): New static GTYed variables.
      	(progmem_section): Change from section to array of sections.
      	(progmem_section_prefix): New static variable.
      	(avr_file_start): Print set for __RAMPZ__
      	(avr_option_override): Move initialization of RTXes from here...
      	(avr_init_expanders): ...to this new function.
      	(avr_pgm_segment): New static function.
      	(avr_decl_pgm_p): Handle error_mark_node.
      	(avr_mem_pgmx_p, avr_decl_pgmx_p): New static functions.
      	(avr_out_xload,	avr_find_unused_d_reg): New static functions.
      	(expand_prologue, expand_epilogue): Use rampz_rtx.
      	(print_operand): Hande CONST_STRING.
      	(avr_xload_libgcc_p): New static function.
      	(avr_out_lpm_no_lpmx, avr_out_lpm): Handle ELPM.
      	(avr_progmem_p): Return 2 for 24-bit flash address space.
      	(avr_out_sbxx_branch): Clean-up code from ASn macros.
      	(out_movqi_r_mr, out_movqi_mr_r): Ditto. And recognize RAMPZ's
      	address and print symbolically.
      	(avr_asm_named_section, avr_section_type_flags,
      	avr_encode_section_info, avr_asm_select_section,
      	avr_addr_space_address_mode, avr_addr_space_pointer_mode,
      	avr_addr_space_legitimate_address_p, avr_addr_space_convert,
      	avr_addr_space_legitimize_address): Handle new address spaces.
      	(avr_output_progmem_section_asm_op): New static function.
      	(avr_asm_init_sections): Initialize progmem_section[].
      	(adjust_insn_length): Handle ADJUST_LEN_XLOAD, ADJUST_LEN_MOVMEM.
      	(avr_const_address_lo16): New static function.
      	(avr_assemble_integer): Use it to handle 3-byte integers.
      	(avr_emit_movmemhi, avr_out_movmem): New functions.
      	
      	* config/avr/predicates.md (nox_general_operand): Handle new
      	address spaces.
      	* config/avr/avr.md (unspec): Add UNSPEC_MOVMEM.
      	(adjust_len): Add xload, movmem.
      	(SP_ADDR): New define_constants.
      	(isa): Add "lpm", "lpmx", "elpm", "elpmx".
      	(enabled): Handle them.
      	(load<mode>_libgcc): New expander.
      	(*load.<mode>.libgcc): Rename to load_<mode>_libgcc.
      	(xload8_A, xload<mode>_A): New insn-and-splits.
      	(xload_8, xload_<mode>_libgcc, xload_<mode>, loadmem_elpm): New insns.
      	(mov<mode>): Handle new address spaces.
      	(movmemhi): Rewrite using avr_emit_movmemhi.
      	(MOVMEM_r_d): New mode attribute.
      	(movmem_<mode>, movmem_qi_elpm): New insns.
      	(setmemhi, *clrmemqi, *clrmemhi, strlenhi, *strlenhi): Unquote
      	C-code.  Use label instead of hard-coded instrunction lengths.
      	
      libgcc/
      	PR target/49868
      	* config/avr/t-avr (LIB1ASMFUNCS): Add _xload_2 _xload_3 _xload_4.
      	* config/avr/lib1funcs.S (__xload_2, __xload_3, __xload_4):
      	New functions.
      
      From-SVN: r181482
      7bc6df2c
  16. Nov 15, 2011
    • Georg-Johann Lay's avatar
      re PR target/49868 (Implement named address space to place/access data in flash memory) · 7c209481
      Georg-Johann Lay authored
      gcc/
      	PR target/49868
      	* config/avr/avr.h (ADDR_SPACE_PGM): New address spaces.
      	(REGISTER_TARGET_PRAGMAS): New define.
      	* config/avr/avr-protos.h (avr_mem_pgm_p): New.
      	(avr_load_libgcc_p): New.
      	(asm_output_external_libcall): Remove.
      	(avr_register_target_pragmas): New.
      	(avr_log_t): Add field "progmem".  Order alphabetically.
      	* config/avr/avr-log.c (avr_log_set_avr_log): Set avr_log.progmem.
      	* config/avr/avr-c.c (langhooks.h): New include.
      	(avr_register_target_pragmas): New function. Register address
      	space __pgm.
      	(avr_cpu_cpp_builtins): Add built-in define __PGM.
      	* config/avr/avr.c: Include "c-family/c-common.h".
      	(TARGET_LEGITIMATE_ADDRESS_P): Remove define.
      	(TARGET_LEGITIMIZE_ADDRESS): Remove define.
      	(TARGET_ADDR_SPACE_SUBSET_P): Define to...
      	(avr_addr_space_subset_p): ...this new static function.
      	(TARGET_ADDR_SPACE_CONVERT): Define to...
      	(avr_addr_space_convert): ...this new static function.
      	(TARGET_ADDR_SPACE_ADDRESS_MODE): Define to...
      	(avr_addr_space_address_mode): ...this new static function.
      	(TARGET_ADDR_SPACE_POINTER_MODE): Define to...
      	(avr_addr_space_pointer_mode): ...this new static function.
      	(TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Define to...
      	(avr_addr_space_legitimate_address_p): ...this new static function.
      	(TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Define to...
      	(avr_addr_space_legitimize_address): ...this new static function.
      	(avr_mode_code_base_reg_class): Handle address spaces.
      	(avr_regno_mode_code_ok_for_base_p): Ditto.
      	(lpm_addr_reg_rtx, lpm_reg_rtx, all_regs_rtx): New static variables.
      	(avr_option_override): Initialize them.
      	(output_reload_in_const): Use all_regs_rtx. Fix signedness of loop
      	variables.
      	(avr_pgm_segment): New static function.
      	(avr_decl_pgm_p, avr_mem_pgm_p): New static functions.
      	(avr_out_lpm, avr_out_lpm_no_lpmx): New static functions.
      	(output_movqi, output_movhi, output_movsisf, avr_out_movpsi): Call
      	avr_out_lpm to handle loads from progmem.
      	(avr_load_libgcc_p): New static function.
      	(avr_progmem_p): Test if decl is in flash.
      	(avr_pgm_pointer_const_p): New static function.
      	(avr_nonconst_pointer_addrspace): New static function.
      	(avr_pgm_check_var_decl): New static function.
      	(avr_insert_attributes): Use it.  Change error message to report
      	cause (progmem or address space) when code wants to write to flash.
      	(avr_section_type_flags): Unset section flag SECTION_BSS for
      	data in progmem.
      	* config/avr/predicates.md (nop_general_operand): New predicate.
      	(nox_general_operand): New predicate.
      	* config/avr/avr.md (LPM_REGNO): New define_constant.
      	(load<mode>_libgcc): New expander.
      	(*load.<mode>.libgcc): New insn.
      	(mov<mode>): Handle loads from non-generic AS.
      	(movmemhi): Ditto.  Propagate address space information to newly
      	created MEM.
      	(movqi_insn, *movhi, *movpsi, *movsi, *movsf): Change predicate #1
      	to nox_general_operand.
      	(ashrqi3, ashrhi3, ashrsi3): Change predicate #1 to nop_general_operand.
      	(ashlqi3, *ashlqi3, ashlhi3, ashlsi3): Ditto.
      	(lshrqi3, *lshrqi3, lshrhi3, lshrsi3): Ditto.
      	(split-lpmx): New split.
      	(*ashlhi3_const, *ashlsi3_const, *ashrhi3_const, *ashrsi3_const,
      	*lshrhi3_const, *lshrsi3_const): Indent, unquote C.
      
      libgcc/
      	PR target/49868
      	* config/avr/t-avr (LIB1ASMFUNCS): Add _load_3,  _load_4.
      	* config/avr/lib1funcs.S (__load_3, __load_4, __xload_2): New functions.
      
      From-SVN: r181378
      7c209481
  17. Nov 04, 2011
    • Georg-Johann Lay's avatar
      re PR target/50931 ([avr] Support a 24-bit scalar integer mode) · e4fe948a
      Georg-Johann Lay authored
      gcc/
      	PR target/50931
      	* config/avr/avr-modes.def: New file defining PSImode.
      	* config/avr/avr-c.c (__INT24_MAX__, __INT24_MIN__,
      	__UINT24_MAX__): New built-in defines.
      	* config/avr/avr.md (adjust_len): Add tstpsi, mov24,  reload_in24,
      	ashlpsi, ashrpsi, lshrpsi.
      	(QISO, QIDI, HISI, HIDI, MPUSH, rotx, rotsmode): Add PSI.
      	(MOVMODE): New mode iterator.
      	(movpsi): New expander.
      	(movqi, movhi, movsi, movsf, movpsi): Write as one using MOVMODE.
      	(*reload_inpsi, *movpsi): New insns.
      	(*reload_inpsi): New RTL peephole.
      	(addpsi3, *addpsi3_zero_extend.qi, *addpsi3_zero_extend.hi,
      	*addpsi3_sign_extend.hi): New insns.
      	(subpsi3, *subpsi3_zero_extend.qi, *subpsi3_zero_extend.hi,
      	*subpsi3_sign_extend.hi): New insns.
      	(divmodpsi4, udivmodpsi4): New define insn-and-split.
      	(*divmodpsi4_call, *udivmodpsi4_call): New insns.
      	(andpsi3, iorpsi3, xorpsi3): New insns.
      	(*rotlpsi2.1, *rotlpsi2.23): New insns.
      	(*rotw<mode>): Insn condition only allow even-sized modes.
      	(*rotb<mode>): Insn condition allows odd-sized modes.
      	(ashlpsi3, ashrpsi3, lshrpsi3, *addpsi3.lt0): New insns.
      	(negpsi2, one_cmplpsi2): New insns.
      	(extendqipsi2, extendhipsi2, extendpsisi2): New insns.
      	(zero_extendqipsi2, zero_extendhipsi2, zero_extendpsisi2): New
      	insn-and-splits.
      	(*cmppsi, *negated_tstpsi, *reversed_tstpsi): New insns.
      	(cbranchpsi4): New expander.
      	* config/avr/constraints.md (Ca3, Co3, Cx3): New constraints.
      	* config/avr/avr-protos.h (avr_out_tstpsi, avr_out_movpsi,
      	avr_out_ashlpsi3, avr_out_ashrpsi3, avr_out_lshrpsi3,
      	avr_out_reload_inpsi): New prototypes.
      
      	* config/avr/avr.c (TARGET_SCALAR_MODE_SUPPORTED_P): Define to...
      	(avr_scalar_mode_supported_p): ...this new static function.
      	(avr_asm_len): Always return "".
      	(avr_out_load_psi, avr_out_store_psi): New static functions.
      	(avr_out_movpsi, avr_out_reload_inpsi): New functions.
      	(avr_out_tstpsi): New function.
      	(avr_out_ashlpsi3, avr_out_ashrpsi3, avr_out_lshrpsi3): New functions.
      	(avr_out_plus_1, output_reload_in_const): Handle 3-byte types.
      	(avr_simplify_comparison_p): Ditto.
      	(adjust_insn_length): Handle ADJUST_LEN_RELOAD_IN24,
      	ADJUST_LEN_MOV24, ADJUST_LEN_TSTPSI, ADJUST_LEN_ASHLPSI,
      	ADJUST_LEN_ASHRPSI, ADJUST_LEN_LSHRPSI.
      	(avr_rtx_costs_1): Report PSI costs.
      	(avr_libcall_value): Handle odd-sized parameters.
      	(avr_init_builtin_int24): New static function to define built-in
      	24-bit types __int24 and __uint24.
      	(avr_init_builtins): Use it.
      
      libgcc/
      	PR target/50931
      	* config/t-avr (LIB1ASMFUNCS): Add _divmodpsi4, _udivmodpsi4.
      	* config/lib1funcs.S (__udivmodpsi4, __divmodpsi4): New functions.
      
      From-SVN: r180962
      e4fe948a
  18. Aug 01, 2011
    • Georg-Johann Lay's avatar
      avr.h (mcu_type_s): Add errata_skip field. · f2c308fa
      Georg-Johann Lay authored
      	
      	* config/avr/avr.h (mcu_type_s): Add errata_skip field.
      	* config/avr/avr-devices.c (avr_mcu_types): Use it.
      	* config/avr/avr-mcus.def (AVR_MCU): Use it.
      	* config/avr/avr-c.c (avr_cpu_cpp_builtins): Use it to builtin
      	define __AVR_ERRATA_SKIP__ and __AVR_ERRATA_SKIP_JMP_CALL__.
      	* config/avr/libgcc.S (__mulshisi3, __ffshi2, __fmulsu_exit):
      	Use __AVR_ERRATA_SKIP_JMP_CALL__ instead of __AVR_HAVE_JMP_CALL__
      	to detect if XJMP must not be skipped.
      
      From-SVN: r177049
      f2c308fa
  19. Jul 04, 2011
    • Georg-Johann Lay's avatar
      extend.texi (AVR Built-in Functions): Update documentation of __builtin_avr_fmul*. · f451d14d
      Georg-Johann Lay authored
      	* doc/extend.texi (AVR Built-in Functions): Update documentation
      	of __builtin_avr_fmul*.
      	* config/avr/avr.c (avr_init_builtins): Don't depend on
      	AVR_HAVE_MUL.
      	* config/avr/avr-c.c (avr_cpu_cpp_builtins): Ditto.
      	* config/avr/avr.md (fmul): Rename to fmul_insn.
      	(fmuls): Rename to fmuls_insn.
      	(fmulsu): Rename to fmulsu_insn.
      	(fmul,fmuls,fmulsu): New expander.
      	(*fmul.call,*fmuls.call,*fmulsu.call): New Insn.
      	* config/avr/t-avr (LIB1ASMFUNCS): Add _fmul, _fmuls, _fmulsu.
      	* config/avr/libgcc.S (__fmul): New function.
      	(__fmuls): New function.
      	(__fmulsu,__fmulsu_exit): New function.
      
      From-SVN: r175807
      f451d14d
  20. Apr 14, 2011
    • Anatoly Sokolov's avatar
      avr.c: ("insn-codes.h"... · 43ea6502
      Anatoly Sokolov authored
      
      
      	* config/avr/avr.c: ("insn-codes.h", "optabs.h", "langhooks.h"):
      	New Includes
      	(avr_init_builtins, avr_expand_builtin,
      	avr_expand_delay_cycles, avr_expand_unop_builtin,
      	avr_expand_binop_builtin ): New functions.
      	(avr_builtin_id): New enum
      	(struct avr_builtin_description): New struct
      	(bdesc_1arg, bdesc_2arg): New arrays describing some RTL builtins.
      	(TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define.
      	
      	* config/avr/avr.md (UNSPEC_FMUL, UNSPEC_FMULS, UNSPEC_FMULSU,
      	UNSPECV_ENABLE_IRQS, UNSPECV_NOP, UNSPECV_SLEEP, UNSPECV_WDR, 
      	UNSPECV_DELAY_CYCLES): new enumeration values
      	(UNSPEC_SEI, UNSPEC_CLI): Remove enumeration values
      	("enable_interrupt"): Use UNSPECV_ENABLE_IRQS
      	("disable_interrupt"): Use UNSPECV_ENABLE_IRQS
      	("*rotlqi3_4"): rename insn to "rotlqi3_4"
      	("delay_cycles_1", "delay_cycles_2", "delay_cycles_3",
      	"delay_cycles_4", "nopv", "sleep", "wdr", "fmul", "fmuls",
      	"fmulsu"): New insns
      	
      	* config/avr/avr-c.c: fix line endings
      	(avr_cpu_cpp_builtins): New builtin defines: __BUILTIN_AVR_NOP,
      	__BUILTIN_AVR_SEI, __BUILTIN_AVR_CLI, __BUILTIN_AVR_WDR,
      	__BUILTIN_AVR_SLEEP, __BUILTIN_AVR_SWAP,
      	__BUILTIN_AVR_DELAY_CYCLES, __BUILTIN_AVR_FMUL,
      	__BUILTIN_AVR_FMULS, __BUILTIN_AVR_FMULSU.
      	
      	* doc/extend.texi (AVR Built-in Functions): New node
      	(Target Builtins): Add documentation of AVR
      	built-in functions.
      
      
      Co-Authored-By: default avatarEric Weddington <eric.weddington@atmel.com>
      Co-Authored-By: default avatarGeorg-Johann Lay <avr@gjlay.de>
      
      From-SVN: r172416
      43ea6502
  21. Jan 03, 2011
  22. Jun 05, 2010
    • Steven Bosscher's avatar
      c-common.c: Move to c-family/. · 39dabefd
      Steven Bosscher authored
      gcc/ChangeLog:
      	* c-common.c: Move to c-family/.
      	* c-common.def: Likewise.
      	* c-common.h: Likewise.
      	* c-cppbuiltin.c: Likewise.
      	* c-dump.c: Likewise.
      	* c-format.c: Likewise.
      	* c-format.h : Likewise.
      	* c-gimplify.c: Likewise.
      	* c-lex.c: Likewise.
      	* c-omp.c: Likewise.
      	* c.opt: Likewise.
      	* c-opts.c: Likewise.
      	* c-pch.c: Likewise.
      	* c-ppoutput.c: Likewise.
      	* c-pragma.c: Likewise.
      	* c-pragma.h: Likewise.
      	* c-pretty-print.c: Likewise.
      	* c-pretty-print.h: Likewise.
      	* c-semantics.c: Likewise.
      	* stub-objc.c: Likewise.
      
      	* gengtype.c (get_file_langdir): Special-case files in c-family/.
      	(get_output_file_with_visibility): Fix name for c-common.h.
      	* c-config-lang.in: Update paths in gtfiles for files in c-family/.
      
      	* c-tree.h: Update include path for moved files.
      	* c-lang.c: Likewise.
      	* c-lang.h: Likewise.
      	* c-parser.c: Likewise.
      	* c-convert.c: Likewise.
      	* c-decl.c: Likewise.
      	* c-objc-common.c: Likewise.
      	* configure.ac: Make sure c-family/ exists in the build directory.
      	* configure: Regenerate.
      	* Makefile.in: Update paths for moved files.  Regroup files per
      	location and update dependencies.  Move generated_files down after
      	ALL_GTFILES_H.
      
      	* config/spu/spu-c.c: Update paths for moved files.
      	* config/mep/mep-pragma.c: Likewise.
      	* config/darwin-c.c: Likewise.
      	* config/i386/msformat-c.c: Likewise.
      	* config/i386/i386-c.c: Likewise.
      	* config/avr/avr-c.c: Likewise.
      	* config/sol2-c.c: Likewise.
      	* config/ia64/ia64-c.c: Likewise.
      	* config/rs6000/rs6000-c.c: Likewise.
      	* config/arm/arm.c: Likewise.
      	* config/arm/arm-c.c: Likewise.
      	* config/h8300/h8300.c: Likewise.
      	* config/v850/v850-c.c: Likewise.
      
      	* config/t-darwin: Fix dependencies for moved files.
      	* config/t-sol2: Fix dependencies for moved files.
      	* config/mep/t-mep: Fix dependencies for moved files.
      	* config/ia64/t-ia64: Fix dependencies for moved files.
      	* config/rs6000/t-rs6000: Fix dependencies for moved files.
      	* config/v850/t-v850: Fix dependencies for moved files.
      	* config/v850/t-v850e: Fix dependencies for moved files.
      
      	* config/m32c/m32c-pragma.c
      
      	* po/exgettext: Look in c-family/ also.
      
      c-family/ChangeLog:
      	* c-common.c: Include gt-c-family-c-common.h.
      	* c-pragma.c: Include gt-c-family-c-pragma.h.
      
      objc/ChangeLog:
      	* objc-act.c: Update include path for moved files.
      	* objc-lang.c: Likewise.
      	* config-lang.in: Update paths in gtfiles for files in c-family/.
      
      objcp/ChangeLog:
      	* objcp-lang.c: Update include path for moved files.
      	* config-lang.in: Update paths in gtfiles for files in c-family/.
      
      cp/ChangeLog:
      	* typeck.c: Update include path for moved files.
      	* decl.c: Likewise.
      	* rtti.c: Likewise.
      	* cp-gimplify.c: Likewise.
      	* cp-lang.c: Likewise.
      	* pt.c: Likewise.
      	* semantics.c: Likewise.
      	* cxx-pretty-print.h: Likewise.
      	* decl2.c: Likewise.
      	* parser.c: Likewise.
      	* cp-objcp-common.c: Likewise.
      	* cp-tree.h: Likewise.
      	* name-lookup.c: Likewise.
      	* lex.c: Likewise.
      	* name-lookup.h: Likewise.
      	* config-lang.in: Update paths in gtfiles for files in c-family/.
      	* Make-lang.in: Likewise.
      
      From-SVN: r160330
      39dabefd
  23. May 26, 2010
    • Steven Bosscher's avatar
      avr-c.c: Do not include regs.h. · e62d5d9f
      Steven Bosscher authored
      	* config/avr/avr-c.c: Do not include regs.h.
      	Include cpplib.h for cpp_define and tree.h for c-common.h.
      	* config/avr/avr-devices.c (avr_mcu_types): Fix initializer.
      	* config/avr/t-avr: Fix dependencies for avr-c.o.
      
      From-SVN: r159901
      e62d5d9f
  24. Dec 24, 2009
    • Andy Hutchinson's avatar
      re PR target/42457 (AVR fails to build with other than C family languages) · 17fad361
      Andy Hutchinson authored
      2009-12-24  Andy Hutchinson  <hutchinsonandy@gcc.gnu.org>
      
      	PR target/42457
      	* config/avr/avr.c (avr_extra_arch_macro): Remove static.
      	(avr_cpu_cpp_builtins): Remove.
      	* config/avr/avr.h (avr_extra_arch_macro): Add prototype.
      	* config/avr/avr-c.c: New File.
      	(avr_cpu_cpp_builtins) : Add.
      	* config/avr/t-avr: Add make information for avr-c.
      	* config.gcc (avr-*-*): Include avr-c.o as c and cpp object.
      
      From-SVN: r155460
      17fad361
Loading