aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/avr/libgcc.S
AgeCommit message (Collapse)AuthorFilesLines
2011-11-02Move libgcc1 to toplevel libgccRainer Orth1-1533/+0
gcc: * Makefile.in (LIB1ASMSRC): Don't export. (libgcc.mvars): Don't emit LIB1ASMFUNCS, LIB1ASMSRC. * config/arm/arm.c: Update lib1funcs.asm filename. * config/arm/linux-eabi.h: Likewise. * config/arm/bpabi-v6m.S, config/arm/bpabi.S, config/arm/ieee754-df.S, config/arm/ieee754-sf.S: Move to ../libgcc/config/arm. * config/arm/lib1funcs.asm: Move to ../libgcc/config/arm/lib1funcs.S. * config/arm/t-arm (LIB1ASMSRC, LIB1ASMFUNCS): Remove. * config/arm/t-arm-elf (LIB1ASMFUNCS): Remove. * config/arm/t-bpabi: Likewise. * config/arm/t-linux (LIB1ASMSRC, LIB1ASMFUNCS): Remove. * config/arm/t-linux-eabi (LIB1ASMFUNCS): Remove. * config/arm/t-strongarm-elf: Likewise. * config/arm/t-symbian: Likewise. * config/arm/t-vxworks: Likewise. * config/arm/t-wince-pe: Likewise. * config/avr/libgcc.S: Move to ../libgcc/config/avr. * config/avr/t-avr (LIB1ASMSRC, LIB1ASMFUNCS): Remove. * config/bfin/lib1funcs.asm: Move to ../libgcc/config/bfin/lib1funcs.S. * config/bfin/t-bfin: Remove. * config/bfin/t-bfin-elf (LIB1ASMSRC, LIB1ASMFUNCS): Remove. * config/bfin/t-bfin-linux: Likewise. * config/bfin/t-bfin-uclinux: Likewise. * config/c6x/lib1funcs.asm: Move to ../libgcc/config/c6x/lib1funcs.S. * config/c6x/t-c6x-elf (LIB1ASMSRC, LIB1ASMFUNCS): Remove. * config/fr30/lib1funcs.asm: Move to ../libgcc/config/fr30/lib1funcs.S. * config/fr30/t-fr30 (LIB1ASMSRC, LIB1ASMFUNCS): Remove. * config/frv/lib1funcs.asm: Move to ../libgcc/config/frv/lib1funcs.S. * config/frv/t-frv (CROSS_LIBGCC1, LIB1ASMSRC, LIB1ASMFUNCS): Remove. * config/h8300/fixunssfsi.c: Update lib1funcs.asm filename. * config/h8300/lib1funcs.asm: Move to ../libgcc/config/h8300/lib1funcs.S. * config/h8300/t-h8300 (LIB1ASMSRC, LIB1ASMFUNCS): Remove. * config/i386/cygwin.asm: Move to ../libgcc/config/i386/cygwin.S. * config/i386/t-cygming (LIB1ASMSRC, LIB1ASMFUNCS): Remove. * config/i386/t-interix: Likewise. * config/ia64/lib1funcs.asm: Move to ../libgcc/config/ia64/lib1funcs.S. * config/ia64/t-hpux (LIB1ASMFUNCS, LIBGCC1_TEST): Remove. * config/ia64/t-ia64 (LIB1ASMSRC, LIB1ASMFUNCS): Remove. * config/iq2000/t-iq2000 (LIBGCC1, CROSS_LIBGCC1): Remove. * config/m32c/m32c.c: Update m32c-lib1.S filename. * config/m32c/m32c-lib1.S: Move to ../libgcc/config/m32c/lib1funcs.S. * config/m32c/t-m32c (LIB1ASMSRC, LIB1ASMFUNCS): Remove. * config/m32r/t-linux (CROSS_LIBGCC1, LIBGCC1, LIBGCC1_TEST): Remove. * config/m68k/lb1sf68.asm: Move to ../libgcc/config/m68k/lb1sf68.S. * config/m68k/t-floatlib (LIB1ASMSRC, LIB1ASMFUNCS): New file. * config/mcore/lib1.asm: Move to ../libgcc/config/mcore/lib1funcs.S. * config/mcore/t-mcore (LIB1ASMSRC, LIB1ASMFUNCS): Remove. * config/mep/mep-lib1.asm: Move to ../libgcc/config/mep/lib1funcs.S. * config/mep/t-mep (LIB1ASMSRC, LIB1ASMFUNCS): Remove. * config/mips/mips16.S: Move to ../libgcc/config/mips. * config/mips/t-libgcc-mips16: Remove. * config/mips/t-sr71k (LIBGCC1, CROSS_LIBGCC1): Remove. * config/pa/milli64.S: Move to ../libgcc/config/pa. * config/pa/t-linux (LIB1ASMFUNCS, LIB1ASMSRC): Remove. * config/pa/t-linux64: Likewise. * config/picochip/libgccExtras/fake_libgcc.asm: Move to ../libgcc/config/picochip/lib1funcs.S. * config/picochip/t-picochip (LIB1ASMFUNCS, LIB1ASMSRC): Remove. * config/sh/lib1funcs.asm: Move to ../libgcc/config/sh/lib1funcs.S. * config/sh/lib1funcs.h: Move to ../libgcc/config/sh. * config/sh/sh.h: Update lib1funcs.asm filename. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Remove. * config/sh/t-netbsd: Likewise. * config/sh/t-sh (LIB1ASMSRC, LIB1ASMFUNCS, LIB1ASMFUNCS_CACHE): Remove. * config/sh/t-sh64 (LIB1ASMFUNCS): Remove. * config/sparc/lb1spc.asm: Move to ../libgcc/config/sparc/lb1spc.S. * config/sparc/lb1spl.asm: Remove. * config/sparc/t-elf (LIB1ASMSRC, LIB1ASMFUNCS): Remove. * config/sparc/t-leon: Likewise. * config/spu/t-spu-elf (LIBGCC1, CROSS_LIBGCC1): Remove. * config/v850/lib1funcs.asm: Move to ../libgcc/config/v850/lib1funcs.S. * config/v850/t-v850 (LIB1ASMSRC, LIB1ASMFUNCS): Remove * config/vax/lib1funcs.asm: Move to ../libgcc/config/vax/lib1funcs.S. * config/vax/t-linux: Remove. * config/xtensa/ieee754-df.S, config/xtensa/ieee754-sf.S: Move to ../libgcc/config/xtensa. * config/xtensa/lib1funcs.asm: Move to ../libgcc/config/xtensa/lib1funcs.S. * config/xtensa/t-xtensa (LIB1ASMSRC, LIB1ASMFUNCS): Remove. * config.gcc (bfin*-rtems*): Remove bfin/t-bfin from tmake_file. (bfin*-*): Likewise. (mips64*-*-linux*, mipsisa64*-*-linux*): Remove mips/t-libgcc-mips16 from tmake_file. (mips*-*-linux*): Likewise. (mips*-sde-elf*): Likewise. (mipsisa32-*-elf*, mipsisa32el-*-elf*, mipsisa32r2-*-elf*) (mipsisa32r2el-*-elf*, mipsisa64-*-elf*, mipsisa64el-*-elf*) (mipsisa64r2-*-elf*, mipsisa64r2el-*-elf*): Likewise. (mipsisa64sb1-*-elf*, mipsisa64sb1el-*-elf*): Likewise. (mips-*-elf*, mipsel-*-elf*): Likewise. (mips64-*-elf*, mips64el-*-elf*): Likewise. (mips64orion-*-elf*, mips64orionel-*-elf*): Likewise. (mips*-*-rtems*): Likewise. (mipstx39-*-elf*, mipstx39el-*-elf*): Likewise. (vax-*-linux*): Remove vax/t-linux from tmake_file. libgcc: * Makefile.in ($(lib1asmfuncs-o), $(lib1asmfuncs-s-o)): Use $(srcdir) to refer to $(LIB1ASMSRC). Use $<. * config/arm/bpabi-v6m.S, config/arm/bpabi.S, config/arm/ieee754-df.S, config/arm/ieee754-sf.S, config/arm/lib1funcs.S: New files. * config/arm/libunwind.S [!__symbian__]: Use lib1funcs.S. * config/arm/t-arm: New file. * config/arm/t-bpabi (LIB1ASMFUNCS): Set. * config/arm/t-elf, config/arm/t-linux, config/arm/t-linux-eabi, config/arm/t-strongarm-elf: New files. * config/arm/t-symbian (LIB1ASMFUNCS): Set. * config/arm/t-vxworks, config/arm/t-wince-pe: New files. * config/avr/lib1funcs.S: New file. * config/avr/t-avr (LIB1ASMSRC, LIB1ASMFUNCS): Set. * config/bfin/lib1funcs.S, config/bfin/t-bfin: New files. * config/c6x/lib1funcs.S: New file. * config/c6x/t-elf (LIB1ASMSRC, LIB1ASMFUNCS): Set. * config/fr30/lib1funcs.S, config/fr30/t-fr30: New files. * config/frv/lib1funcs.S: New file. * config/frv/t-frv (LIB1ASMSRC, LIB1ASMFUNCS): Set. * config/h8300/lib1funcs.S, config/h8300/t-h8300: New files. * config/i386/cygwin.S, config/i386/t-chkstk: New files. * config/ia64/__divxf3.asm: Rename to ... * config/ia64/__divxf3.S: ... this. Adapt lib1funcs.asm filename. * config/ia64/_fixtfdi.asm: Rename to ... * config/ia64/_fixtfdi.S: ... this. Adapt lib1funcs.asm filename. * config/ia64/_fixunstfdi.asm: Rename to ... * config/ia64/_fixunstfdi.S: ... this. Adapt lib1funcs.asm filename. * config/ia64/_floatditf.asm: Rename to ... * config/ia64/_floatditf.S: ... this. Adapt lib1funcs.asm filename. * config/ia64/lib1funcs.S: New file. * config/ia64/t-hpux (LIB1ASMFUNCS): Set. * config/ia64/t-ia64 (LIB1ASMSRC, LIB1ASMFUNCS): Set. * config/ia64/t-softfp-compat (libgcc1-tf-compats): Adapt suffix. * config/m32c/lib1funcs.S, config/m32c/t-m32c: New files. * config/m68k/lb1sf68.S, config/m68k/t-floatlib: New files. * config/mcore/lib1funcs.S, config/mcore/t-mcore: New files. * config/mep/lib1funcs.S: New file. * config/mep/t-mep (LIB1ASMSRC, LIB1ASMFUNCS): Set. * config/mips/mips16.S: New file. * config/mips/t-mips16 (LIB1ASMSRC, LIB1ASMFUNCS): Set. * config/pa/milli64.S: New file. * config/pa/t-linux, config/pa/t-linux64: New files. * config/picochip/lib1funcs.S: New file. * config/picochip/t-picochip (LIB1ASMSRC, LIB1ASMFUNCS): Set. * config/sh/lib1funcs.S, config/sh/lib1funcs.h: New files. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Set. * config/sh/t-netbsd: New file. * config/sh/t-sh (LIB1ASMSRC, LIB1ASMFUNCS, LIB1ASMFUNCS_CACHE): Set. Use $(srcdir) to refer to lib1funcs.S, adapt filename. * config/sh/t-sh64: New file. * config/sparc/lb1spc.S: New file. * config/sparc/t-softmul (LIB1ASMSRC): Adapt sparc/lb1spc.asm filename. * config/v850/lib1funcs.S, config/v850/t-v850: New files. * config/vax/lib1funcs.S, config/vax/t-linux: New files. * config/xtensa/ieee754-df.S, config/xtensa/ieee754-sf.S, config/xtensa/lib1funcs.S: New files. * config/xtensa/t-xtensa (LIB1ASMSRC, LIB1ASMFUNCS): Set. * config.host (arm-wrs-vxworks): Add arm/t-arm, arm/t-vxworks to tmake_file. (arm*-*-freebsd*): Add arm/t-arm, arm/t-strongarm-elf to tmake_file. (arm*-*-netbsdelf*): Add arm/t-arm to tmake_file. (arm*-*-linux*): Likewise. Add arm/t-elf, arm/t-bpabi, arm/t-linux-eabi to tmake_file for arm*-*-linux-*eabi, add arm/t-linux otherwise. (arm*-*-uclinux*): Add arm/t-arm, arm/t-elf to tmake_file. (arm*-*-ecos-elf): Likewise. (arm*-*-eabi*, arm*-*-symbianelf*): Likewise. (arm*-*-rtems*): Likewise. (arm*-*-elf): Likewise. (arm*-wince-pe*): Add arm/t-arm, arm/t-wince-pe to tmake_file. (avr-*-rtems*): Add to tmake_file, add avr/t-avr. (bfin*-elf*): Add bfin/t-bfin to tmake_file. (bfin*-uclinux*): Likewise. (bfin*-linux-uclibc*): Likewise. (bfin*-rtems*): Likewise. (bfin*-*): Likewise. (fido-*-elf): Merge into m68k-*-elf*. (fr30-*-elf)): Add fr30/t-fr30 to tmake_file. (frv-*-*linux*): Add frv/t-frv to tmake_file. (h8300-*-rtems*): Add h8300/t-h8300 to tmake_file. (h8300-*-elf*): Likewise. (hppa*64*-*-linux*): Add pa/t-linux, pa/t-linux64 to tmake_file. (hppa*-*-linux*): Add pa/t-linux to tmake_file. (i[34567]86-*-cygwin*): Add i386/t-chkstk to tmake_file. (i[34567]86-*-mingw*): Likewise. (x86_64-*-mingw*): Likewise. (i[34567]86-*-interix3*): Likewise. (ia64*-*-hpux*): Add ia64/t-ia64, ia64/t-hpux to tmake_file. (ia64-hp-*vms*): Add ia64/t-ia64 to tmake_file. (m68k-*-elf*): Also handle fido-*-elf. Add m68k/t-floatlib to tmake_file. (m68k-*-uclinux*): Add m68k/t-floatlib to tmake_file. (m68k-*-linux*): Likewise. (m68k-*-rtems*): Likewise. (mcore-*-elf): Add mcore/t-mcore to tmake_file. (sh-*-elf*, sh[12346l]*-*-elf*): Add sh/t-sh64 to tmake_file for sh64*-*-*. (sh-*-linux*, sh[2346lbe]*-*-linux*): Add sh/t-sh to tmake_file. Add sh/t-sh64 to tmake_file for sh64*-*-linux*. (sh-*-netbsdelf*, shl*-*-netbsdelf*, sh5-*-netbsd*) (sh5l*-*-netbsd*, sh64-*-netbsd*, sh64l*-*-netbsd*): Add sh/t-sh, sh/t-netbsd to tmake_file. Add sh/t-sh64 to tmake_file for sh5*-*-netbsd*, sh64*-netbsd*. (sh-*-rtems*): Add sh/t-sh to tmake_file. (sh-wrs-vxworks): Likewise. (sparc-*-linux*): Add sparc/t-softmul to tmake_file except for *-leon[3-9]*. (v850*-*-*): Add v850/t-v850 to tmake_file. (vax-*-linux*): Add vax/t-linux to tmake_file. (m32c-*-elf*, m32c-*-rtems*): Add m32c/t-m32c to tmake_file. From-SVN: r180773
2011-10-21re PR target/50820 ([avr] Use EIND consistently)Georg-Johann Lay1-10/+8
PR target/50820 * config/avr/libgcc.S (__EIND__): New define to 0x3C. (__tablejump__): Consistently use EIND for indirect jump/call. (__tablejump_elpm__): Ditto. From-SVN: r180299
2011-10-10avr.md (*tablejump_rjmp): Change insn condition to !AVR_HAVE_JMP_CALL.Georg-Johann Lay1-12/+16
* config/avr/avr.md (*tablejump_rjmp): Change insn condition to !AVR_HAVE_JMP_CALL. (*tablejump_lib): Change insn condition to AVR_HAVE_JMP_CALL. (*tablejump_enh, *tablejump): Remove insns. * config/avr/libgcc.S (__tablejump__): Use RET instead of EIND + EIJMP for indirect jump. Use LPM Z+ where available. From-SVN: r179760
2011-08-02libgcc.S: Gather related function in the same input section.Georg-Johann Lay1-62/+64
* config/avr/libgcc.S: Gather related function in the same input section. __divmodsi4): Use XCALL/XJMP instead of rcall/rjmp for external references. (__udivmodqi4, __divmodqi4, __udivmodhi4, __divmodhi4, __udivmodsi4, __divmodsi4, __prologue_saves__, __epilogue_restores__, _exit, __tablejump2__, __tablejump__, __do_copy_data, __do_clear_bss, __do_global_ctors, __do_global_dtors, __tablejump_elpm__): Enclose in DEFUN/ENDF. From-SVN: r177133
2011-08-01avr.h (mcu_type_s): Add errata_skip field.Georg-Johann Lay1-3/+3
* 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
2011-07-29re PR target/49313 (Inefficient libgcc implementations for avr)Georg-Johann Lay1-19/+28
PR target/49313 * config/avr/libgcc.S (__ffshi2): Don't skip 2-word instruction. (__ctzsi2): Result for 0 may be undefined. (__ctzhi2): Result for 0 may be undefined. (__popcounthi2): Don't clobber r30. Use __popcounthi2_tail. (__popcountsi2): Ditto. And don't clobber r26. (__popcountdi2): Ditto. And don't clobber r27. * config/avr/avr.md (UNSPEC_COPYSIGN): New c_enum. (parityhi2): New expand. (paritysi2): New expand. (popcounthi2): New expand. (popcountsi2): New expand. (clzhi2): New expand. (clzsi2): New expand. (ctzhi2): New expand. (ctzsi2): New expand. (ffshi2): New expand. (ffssi2): New expand. (copysignsf3): New insn. (bswapsi2): New expand. (*parityhi2.libgcc): New insn. (*parityqihi2.libgcc): New insn. (*paritysihi2.libgcc): New insn. (*popcounthi2.libgcc): New insn. (*popcountsi2.libgcc): New insn. (*popcountqi2.libgcc): New insn. (*popcountqihi2.libgcc): New insn-and-split. (*clzhi2.libgcc): New insn. (*clzsihi2.libgcc): New insn. (*ctzhi2.libgcc): New insn. (*ctzsihi2.libgcc): New insn. (*ffshi2.libgcc): New insn. (*ffssihi2.libgcc): New insn. (*bswapsi2.libgcc): New insn. From-SVN: r176920
2011-07-28re PR target/49313 (Inefficient libgcc implementations for avr)Georg-Johann Lay1-28/+19
PR target/49313 Undo r176835 from trunk 2011-07-27 Georg-Johann Lay From-SVN: r176865
2011-07-28re PR target/49687 ([avr] Missed optimization for widening MUL)Georg-Johann Lay1-195/+208
PR target/49687 * config/avr/t-avr (LIB1ASMFUNCS): Remove _xmulhisi3_exit. Add _muluhisi3, _mulshisi3, _usmulhisi3. * config/avr/libgcc.S (__mulsi3): Rewrite. (__mulhisi3): Rewrite. (__umulhisi3): Rewrite. (__usmulhisi3): New. (__muluhisi3): New. (__mulshisi3): New. (__mulohisi3): New. (__mulqi3, __mulqihi3, __umulqihi3, __mulhi3): Use DEFUN/ENDF to declare. * config/avr/predicates.md (pseudo_register_operand): Rewrite. (pseudo_register_or_const_int_operand): New. (combine_pseudo_register_operand): New. (u16_operand): New. (s16_operand): New. (o16_operand): New. * config/avr/avr.c (avr_rtx_costs): Handle costs for mult:SI. * config/avr/avr.md (QIHI, QIHI2): New mode iterators. (any_extend, any_extend2): New code iterators. (extend_prefix): New code attribute. (mulsi3): Rewrite. Turn insn to expander. (mulhisi3): Ditto. (umulhisi3): Ditto. (usmulhisi3): New expander. (*mulsi3): New insn-and-split. (mulu<mode>si3): New insn-and-split. (muls<mode>si3): New insn-and-split. (mulohisi3): New insn-and-split. (*uumulqihisi3, *uumulhiqisi3, *uumulhihisi3, *uumulqiqisi3, *usmulqihisi3, *usmulhiqisi3, *usmulhihisi3, *usmulqiqisi3, *sumulqihisi3, *sumulhiqisi3, *sumulhihisi3, *sumulqiqisi3, *ssmulqihisi3, *ssmulhiqisi3, *ssmulhihisi3, *ssmulqiqisi3): New insn-and-split. (*mulsi3_call): Rewrite. (*mulhisi3_call): Rewrite. (*umulhisi3_call): Rewrite. (*usmulhisi3_call): New insn. (*muluhisi3_call): New insn. (*mulshisi3_call): New insn. (*mulohisi3_call): New insn. (extendqihi2): Use combine_pseudo_register_operand as predicate for operand 1. (extendqisi2): Ditto. (zero_extendqihi2): Ditto. (zero_extendqisi2): Ditto. (zero_extendhisi2): Ditto. (extendhisi2): Ditto. Don't early-clobber operand 0. From-SVN: r176862
2011-07-27re PR target/49313 (Inefficient libgcc implementations for avr)Georg-Johann Lay1-19/+28
PR target/49313 * config/avr/libgcc.S (__ffshi2): Don't skip 2-word instruction. (__ctzsi2): Result for 0 may be undefined. (__ctzhi2): Result for 0 may be undefined. (__popcounthi2): Don't clobber r30. Use __popcounthi2_tail. (__popcountsi2): Ditto. And don't clobber r26. (__popcountdi2): Ditto. And don't clobber r27. * config/avr/avr.md (UNSPEC_COPYSIGN): New c_enum. (parityhi2): New expand. (paritysi2): New expand. (popcounthi2): New expand. (popcountsi2): New expand. (clzhi2): New expand. (clzsi2): New expand. (ctzhi2): New expand. (ctzsi2): New expand. (ffshi2): New expand. (ffssi2): New expand. (copysignsf3): New insn. (bswapsi2): New expand. (*parityhi2.libgcc): New insn. (*parityqihi2.libgcc): New insn. (*paritysihi2.libgcc): New insn. (*popcounthi2.libgcc): New insn. (*popcountsi2.libgcc): New insn. (*popcountqi2.libgcc): New insn. (*popcountqihi2.libgcc): New insn-and-split. (*clzhi2.libgcc): New insn. (*clzsihi2.libgcc): New insn. (*ctzhi2.libgcc): New insn. (*ctzsihi2.libgcc): New insn. (*ffshi2.libgcc): New insn. (*ffssihi2.libgcc): New insn. (*bswapsi2.libgcc): New insn. From-SVN: r176835
2011-07-04extend.texi (AVR Built-in Functions): Update documentation of ↵Georg-Johann Lay1-0/+88
__builtin_avr_fmul*. * 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
2011-06-29t-avr (LIB1ASMFUNCS): Add _mulhisi3, _umulhisi3, _xmulhisi3_exit.Georg-Johann Lay1-10/+126
* config/avr/t-avr (LIB1ASMFUNCS): Add _mulhisi3, _umulhisi3, _xmulhisi3_exit. * config/avr/libgcc.S (_xmulhisi3_exit): New Function. (__mulhisi3): Optimize if have MUL*. Use XJMP instead of rjmp. (__umulhisi3): Ditto. * config/avr/avr.md (mulhisi3): New insn expender. (umulhisi3): New insn expender. (*mulhisi3_call): New insn. (*umulhisi3_call): New insn. From-SVN: r175620
2011-06-16libgcc.S (__ashldi3, [...]): Set shift truncation mask to 63.Georg-Johann Lay1-3/+3
* config/avr/libgcc.S (__ashldi3, __ashrdi3, __lshrdi3): Set shift truncation mask to 63. From-SVN: r175099
2011-06-16re PR target/49313 (Inefficient libgcc implementations for avr)Georg-Johann Lay1-6/+410
gcc/ PR target/49313 PR target/29524 * longlong.h: Add AVR support: (count_leading_zeros): New macro. (count_trailing_zeros): New macro. (COUNT_LEADING_ZEROS_0): New macro. * config/avr/t-avr (LIB1ASMFUNCS): Add _ffssi2, _ffshi2, _loop_ffsqi2, _ctzsi2, _ctzhi2, _clzdi2, _clzsi2, _clzhi2, _paritydi2, _paritysi2, _parityhi2, _popcounthi2,_popcountsi2, _popcountdi2, _popcountqi2, _bswapsi2, _bswapdi2, _ashldi3, _ashrdi3, _lshrdi3 (LIB2FUNCS_EXCLUDE): Add _clz. * config/avr/libgcc.S (XCALL): Move up in file. (XJMP): New C Macro. (DEFUN): New asm macro. (ENDF): New asm macro. (__ffssi2): New function. (__ffshi2): New function. (__loop_ffsqi2): New function. (__ctzsi2): New function. (__ctzhi2): New function. (__clzdi2): New function. (__clzsi2): New function. (__clzhi2): New function. (__paritydi2): New function. (__paritysi2): New function. (__parityhi2): New function. (__popcounthi2): New function. (__popcountsi2): New function. (__popcountdi2): New function. (__popcountqi2): New function. (__bswapsi2): New function. (__bswapdi2): New function. (__ashldi3): New function. (__ashrdi3): New function. (__lshrdi3): New function. Fix suspicous lines. libgcc/ PR target/49313 PR target/29524 * config/avr/t-avr: Fix line endings. (intfuncs16): Remove _ffsXX2, _clzXX2, _ctzXX2, _popcountXX2, _parityXX2. From-SVN: r175097
2011-04-13re PR target/45263 (registers used in __do_global_ctors can get clobbered)Georg-Johann Lay1-10/+10
PR target/45263 * config/avr/libgcc.S (__do_global_ctors, __do_global_dtors): Save R20 around calls of __tablejump_elpm__ From-SVN: r172384
2011-02-07re PR target/47534 (avr libgcc.S fails to build)Denis Chertykov1-1/+1
PR target/47534 * config/avr/libgcc.S (exit): Move .endfunc From-SVN: r169896
2009-05-23avr.c: Change my email address.Denis Chertykov1-1/+1
* config/avr/avr.c: Change my email address. * config/avr/avr.h: Likewise. * config/avr/avr.md: Likewise. * config/avr/avr-protos.h: Likewise. * config/avr/libgcc.S: Likewise. From-SVN: r147817
2009-04-09Licensing changes to GPLv3 resp. GPLv3 with GCC Runtime Exception.Jakub Jelinek1-14/+9
From-SVN: r145841
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