gcc/libgcc/config
Georg-Johann Lay 7bc6df2ca1 re PR target/49868 (Implement named address space to place/access data in flash memory)
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
2011-11-18 16:44:00 +00:00
..
alpha qrnnd.S: Use specific pseudos for VMS. 2011-11-16 08:36:46 +00:00
arm lib1funcs.asm (udivsi3): Add support for divide functions. 2011-11-16 18:02:12 +00:00
avr re PR target/49868 (Implement named address space to place/access data in flash memory) 2011-11-18 16:44:00 +00:00
bfin Append to HOST_LIBGCC2_CFLAGS in libgcc 2011-11-07 17:14:32 +00:00
c6x Build softfp for c6x 2011-11-08 16:50:37 +00:00
cris Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
epiphany config.gcc (epiphany-*-*): New architecture. 2011-11-05 20:48:23 +00:00
fr30
frv Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
h8300 Append to HOST_LIBGCC2_CFLAGS in libgcc 2011-11-07 17:14:32 +00:00
i386 generic-morestack.c: Include <string.h>. 2011-11-09 20:06:31 +00:00
ia64 fde-vms.c: Do not include md-unwind-support.h 2011-11-04 09:25:41 +00:00
iq2000 Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
libbid Move libgcc_tm_file to toplevel libgcc 2011-11-02 15:26:35 +00:00
lm32 Append to HOST_LIBGCC2_CFLAGS in libgcc 2011-11-07 17:14:32 +00:00
m32c Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
m32r Append to HOST_LIBGCC2_CFLAGS in libgcc 2011-11-07 17:14:32 +00:00
m68k Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
mcore Append to HOST_LIBGCC2_CFLAGS in libgcc 2011-11-07 17:14:32 +00:00
mep Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
microblaze Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
mips Append to HOST_LIBGCC2_CFLAGS in libgcc 2011-11-07 17:14:32 +00:00
mmix Append to HOST_LIBGCC2_CFLAGS in libgcc 2011-11-07 17:14:32 +00:00
moxie
pa config.host (hppa*64*-*-hpux11*): Remove pa/t-stublib64 from tmake_file list. 2011-11-13 20:17:01 +00:00
pdp11 Append to HOST_LIBGCC2_CFLAGS in libgcc 2011-11-07 17:14:32 +00:00
picochip Append to HOST_LIBGCC2_CFLAGS in libgcc 2011-11-07 17:14:32 +00:00
rs6000 ppc-linux: Fix call to _Unwind_SetGRPtr 2011-11-12 09:20:58 -08:00
rx
s390 t-crtstuff: Add -fPIC to CRTSTUFF_T_CFLAGS_S variable. 2011-11-04 19:05:36 +00:00
score
sh Append to HOST_LIBGCC2_CFLAGS in libgcc 2011-11-07 17:14:32 +00:00
sparc Use sol2-c[1n].S on more targets 2011-11-04 11:54:17 +00:00
spu Fix SPU libgcc build 2011-11-11 16:49:22 +00:00
stormy16 Append to HOST_LIBGCC2_CFLAGS in libgcc 2011-11-07 17:14:32 +00:00
v850
vax
vms
xtensa Move libgcc_tm_file to toplevel libgcc 2011-11-02 15:26:35 +00:00
darwin-64.c Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
darwin-crt3.c Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
gmon-sol2.c
gthr-lynx.h Return gthr-posix.h to libgcc (PR bootstrap/50982) 2011-11-07 16:34:31 +00:00
gthr-rtems.h Move gthr to toplevel libgcc 2011-11-02 15:28:43 +00:00
gthr-vxworks.h Return gthr-posix.h to libgcc (PR bootstrap/50982) 2011-11-07 16:34:31 +00:00
libgcc-glibc.ver
libgcc-libsystem.ver
no-sfp-machine.h
no-unwind.h
t-crtfm
t-crtstuff-pic Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
t-darwin Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
t-dfprules
t-eh-dw2-dip
t-fdpbit
t-fixedpoint-gnu-prefix
t-fpbit
t-freebsd-thread Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
t-gnu-prefix
t-libgcc-pic Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
t-libunwind Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
t-libunwind-elf
t-linux
t-openbsd-thread Append to HOST_LIBGCC2_CFLAGS in libgcc 2011-11-07 17:14:32 +00:00
t-rtems Consistently use t-rtems in libgcc 2011-11-07 17:12:33 +00:00
t-slibgcc
t-slibgcc-darwin
t-slibgcc-elf-ver
t-slibgcc-gld
t-slibgcc-gld-nover
t-slibgcc-hpux
t-slibgcc-libgcc
t-slibgcc-nolc-override
t-slibgcc-sld
t-slibgcc-vms
t-softfp
t-softfp-excl
t-softfp-sfdf
t-softfp-tf
t-sol2 Use sol2-c[1n].S on more targets 2011-11-04 11:54:17 +00:00
t-stack
t-tls
t-vxworks Append to HOST_LIBGCC2_CFLAGS in libgcc 2011-11-07 17:14:32 +00:00
unwind-dw2-fde-darwin.c
vxlib-tls.c Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
vxlib.c Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00