Move libgcc2 to toplevel libgcc
toplevel: * Makefile.tpl (EXTRA_GCC_FLAGS): Remove LIBGCC2_CFLAGS, LIBGCC2_DEBUG_CFLAGS, LIBGCC2_INCLUDES. * Makefile.in: Regenerate. config: * mh-interix (LIBGCC2_DEBUG_CFLAGS): Remove. gcc: * Makefile.in (LIBGCC2_DEBUG_CFLAGS LIBGCC2_CFLAGS) (LIBGCC2_INCLUDES, TARGET_LIBGCC2_CFLAGS, LIB2FUNCS_EXTRA) (LIB2FUNCS_STATIC_EXTRA, LIB2FUNCS_EXCLUDE, T, T_TARGET) (INCLUDES_FOR_TARGET): Remove. (LIBGCC2_CFLAGS): Don't export. (LIB2FUNCS_ST, LIB2_DIVMOD_FUNCS, LIB2ADD, LIB2ADD_ST, srcdirify): Remove. (libgcc-support): Remove $(LIB2ADD), $(LIB2ADD_ST) dependencies. (libgcc.mvars): Likewise. Don't emit LIB2FUNCS_ST, LIB2FUNCS_EXCLUDE, LIB2ADD, LIB2ADD_ST, LIB2_SIDITI_CONV_FUNCS, LIB2_DIVMOD_FUNCS, LIBGCC2_CFLAGS, TARGET_LIBGCC2_CFLAGS. Emit GTHREAD_FLAGS. * libgcc2.c, libgcc2.h, gbl-ctors.h, longlong.h: Move to ../libgcc. * config/darwin-64.c: Move to ../libgcc/config. * config/divmod.c, config/floatunsidf.c, config/floatunsisf.c, config/floatunsitf.c, config/floatunsixf.c, config/udivmod.c, config/udivmodsi4.c: Move to ../libgcc/config. * config/gthr-posix.c: Move to ../libgcc/config/alpha. * config/memcmp.c, config/memcpy.c, config/memmove.c, config/memset.c: Move to ../libgcc/config. * config/t-darwin (TARGET_LIBGCC2_CFLAGS): Remove. * config/t-freebsd: Remove. * config/t-freebsd-thread: Move to ../libgcc/config. * config/t-libgcc-pic: Move to ../libgcc/config. * config/t-libunwind (TARGET_LIBGCC2_CFLAGS): Remove. * config/t-linux: Remove. * config/t-lynx (TARGET_LIBGCC2_CFLAGS, LIBGCC, INSTALL_LIBGCC): Remove * config/t-openbsd-thread: Move to ../libgcc/config. * config/t-rtems (LIBGCC2_INCLUDES): Remove. * config/t-sol2 (TARGET_LIBGCC2_CFLAGS): Remove. * config/t-svr4: Remove. * config/t-vxworks (LIBGCC, INSTALL_LIBGCC, TARGET_LIBGCC2_CFLAGS) (LIBGCC2_DEBUG_CFLAGS, LIB2FUNCS_EXTRA, LIBGCC2_INCLUDES): Remove. * config/vxlib.c, config/vxlib-tls.c: Move to ../libgcc/config. * config/alpha/qrnnd.asm: Move to ../libgcc/config/alpha/qrnnd.S. * config/alpha/t-alpha, config/alpha/t-ieee: Remove. * config/alpha/t-vms (LIB2FUNCS_EXTRA, LIBGCC, INSTALL_LIBGCC): Remove. * config/alpha/vms-gcc_shell_handler.c: Move to ../libgcc/config/alpha. * config/arm/bpabi.c, config/arm/unaligned-funcs.c, config/arm/fp16.c, config/arm/linux-atomic.c, config/arm/linux-atomic-64bit.c: Move to ../libgcc/config/arm. * config/arm/t-arm-elf (LIBGCC, INSTALL_LIBGCC) (TARGET_LIBGCC2_CFLAGS): Remove. * config/arm/t-bpabi, config/arm/t-linux: Remove. * config/arm/t-linux-eabi (TARGET_LIBGCC2_CFLAGS) (LIB2FUNCS_STATIC_EXTRA): Remove. * config/arm/t-netbsd: Remove. * config/arm/t-strongarm-elf (LIBGCC, INSTALL_LIBGCC) (TARGET_LIBGCC2_CFLAGS): Remove. * config/arm/t-symbian (LIB2FUNCS_STATIC_EXTRA): Remove. * config/arm/t-wince-pe (LIBGCC, INSTALL_LIBGCC) (TARGET_LIBGCC2_CFLAGS): Remove. * config/avr/t-avr (LIB2FUNCS_EXCLUDE, TARGET_LIBGCC2_CFLAGS) (LIBGCC, INSTALL_LIBGCC): Remove. * config/bfin/t-bfin-elf (TARGET_LIBGCC2_CFLAGS): Remove. * config/bfin/t-bfin-linux: Likewise. * config/bfin/t-bfin-uclinux: Likewise. * config/c6x/eqd.c, config/c6x/eqf.c, config/c6x/ged.c, config/c6x/gef.c, config/c6x/gtd.c, config/c6x/gtf.c, config/c6x/led.c, config/c6x/lef.c, config/c6x/ltd.c, config/c6x/ltf.c: Move to ../libgcc/config/c6x. * config/c6x/t-c6x-elf (LIB2FUNCS_EXCLUDE, LIB2FUNCS_EXTRA): Remove. * config/c6x/t-c6x-uclinux (TARGET_LIBGCC2_CFLAGS): Remove. * config/cris/arit.c: Move to ../libgcc/config/cris. * config/cris/cris_abi_symbol.c: Remove. * config/cris/cris.h: Remove obsolete comment. * config/cris/mulsi3.asm: Move to ../libgcc/config/cris/mulsi3.S. * config/cris/t-cris (LIB2FUNCS_EXTRA, CRIS_LIB1CSRC) ($(LIB2FUNCS_EXTRA)): Remove. * config/cris/t-elfmulti (LIB2FUNCS_STATIC_EXTRA, INSTALL_LIBGCC) (LIBGCC): Remove. * config/cris/t-linux (TARGET_LIBGCC2_CFLAGS): Remove. * config/fr30/t-fr30: Remove. * config/frv/cmovd.c, config/frv/cmovh.c, config/frv/cmovw.c, config/frv/modi.c, config/frv/uitod.c, config/frv/uitof.c, config/frv/ulltod.c, config/frv/ulltof.c, config/frv/umodi.c: Move to ../libgcc/config/frv. * config/frv/t-frv (LIB2FUNCS_EXTRA, TARGET_LIBGCC2_CFLAGS) (cmovh.c, cmovw.c, cmovd.c, modi.c, umodi.c, uitof.c, uitod.c) (ulltof.c, LIBGCC, INSTALL_LIBGCC): Remove. * config/frv/t-linux (TARGET_LIBGCC2_CFLAGS): Remove. * config/h8300/clzhi2.c, config/h8300/ctzhi2.c, config/h8300/fixunssfsi.c, config/h8300/parityhi2.c, config/h8300/popcounthi2.c: Move to ../libgcc/config/h8300. * config/h8300/t-h8300 (LIB2FUNCS_EXTRA, TARGET_LIBGCC2_CFLAGS) (LIBGCC, INSTALL_LIBGCC): Remove. * config/i386/gthr-win32.c: Move to ../libgcc/config/i386. * config/i386/t-cygming (LIBGCC2_INCLUDES): Remove. * config/i386/t-cygwin: Remove. * config/i386/t-darwin (LIB2_SIDITI_CONV_FUNCS, LIB2FUNCS_EXTRA) (LIB2FUNCS_EXCLUDE): Remove. * config/i386/t-darwin64 (LIB2_SIDITI_CONV_FUNCS, LIB2FUNCS_EXTRA) (LIBGCC, INSTALL_LIBGCC): Remove. * config/i386/t-gthr-win32: Move to ../libgcc/config/i386. * config/i386/t-linux64 (LIBGCC, INSTALL_LIBGCC): Remove. * config/i386/t-mingw-w32: Likewise. * config/i386/t-mingw-w64: Likewise. * config/i386/t-openbsd: Likewise. * config/i386/t-nto: Remove. * config/ia64/quadlib.c: Move to ../libgcc/config/ia64. * config/ia64/t-hpux (LIBGCC, INSTALL_LIBGCC, LIB2FUNCS_EXTRA) (quadlib.c): Remove. * config/ia64/t-ia64: Remove comment. * config/iq2000/lib2extra-funcs.c: Move to ../libgcc/config/iq2000/lib2funcs.c. * config/iq2000/t-iq2000: Remove. * config/m32c/m32c-lib2.c: Move to ../libgcc/config/m32c/lib2funcs.c. * config/m32c/m32c-lib2-trapv.c: Move to ../libgcc/config/m32c/trapv.c. * config/m32r/t-linux (TARGET_LIBGCC2_CFLAGS): Remove. * config/m32c/t-m32c (LIB2FUNCS_EXTRA): Remove. * config/m32r/t-m32r (TARGET_LIBGCC2_CFLAGS, LIBGCC) (INSTALL_LIBGCC): Remove. * config/m68k/fpgnulib.c: Move to ../libgcc/config/m68k. * config/m68k/t-floatlib: Remove. * config/m68k/t-mlibs (LIBGCC, INSTALL_LIBGCC): Remove. * config/mcore/t-mcore (TARGET_LIBGCC2_CFLAGS): Remove. Fix typo. (LIBGCC, INSTALL_LIBGCC): Remove. * config/mep/mep-lib2.c: Move to ../libgcc/config/mep/lib2funcs.c. * config/mep/mep-tramp.c: Move to ../libgcc/config/mep/tramp.c. * config/mep/t-mep (LIB2FUNCS_EXTRA): Remove. * config/mips/t-elf (TARGET_LIBGCC2_CFLAGS, LIBGCC) (INSTALL_LIBGCC): Remove. * config/mips/t-isa3264: Likewise. * config/mips/t-mips (LIB2_SIDITI_CONV_FUNCS): Remove. * config/mips/t-r3900 (TARGET_LIBGCC2_CFLAGS, LIBGCC) (INSTALL_LIBGCC): Remove. * config/mips/t-sde (LIBGCC, INSTALL_LIBGCC): Remove. * config/mips/t-sr71k (TARGET_LIBGCC2_CFLAGS, LIBGCC) (INSTALL_LIBGCC): Remove. * config/mips/t-vr (TARGET_LIBGCC2_CFLAGS) (LIB2FUNCS_STATIC_EXTRA): Remove. * config/mips/vr4120-div.S: Move to ../libgcc/config/mips. * config/mmix/t-mmix (TARGET_LIBGCC2_CFLAGS): Remove. * config/mn10300/t-mn10300 (LIBGCC, INSTALL_LIBGCC): Remove. * config/pa/fptr.c, config/pa/linux-atomic.c: Move to ../libgcc/config/pa. * config/pa/lib2funcs.asm: Move to ../libgcc/config/pa/lib2funcs.S. * config/pa/quadlib.c: Move to ../libgcc/config/pa. * config/pa/t-dce-thr (LIBGCC, INSTALL_LIBGCC): Remove. * config/pa/t-linux, config/pa/t-linux64: Remove. * config/pa/t-pa-hpux, config/pa/t-pa-hpux10, config/pa/t-pa-hpux11, config/pa/t-pa64: Remove. * config/pdp11/t-pdp11 (TARGET_LIBGCC2_CFLAGS, LIB2FUNCS_EXTRA): Remove. * config/picochip/libgccExtras: Move to ../libgcc/config/picochip. * config/picochip/t-picochip (LIB2FUNCS_EXTRA, RANLIB_FOR_TARGET) (TARGET_LIBGCC2_CFLAGS, LIBGCC2_DEBUG_CFLAGS): Remove. * config/rs6000/crtresfpr.asm: Move to ../libgcc/config/rs6000/crtresfpr.S. * config/rs6000/crtresgpr.asm: Move to ../libgcc/config/rs6000/crtresgpr.S. * config/rs6000/crtresxfpr.asm: Move to ../libgcc/config/rs6000/crtresxfpr.S. * config/rs6000/crtresxgpr.asm: Move to ../libgcc/config/rs6000/crtresxgpr.S. * config/rs6000/crtsavfpr.asm: Move to ../libgcc/config/rs6000/crtsavfpr.S. * config/rs6000/crtsavgpr.asm: Move to ../libgcc/config/rs6000/crtsavgpr.S. * config/rs6000/darwin-asm.h: Move to ../libgcc/config/rs6000. * config/rs6000/darwin-fpsave.asm: Move to ../libgcc/config/rs6000/darwin-fpsave.S. * config/rs6000/darwin-gpsave.asm: Move to ../libgcc/config/rs6000/darwin-gpsave.S. * config/rs6000/darwin-tramp.asm: Move to ../libgcc/config/rs6000/darwin-tramp.S. * config/rs6000/darwin-vecsave.asm: Move to ../libgcc/config/rs6000/darwin-vecsave.S. * config/rs6000/darwin-world.asm: Move to ../libgcc/config/rs6000/darwin-world.S. * config/rs6000/e500crtres32gpr.asm: Move to ../libgcc/config/rs6000/e500crtres32gpr.S. * config/rs6000/e500crtres64gpr.asm: Move to ../libgcc/config/rs6000/e500crtres64gpr.S. * config/rs6000/e500crtres64gprctr.asm: Move to ../libgcc/config/rs6000/e500crtres64gprctr.S. * config/rs6000/e500crtrest32gpr.asm: Move to ../libgcc/config/rs6000/e500crtrest32gpr.S. * config/rs6000/e500crtrest64gpr.asm: Move to ../libgcc/config/rs6000/e500crtrest64gpr.S. * config/rs6000/e500crtresx32gpr.asm: Move to ../libgcc/config/rs6000/e500crtresx32gpr.S. * config/rs6000/e500crtresx64gpr.asm: Move to ../libgcc/config/rs6000/e500crtresx64gpr.S. * config/rs6000/e500crtsav32gpr.asm: Move to ../libgcc/config/rs6000/e500crtsav32gpr.S. * config/rs6000/e500crtsav64gpr.asm: Move to ../libgcc/config/rs6000/e500crtsav64gpr.S. * config/rs6000/e500crtsav64gprctr.asm: Move to ../libgcc/config/rs6000/e500crtsav64gprctr.S. * config/rs6000/e500crtsavg32gpr.asm: Move to ../libgcc/config/rs6000/e500crtsavg32gpr.S. * config/rs6000/e500crtsavg64gpr.asm: Move to ../libgcc/config/rs6000/e500crtsavg64gpr.S. * config/rs6000/e500crtsavg64gprctr.asm: Move to ../libgcc/config/rs6000/e500crtsavg64gprctr.S. * config/rs6000/eabi.asm: Move to ../libgcc/config/rs6000/eabi.S. * config/rs6000/t-aix43 (LIBGCC, INSTALL_LIBGCC, LIB2FUNCS_EXTRA) (TARGET_LIBGCC2_CFLAGS): Remove. * config/rs6000/t-aix52: Likewise. * config/rs6000/t-darwin: Remove. * config/rs6000/t-darwin64 (LIB2_SIDITI_CONV_FUNCS) (LIB2FUNCS_EXTRA): Remove. * config/rs6000/t-fprules (LIBGCC, INSTALL_LIBGCC): Remove. * config/rs6000/t-linux64 (TARGET_LIBGCC2_CFLAGS): Remove. * config/rs6000/t-lynx (LIB2FUNCS_EXTRA, tramp.S, LIBGCC) (INSTALL_LIBGCC): Remove. * config/rs6000/t-netbsd (LIB2FUNCS_EXTRA) (LIB2FUNCS_STATIC_EXTRA, tramp.S, crtsavfpr.S, crtresfpr.S) (crtsavgpr.S, crtresgpr.S, crtresxfpr.S, crtresxgpr.S, LIBGCC) (INSTALL_LIBGCC, $(T)crtsavfpr$(objext), $(T)crtresfpr$(objext)) (($(T)crtsavgpr$(objext), $(T)crtresgpr$(objext), $(T)crtresxfpr$(objext), $(T)crtresxgpr$(objext)): Remove. * config/rs6000/t-ppccomm (LIB2FUNCS_EXTRA) (LIB2FUNCS_STATIC_EXTRA, eabi.S, tramp.S): Remove. * config/rs6000/t-spe (LIBGCC, INSTALL_LIBGCC): Remove. * config/rs6000/t-vxworks: Remove comment. * config/rs6000/tramp.asm: Move to ../libgcc/config/rs6000/tramp.S. * config/rx/t-rx (LIBGCC, INSTALL_LIBGCC): Remove. * config/sh/linux-atomic.asm: Move to ../libgcc/config/sh/linux-atomic.S. * config/sh/t-linux (LIB2FUNCS_EXTRA): Remove. * config/sh/t-netbsd: Remove. * config/sh/t-sh (TARGET_LIBGCC2_CFLAGS, LIBGCC, INSTALL_LIBGCC): Remove. * config/sparc/t-elf (LIBGCC, INSTALL_LIBGCC): Remove. * config/sparc/t-leon: Likewise. * config/sparc/t-leon3: Likewise. * config/sparc/t-linux64: Likewise. * config/sparc/t-netbsd64: Fix typo. Remove comment. * config/spu/divmodti4.c, config/spu/divv2df3.c, config/spu/float_disf.c, config/spu/float_unsdidf.c, config/spu/float_unsdisf.c, config/spu/float_unssidf.c, config/spu/mfc_multi_tag_release.c, config/spu/mfc_multi_tag_reserve.c, config/spu/mfc_tag_release.c, config/spu/mfc_tag_reserve.c, config/spu/mfc_tag_table.c, config/spu/multi3.c: Move to ../libgcc/config/spu. * config/spu/t-spu-elf (TARGET_LIBGCC2_CFLAGS, LIB2FUNCS_EXCLUDE) (LIB2FUNCS_STATIC_EXTRA, LIB2_SIDITI_CONV_FUNCS, LIBGCC) (INSTALL_LIBGCC): Remove. * config/stormy16/stormy16-lib2.c: Move to ../libgcc/config/stormy16/lib2.c. * config/stormy16/stormy16-lib2-ashlsi3.c: Move to ../libgcc/config/stormy16/ashlsi3.c. * config/stormy16/stormy16-lib2-ashrsi3.c: Move to ../libgcc/config/stormy16/ashrsi3.c. * config/stormy16/stormy16-lib2-clzhi2.c: Move to ../libgcc/config/stormy16/clzhi2.c. * config/stormy16/stormy16-lib2-cmpsi2.c: Move to ../libgcc/config/stormy16/cmpsi2.c. * config/stormy16/stormy16-lib2-ctzhi2.c: Move to ../libgcc/config/stormy16/ctzhi2.c. * config/stormy16/stormy16-lib2-divsi3.c: Move to ../libgcc/config/stormy16/divsi3.c. * config/stormy16/stormy16-lib2-ffshi2.c: Move to ../libgcc/config/stormy16/ffshi2.c. * config/stormy16/stormy16-lib2-lshrsi3.c: Move to ../libgcc/config/stormy16/lshrsi3.c. * config/stormy16/stormy16-lib2-modsi3.c: Move to ../libgcc/config/stormy16/modsi3.c. * config/stormy16/stormy16-lib2-parityhi2.c: Move to ../libgcc/config/stormy16/parityhi2.c. * config/stormy16/stormy16-lib2-popcounthi2.c: Move to ../libgcc/config/stormy16/popcounthi2.c. * config/stormy16/stormy16-lib2-ucmpsi2.c: Move to ../libgcc/config/stormy16/ucmpsi2.c. * config/stormy16/stormy16-lib2-udivmodsi4.c: Move to ../libgcc/config/stormy16/udivmodsi4.c. * config/stormy16/stormy16-lib2-udivsi3.c: Move to ../libgcc/config/stormy16/udivsi3.c. * config/stormy16/stormy16-lib2-umodsi3.c: Move to ../libgcc/config/stormy16/umodsi3.c. * config/stormy16/t-stormy16: Move to ../libgcc/config/t-stormy16. * config/v850/t-v850 (INSTALL_LIBGCC): Remove. * config/xtensa/lib2funcs.S: Move to ../libgcc/config/xtensa. * config/xtensa/t-elf: Remove. * config/xtensa/t-xtensa (LIB2FUNCS_EXTRA): Remove. * config.gcc (*-*-freebsd*): Remove t-freebsd, t-freebsd-thread from tmake_file. (*-*-linux*, frv-*-*linux*, *-*-kfreebsd*-gnu, *-*-knetbsd*-gnu, *-*-gnu*, *-*-kopensolaris*-gnu): Remove t-linux from tmake_file. (*-*-netbsd*): Remove t-libgcc-pic from tmake_file. (*-*-openbsd*): Likewise. Remove t-openbsd-thread for posix threads. (alpha*-*-linux*): Remove alpha/t-alpha, alpha/t-ieee from tmake_file. (alpha*-*-freebsd*): Likewise. (alpha*-*-netbsd*): Likewise. (alpha*-*-openbsd*): Likewise. (alpha64-dec-*vms*): Likewise. (alpha*-dec-*vms*): Likewise. (arm*-*-netbsdelf*): Remove arm/t-netbsd from tmake_file. (arm*-*-linux*): Remove t-linux from tmake_file. Remove arm/t-bpabi from tmake_file for arm*-*-linux-*eabi. (arm*-*-uclinux*): Remove arm/t-bpabi from tmake_file for arm*-*-uclinux*eabi. (arm*-*-eabi*, arm*-*-symbianelf* ): Remove arm/t-bpabi from tmake_file for arm*-*-eabi*. (fr30-*-elf): Remove tmake_file. (hppa*64*-*-linux*): Remove tmake_file. (hppa*-*-linux*): Likewise. (hppa[12]*-*-hpux10*): Remove pa/t-pa-hpux10, pa/t-pa-hpux from tmake_file. (hppa*64*-*-hpux11*): Remove pa/t-pa64, pa/t-pa-hpux from tmake_file. (hppa[12]*-*-hpux11*): Remove pa/t-pa-hpux11, pa/t-pa-hpux from tmake_file. (i[34567]86-*-elf*): Remove tmake_file. (x86_64-*-elf*): Likewise. (i[34567]86-*-nto-qnx*): Likewise. (i[34567]86-*-cygwin*): Remove i386/t-cygwin from tmake_file. (i[34567]86-*-mingw*, x86_64-*-mingw*): Remove i386/t-gthr-win32 from tmake_file if using win32 threads. (iq2000*-*-elf*): Remove tmake-file. (microblaze*-linux*): Likewise. (sh-*-elf*, sh[12346l]*-*-elf*, sh-*-linux*) (sh[2346lbe]*-*-linux*, sh-*-netbsdelf*, shl*-*-netbsdelf*) (sh5-*-netbsd*, sh5l*-*-netbsd*, sh64-*-netbsd*) (sh64l*-*-netbsd*): Remove sh/t-netbsd from tmake_file for sh5*-*-netbsd*, sh64*-netbsd*, *-*-netbsd. (xtensa*-*-elf*): Remove tmake_file. gcc/po: * EXCLUDES (config/vxlib.c, gbl-ctors.h, libgcc2.c, libgcc2.h) (longlong.h): Remove. libgcc: * configure.ac: Include ../config/picflag.m4. (GCC_PICFLAG): Call it. Substitute. * configure: Regenerate. * Makefile.in (gcc_srcdir): Remove. (LIBGCC2_DEBUG_CFLAGS, LIBGCC2_CFLAGS, LIBGCC2_INCLUDES) (HOST_LIBGCC2_CFLAGS, PICFLAG, LIB2FUNCS_ST, LIB2FUNCS_EXCLUDE) (LIB2_DIVMOD_FUNCS, LIB2ADD, LIB2ADD_ST): Set. ($(lib2funcs-o), $(lib2funcs-s-o), $(lib2-divmod-o)) ($(lib2-divmod-s-o)): Use $(srcdir) to refer to libgcc2.c. Use $<. Remove comment. * libgcc2.c, libgcc2.h, gbl-ctors.h, longlong.h: New files. * siditi-object.mk ($o$(objext), $(o)_s$(objext)): Use $(srcdir) to refer to libgcc2.c. Use $<. * config/darwin-64.c: New file. * config/darwin-crt3.c: Remove comment. * config/divmod.c, config/floatunsidf.c, config/floatunsisf.c, config/floatunsitf.c, config/floatunsixf.c, config/udivmod.c, config/udivmodsi4.c: New files. * config/memcmp.c, config/memcpy.c, config/memmove.c, config/memset.c: New files. * config/t-crtstuff-pic (CRTSTUFF_T_CFLAGS_S): Use $(PICFLAG). * config/t-darwin (HOST_LIBGCC2_CFLAGS): Set. * config/t-freebsd-thread, config/t-libgcc-pic: New files. * config/t-libunwind (HOST_LIBGCC2_CFLAGS): Set. * config/t-openbsd-thread: New file. * config/t-sol2 (HOST_LIBGCC2_CFLAGS): Remove. * config/t-vxworks, config/vxlib-tls.c, config/vxlib.c: New files. * config/alpha/gthr-posix.c, config/alpha/qrnnd.S: New files. * config/alpha/t-alpha (LIB2ADD): Use $(srcdir) to refer to qrnnd.S. Adapt filename. * config/alpha/t-osf-pthread (LIB2ADD): Use $(srcdir)/config/alpha to refer to gthr-posix.c. * config/alpha/t-vms (LIB2ADD): Set. * config/alpha/vms-gcc_shell_handler.c: New file. * config/arm/bpabi.c, config/arm/fp16.c, config/arm/linux-atomic.c, config/arm/linux-atomic-64bit.c, config/arm/unaligned-funcs.c: New files. * config/arm/t-bpabi (LIB2ADD, LIB2ADD_ST): Set. * config/arm/t-elf (HOST_LIBGCC2_CFLAGS): Set. * config/arm/t-linux: Likewise. * config/arm/t-linux-eabi (LIB2ADD_ST): Add. * config/arm/t-netbsd: New file. * config/arm/t-strongarm-elf (HOST_LIBGCC2_CFLAGS): Set. * config/arm/t-symbian (LIB2ADD_ST): Set. * config/avr/t-avr (LIB2FUNCS_EXCLUDE, HOST_LIBGCC2_CFLAGS): Set. * config/bfin/t-crtstuff (CRTSTUFF_T_CFLAGS): Use $(PICFLAG). * config/bfin/t-elf: New file. * config/c6x/eqd.c, config/c6x/eqf.c, config/c6x/ged.c, config/c6x/gef.c, config/c6x/gtd.c, config/c6x/gtf.c, config/c6x/led.c, config/c6x/lef.c, config/c6x/ltd.c, config/c6x/ltf.c: New files. * config/c6x/t-elf (LIB2FUNCS_EXCLUDE, LIB2ADD) (HOST_LIBGCC2_CFLAGS): Set. * config/c6x/t-uclinux (HOST_LIBGCC2_CFLAGS): Set. (CRTSTUFF_T_CFLAGS): Use $(PICFLAG). * config/cris/arit.c, config/cris/mulsi3.S, config/cris/t-cris: New files. * config/cris/t-elfmulti (LIB2ADD_ST): Set. * config/cris/t-linux (HOST_LIBGCC2_CFLAGS): Remove. * config/frv/cmovd.c, config/frv/cmovh.c, config/frv/cmovw.c, config/frv/modi.c, config/frv/uitod.c, config/frv/uitof.c, config/frv/ulltod.c, config/frv/ulltof.c, config/frv/umodi.c: New files. * config/frv/t-frv (LIB2ADD): Set. * config/frv/t-linux (CRTSTUFF_T_CFLAGS): Use $(PICFLAG). * config/h8300/clzhi2.c, config/h8300/ctzhi2.c, config/h8300/fixunssfsi.c, config/h8300/parityhi2.c, config/h8300/popcounthi2.c: New files. * config/h8300/t-h8300 (LIB2ADD, HOST_LIBGCC2_CFLAGS): Set. * config/i386/gthr-win32.c: New file. * config/i386/t-cygming (LIBGCC2_INCLUDES): Set. * config/i386/t-cygwin: Likewise. * config/i386/t-darwin, config/i386/t-darwin64, config/i386/t-gthr-win32, config/i386/t-interix: New files. * config/i386/t-nto (HOST_LIBGCC2_CFLAGS): Set. (CRTSTUFF_T_CFLAGS): Use $(PICFLAG). * config/i386/t-sol2 (CRTSTUFF_T_CFLAGS): Use $(PICFLAG). * config/ia64/quadlib.c: New file. * config/ia64/t-hpux (LIB2ADD): Set. * config/ia64/t-ia64: Add comment. * config/iq2000/lib2funcs.c, config/iq2000/t-iq2000: New files. * config/lm32/t-uclinux (CRTSTUFF_T_CFLAGS): Use $(PICFLAG). (HOST_LIBGCC2_CFLAGS): Append, remove -fPIC. * config/m32c/lib2funcs.c, config/m32c/trapv.c: New files. * config/m32c/t-m32c (LIB2ADD): Set. * config/m32r/t-linux (HOST_LIBGCC2_CFLAGS): Set. * config/m32r/t-m32r: Likewise. * config/m68k/fpgnulib.c: New file. * config/m68k/t-floatlib (LIB2ADD): Set. (xfgnulib.c): New target. * config/mcore/t-mcore (HOST_LIBGCC2_CFLAGS): Set. * config/mep/lib2funcs.c, config/mep/tramp.c: New files. * config/mep/t-mep (LIB2ADD): Set. * config/microblaze/divsi3.asm: Rename to divsi3.S. * config/microblaze/moddi3.asm: Rename to moddi3.S. * config/microblaze/modsi3.asm: Rename to modsi3.S. * config/microblaze/muldi3_hard.asm: Rename to hard.S. * config/microblaze/mulsi3.asm: Rename to mulsi3.S. * config/microblaze/stack_overflow_exit.asm: Rename to exit.S. * config/microblaze/udivsi3.asm: Rename to udivsi3.S. * config/microblaze/umodsi3.asm: Rename to umodsi3.S. * config/microblaze/t-microblaze (LIB2ADD): Reflect this. * config/mips/t-elf, config/mips/t-vr, config/mips/vr4120-div.S: New files. * config/mips/t-mips (LIB2_SIDITI_CONV_FUNCS): Set. * config/mmix/t-mmix (HOST_LIBGCC2_CFLAGS): Set. * config/pa/fptr.c, config/pa/lib2funcs.S, config/pa/linux-atomic.c, config/pa/quadlib.c: New files. * config/pa/t-linux (HOST_LIBGCC2_CFLAGS): Set. (LIB2ADD, LIB2ADD_ST): Set. * config/pa/t-hpux, config/pa/t-hpux10, config/pa/t-pa64: New files. * config/pa/t-linux (HOST_LIBGCC2_CFLAGS, LIB2ADD, LIB2ADD_ST): Set. * config/pa/t-linux64 (LIB2ADD_ST, HOST_LIBGCC2_CFLAGS): Set. * config/pdp11/t-pdp11: New file. * config/picochip/libgccExtras/adddi3.S, config/picochip/libgccExtras/ashlsi3.S, config/picochip/libgccExtras/ashrsi3.S, config/picochip/libgccExtras/clzsi2.S, config/picochip/libgccExtras/cmpsi2.S, config/picochip/libgccExtras/divmod15.S, config/picochip/libgccExtras/divmodhi4.S, config/picochip/libgccExtras/divmodsi4.S, config/picochip/libgccExtras/lshrsi3.S, config/picochip/libgccExtras/parityhi2.S, config/picochip/libgccExtras/popcounthi2.S, config/picochip/libgccExtras/subdi3.S, config/picochip/libgccExtras/ucmpsi2.S, config/picochip/libgccExtras/udivmodhi4.S, config/picochip/libgccExtras/udivmodsi4.S: New files. * config/picochip/t-picochip (LIB2ADD, HOST_LIBGCC2_CFLAGS) (LIBGCC2_DEBUG_CFLAGS, RANLIB_FOR_TARGET): Set. * config/rs6000/crtresfpr.S, config/rs6000/crtresgpr.S, config/rs6000/crtresxfpr.S, config/rs6000/crtresxgpr.S, config/rs6000/crtsavfpr.S, config/rs6000/crtsavgpr.S) config/rs6000/darwin-asm.h, config/rs6000/darwin-fpsave.S, config/rs6000/darwin-gpsave.S, config/rs6000/darwin-tramp.S, config/rs6000/darwin-vecsave.S, config/rs6000/darwin-world.S: New files. * config/rs6000/t-darwin (LIB2ADD, LIB2ADD_ST) (HOST_LIBGCC2_CFLAGS): Set. * config/rs6000/t-darwin64: New file. * config/rs6000/t-linux64 (HOST_LIBGCC2_CFLAGS): Set. * config/rs6000/t-lynx, config/rs6000/t-netbsd: New files. * config/rs6000/t-ppccomm (LIB2ADD): Add $(srcdir)/config/rs6000/tramp.S. (LIB2ADD_ST): Use $(srcdir)/config/rs6000 to refer to sources. Add $(srcdir)/config/rs6000/eabi.S. (crtsavfpr.S, crtresfpr.S, crtsavgpr.S, crtresgpr.S, crtresxfpr.S) (crtresxgpr.S, e500crtres32gpr.S, e500crtres64gpr.S) (e500crtres64gprctr.S, e500crtrest32gpr.S, e500crtrest64gpr.S) (e500crtresx32gpr.S, e500crtresx64gpr.S, e500crtsav32gpr.S) (e500crtsav64gpr.S, e500crtsav64gprctr.S, e500crtsavg32gpr.S) (e500crtsavg64gpr.S, e500crtsavg64gprctr.S): Remove. * config/rs6000/tramp.S: New file. * config/s390/t-tpf: Remove. * config/sh/linux-atomic.S: New file. * config/sh/t-linux (LIB2ADD): Set. (HOST_LIBGCC2_CFLAGS): Append, remove -fpic. * config/sh/t-netbsd (LIB2ADD, HOST_LIBGCC2_CFLAGS): Set. * config/sh/t-sh (unwind-dw2-Os-4-200.o): Use $(srcdir) to refer to unwind-dw2.c. (HOST_LIBGCC2_CFLAGS): Set. * config/sparc/t-sol2 (CRTSTUFF_T_CFLAGS): Use $(PICFLAG). * config/spu/divmodti4.c, config/spu/divv2df3.c, config/spu/float_disf.c, config/spu/float_unsdidf.c, config/spu/float_unsdisf.c, config/spu/float_unssidf.c, config/spu/mfc_multi_tag_release.c, config/spu/mfc_multi_tag_reserve.c, config/spu/mfc_tag_release.c, config/spu/mfc_tag_reserve.c, config/spu/mfc_tag_table.c, config/spu/multi3.c: New files. * config/spu/t-elf (LIB2ADD, LIB2ADD_ST, LIB2_SIDITI_CONV_FUNCS) (HOST_LIBGCC2_CFLAGS): Set. * config/stormy16/ashlsi3.c, config/stormy16/ashrsi3.c, config/stormy16/clzhi2.c, config/stormy16/cmpsi2.c, config/stormy16/ctzhi2.c, config/stormy16/divsi3.c, config/stormy16/ffshi2.c, config/stormy16/lib2.c, config/stormy16/lshrsi3.c, config/stormy16/modsi3.c, config/stormy16/parityhi2.c, config/stormy16/popcounthi2.c, config/stormy16/t-stormy16, config/stormy16/ucmpsi2.c, config/stormy16/udivmodsi4.c, config/stormy16/udivsi3.c, config/stormy16/umodsi3.c: New files. * config/xtensa/lib2funcs.S: New file. * config/xtensa/t-elf (HOST_LIBGCC2_CFLAGS): Set. * config/xtensa/t-xtensa (LIB2ADD): Set. * config.host (*-*-darwin*): Add t-libgcc-pic to tmake_file. (*-*-freebsd*): Add t-freebsd, t-libgcc-pic to tmake_file. Add t-freebsd-thread to tmake_file for posix threads. (*-*-linux*, frv-*-*linux*, *-*-kfreebsd*-gnu, *-*-knetbsd*-gnu) (*-*-gnu*, *-*-kopensolaris*-gnu): Add t-libgcc-pic to tmake_file. (*-*-lynxos*): Likewise. (*-*-netbsd*): Likewise. (*-*-openbsd*): Likewise. Add t-openbsd-thread to tmake_file for posix threads. (*-*-solaris2*): Add t-libgcc-pic to tmake_file. (*-*-vxworks*): Set tmake_file. (alpha*-*-linux*): Add alpha/t-alpha, alpha/t-ieee to tmake_file. (alpha*-*-freebsd*): Likewise. (alpha*-*-netbsd*): Likewise. (alpha*-*-openbsd*): Likewise. (alpha*-dec-osf5.1*): Remove qrnnd.o, gthr-posix.o from extra_parts. (alpha64-dec-*vms*): Add alpha/t-alpha, alpha/t-ieee to tmake_file. (alpha*-dec-*vms*): Likewise. (arm*-*-netbsdelf*): Add arm/t-netbsd to tmake_file. (bfin*-elf*): Add bfin/t-elf to tmake_file. (bfin*-uclinux*): Likewise. (bfin*-linux-uclibc*): Likewise. (crisv32-*-elf): Add cris/t-cris to tmake_file. (crisv32-*-none): Likewise. (cris-*-elf): Likewise. (cris-*-none): Likewise. (cris-*-linux*, crisv32-*-linux*): Likewise. (hppa[12]*-*-hpux10*): Add pa/t-hpux pa/t-hpux10, t-libgcc-pic to tmake_file. (hppa*64*-*-hpux11*): Add pa/t-hpux, pa/t-pa64, t-libgcc-pic to tmake_file. (hppa[12]*-*-hpux11*): Add pa/t-hpux, t-libgcc-pic to tmake_file. (i[34567]86-*-elf*): Add t-libgcc-pic to tmake_file. (x86_64-*-elf*): Likewise. (i[34567]86-*-nto-qnx*): Likewise. (i[34567]86-*-mingw*): Add i386/t-gthr-win32 to tmake_file for win32 threads. (x86_64-*-mingw*): Likewise. (i[34567]86-*-interix3*): Add i386/t-interix to tmake_file. (lm32-*-uclinux*): Add t-libgcc-pic to tmake_file. (mipsisa32-*-elf*, mipsisa32el-*-elf*, mipsisa32r2-*-elf*) (mipsisa32r2el-*-elf*, mipsisa64-*-elf*, mipsisa64el-*-elf*) (mipsisa64r2-*-elf*, mipsisa64r2el-*-elf*): Add mips/t-elf to tmake_file. (mipsisa64sr71k-*-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. (mips64vr-*-elf*, mips64vrel-*-elf*): Add mips/t-elf, mips/t-vr to tmake_file. (pdp11-*-*): Add pdp11/t-pdp11 to tmake_file. (powerpc64-*-darwin*): Add rs6000/t-darwin64 to tmake_file. (s390x-ibm-tpf*): Add t-libgcc-pic to tmake_file. (spu-*-elf*): Likewise. (tic6x-*-uclinux): Add t-libgcc-pic to tmake_file. libquadmath: * printf/gmp-impl.h: Adapt path to longlong.h. From-SVN: r180774
This commit is contained in:
parent
45b86625d7
commit
f9989b51a9
353 changed files with 1361 additions and 1388 deletions
249
libgcc/ChangeLog
249
libgcc/ChangeLog
|
@ -1,3 +1,252 @@
|
|||
2011-11-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
|
||||
|
||||
* configure.ac: Include ../config/picflag.m4.
|
||||
(GCC_PICFLAG): Call it.
|
||||
Substitute.
|
||||
* configure: Regenerate.
|
||||
* Makefile.in (gcc_srcdir): Remove.
|
||||
(LIBGCC2_DEBUG_CFLAGS, LIBGCC2_CFLAGS, LIBGCC2_INCLUDES)
|
||||
(HOST_LIBGCC2_CFLAGS, PICFLAG, LIB2FUNCS_ST, LIB2FUNCS_EXCLUDE)
|
||||
(LIB2_DIVMOD_FUNCS, LIB2ADD, LIB2ADD_ST): Set.
|
||||
($(lib2funcs-o), $(lib2funcs-s-o), $(lib2-divmod-o))
|
||||
($(lib2-divmod-s-o)): Use $(srcdir) to refer to libgcc2.c.
|
||||
Use $<.
|
||||
Remove comment.
|
||||
* libgcc2.c, libgcc2.h, gbl-ctors.h, longlong.h: New files.
|
||||
* siditi-object.mk ($o$(objext), $(o)_s$(objext)): Use $(srcdir)
|
||||
to refer to libgcc2.c.
|
||||
Use $<.
|
||||
* config/darwin-64.c: New file.
|
||||
* config/darwin-crt3.c: Remove comment.
|
||||
* config/divmod.c, config/floatunsidf.c, config/floatunsisf.c,
|
||||
config/floatunsitf.c, config/floatunsixf.c, config/udivmod.c,
|
||||
config/udivmodsi4.c: New files.
|
||||
* config/memcmp.c, config/memcpy.c, config/memmove.c,
|
||||
config/memset.c: New files.
|
||||
* config/t-crtstuff-pic (CRTSTUFF_T_CFLAGS_S): Use $(PICFLAG).
|
||||
* config/t-darwin (HOST_LIBGCC2_CFLAGS): Set.
|
||||
* config/t-freebsd-thread, config/t-libgcc-pic: New files.
|
||||
* config/t-libunwind (HOST_LIBGCC2_CFLAGS): Set.
|
||||
* config/t-openbsd-thread: New file.
|
||||
* config/t-sol2 (HOST_LIBGCC2_CFLAGS): Remove.
|
||||
* config/t-vxworks, config/vxlib-tls.c, config/vxlib.c: New files.
|
||||
* config/alpha/gthr-posix.c, config/alpha/qrnnd.S: New files.
|
||||
* config/alpha/t-alpha (LIB2ADD): Use $(srcdir) to refer to
|
||||
qrnnd.S.
|
||||
Adapt filename.
|
||||
* config/alpha/t-osf-pthread (LIB2ADD): Use $(srcdir)/config/alpha
|
||||
to refer to gthr-posix.c.
|
||||
* config/alpha/t-vms (LIB2ADD): Set.
|
||||
* config/alpha/vms-gcc_shell_handler.c: New file.
|
||||
* config/arm/bpabi.c, config/arm/fp16.c,
|
||||
config/arm/linux-atomic.c, config/arm/linux-atomic-64bit.c,
|
||||
config/arm/unaligned-funcs.c: New files.
|
||||
* config/arm/t-bpabi (LIB2ADD, LIB2ADD_ST): Set.
|
||||
* config/arm/t-elf (HOST_LIBGCC2_CFLAGS): Set.
|
||||
* config/arm/t-linux: Likewise.
|
||||
* config/arm/t-linux-eabi (LIB2ADD_ST): Add.
|
||||
* config/arm/t-netbsd: New file.
|
||||
* config/arm/t-strongarm-elf (HOST_LIBGCC2_CFLAGS): Set.
|
||||
* config/arm/t-symbian (LIB2ADD_ST): Set.
|
||||
* config/avr/t-avr (LIB2FUNCS_EXCLUDE, HOST_LIBGCC2_CFLAGS): Set.
|
||||
* config/bfin/t-crtstuff (CRTSTUFF_T_CFLAGS): Use $(PICFLAG).
|
||||
* config/bfin/t-elf: New file.
|
||||
* config/c6x/eqd.c, config/c6x/eqf.c, config/c6x/ged.c,
|
||||
config/c6x/gef.c, config/c6x/gtd.c, config/c6x/gtf.c,
|
||||
config/c6x/led.c, config/c6x/lef.c, config/c6x/ltd.c,
|
||||
config/c6x/ltf.c: New files.
|
||||
* config/c6x/t-elf (LIB2FUNCS_EXCLUDE, LIB2ADD)
|
||||
(HOST_LIBGCC2_CFLAGS): Set.
|
||||
* config/c6x/t-uclinux (HOST_LIBGCC2_CFLAGS): Set.
|
||||
(CRTSTUFF_T_CFLAGS): Use $(PICFLAG).
|
||||
* config/cris/arit.c, config/cris/mulsi3.S, config/cris/t-cris:
|
||||
New files.
|
||||
* config/cris/t-elfmulti (LIB2ADD_ST): Set.
|
||||
* config/cris/t-linux (HOST_LIBGCC2_CFLAGS): Remove.
|
||||
* config/frv/cmovd.c, config/frv/cmovh.c, config/frv/cmovw.c,
|
||||
config/frv/modi.c, config/frv/uitod.c, config/frv/uitof.c,
|
||||
config/frv/ulltod.c, config/frv/ulltof.c, config/frv/umodi.c: New
|
||||
files.
|
||||
* config/frv/t-frv (LIB2ADD): Set.
|
||||
* config/frv/t-linux (CRTSTUFF_T_CFLAGS): Use $(PICFLAG).
|
||||
* config/h8300/clzhi2.c, config/h8300/ctzhi2.c,
|
||||
config/h8300/fixunssfsi.c, config/h8300/parityhi2.c,
|
||||
config/h8300/popcounthi2.c: New files.
|
||||
* config/h8300/t-h8300 (LIB2ADD, HOST_LIBGCC2_CFLAGS): Set.
|
||||
* config/i386/gthr-win32.c: New file.
|
||||
* config/i386/t-cygming (LIBGCC2_INCLUDES): Set.
|
||||
* config/i386/t-cygwin: Likewise.
|
||||
* config/i386/t-darwin, config/i386/t-darwin64,
|
||||
config/i386/t-gthr-win32, config/i386/t-interix: New files.
|
||||
* config/i386/t-nto (HOST_LIBGCC2_CFLAGS): Set.
|
||||
(CRTSTUFF_T_CFLAGS): Use $(PICFLAG).
|
||||
* config/i386/t-sol2 (CRTSTUFF_T_CFLAGS): Use $(PICFLAG).
|
||||
* config/ia64/quadlib.c: New file.
|
||||
* config/ia64/t-hpux (LIB2ADD): Set.
|
||||
* config/ia64/t-ia64: Add comment.
|
||||
* config/iq2000/lib2funcs.c, config/iq2000/t-iq2000: New files.
|
||||
* config/lm32/t-uclinux (CRTSTUFF_T_CFLAGS): Use $(PICFLAG).
|
||||
(HOST_LIBGCC2_CFLAGS): Append, remove -fPIC.
|
||||
* config/m32c/lib2funcs.c, config/m32c/trapv.c: New files.
|
||||
* config/m32c/t-m32c (LIB2ADD): Set.
|
||||
* config/m32r/t-linux (HOST_LIBGCC2_CFLAGS): Set.
|
||||
* config/m32r/t-m32r: Likewise.
|
||||
* config/m68k/fpgnulib.c: New file.
|
||||
* config/m68k/t-floatlib (LIB2ADD): Set.
|
||||
(xfgnulib.c): New target.
|
||||
* config/mcore/t-mcore (HOST_LIBGCC2_CFLAGS): Set.
|
||||
* config/mep/lib2funcs.c, config/mep/tramp.c: New files.
|
||||
* config/mep/t-mep (LIB2ADD): Set.
|
||||
* config/microblaze/divsi3.asm: Rename to divsi3.S.
|
||||
* config/microblaze/moddi3.asm: Rename to moddi3.S.
|
||||
* config/microblaze/modsi3.asm: Rename to modsi3.S.
|
||||
* config/microblaze/muldi3_hard.asm: Rename to hard.S.
|
||||
* config/microblaze/mulsi3.asm: Rename to mulsi3.S.
|
||||
* config/microblaze/stack_overflow_exit.asm: Rename to exit.S.
|
||||
* config/microblaze/udivsi3.asm: Rename to udivsi3.S.
|
||||
* config/microblaze/umodsi3.asm: Rename to umodsi3.S.
|
||||
* config/microblaze/t-microblaze (LIB2ADD): Reflect this.
|
||||
* config/mips/t-elf, config/mips/t-vr, config/mips/vr4120-div.S:
|
||||
New files.
|
||||
* config/mips/t-mips (LIB2_SIDITI_CONV_FUNCS): Set.
|
||||
* config/mmix/t-mmix (HOST_LIBGCC2_CFLAGS): Set.
|
||||
* config/pa/fptr.c, config/pa/lib2funcs.S,
|
||||
config/pa/linux-atomic.c, config/pa/quadlib.c: New files.
|
||||
* config/pa/t-linux (HOST_LIBGCC2_CFLAGS): Set.
|
||||
(LIB2ADD, LIB2ADD_ST): Set.
|
||||
* config/pa/t-hpux, config/pa/t-hpux10, config/pa/t-pa64: New files.
|
||||
* config/pa/t-linux (HOST_LIBGCC2_CFLAGS, LIB2ADD, LIB2ADD_ST):
|
||||
Set.
|
||||
* config/pa/t-linux64 (LIB2ADD_ST, HOST_LIBGCC2_CFLAGS): Set.
|
||||
* config/pdp11/t-pdp11: New file.
|
||||
* config/picochip/libgccExtras/adddi3.S,
|
||||
config/picochip/libgccExtras/ashlsi3.S,
|
||||
config/picochip/libgccExtras/ashrsi3.S,
|
||||
config/picochip/libgccExtras/clzsi2.S,
|
||||
config/picochip/libgccExtras/cmpsi2.S,
|
||||
config/picochip/libgccExtras/divmod15.S,
|
||||
config/picochip/libgccExtras/divmodhi4.S,
|
||||
config/picochip/libgccExtras/divmodsi4.S,
|
||||
config/picochip/libgccExtras/lshrsi3.S,
|
||||
config/picochip/libgccExtras/parityhi2.S,
|
||||
config/picochip/libgccExtras/popcounthi2.S,
|
||||
config/picochip/libgccExtras/subdi3.S,
|
||||
config/picochip/libgccExtras/ucmpsi2.S,
|
||||
config/picochip/libgccExtras/udivmodhi4.S,
|
||||
config/picochip/libgccExtras/udivmodsi4.S: New files.
|
||||
* config/picochip/t-picochip (LIB2ADD, HOST_LIBGCC2_CFLAGS)
|
||||
(LIBGCC2_DEBUG_CFLAGS, RANLIB_FOR_TARGET): Set.
|
||||
* config/rs6000/crtresfpr.S, config/rs6000/crtresgpr.S,
|
||||
config/rs6000/crtresxfpr.S, config/rs6000/crtresxgpr.S,
|
||||
config/rs6000/crtsavfpr.S, config/rs6000/crtsavgpr.S)
|
||||
config/rs6000/darwin-asm.h, config/rs6000/darwin-fpsave.S,
|
||||
config/rs6000/darwin-gpsave.S, config/rs6000/darwin-tramp.S,
|
||||
config/rs6000/darwin-vecsave.S, config/rs6000/darwin-world.S: New
|
||||
files.
|
||||
* config/rs6000/t-darwin (LIB2ADD, LIB2ADD_ST)
|
||||
(HOST_LIBGCC2_CFLAGS): Set.
|
||||
* config/rs6000/t-darwin64: New file.
|
||||
* config/rs6000/t-linux64 (HOST_LIBGCC2_CFLAGS): Set.
|
||||
* config/rs6000/t-lynx, config/rs6000/t-netbsd: New files.
|
||||
* config/rs6000/t-ppccomm (LIB2ADD): Add
|
||||
$(srcdir)/config/rs6000/tramp.S.
|
||||
(LIB2ADD_ST): Use $(srcdir)/config/rs6000 to refer to sources.
|
||||
Add $(srcdir)/config/rs6000/eabi.S.
|
||||
(crtsavfpr.S, crtresfpr.S, crtsavgpr.S, crtresgpr.S, crtresxfpr.S)
|
||||
(crtresxgpr.S, e500crtres32gpr.S, e500crtres64gpr.S)
|
||||
(e500crtres64gprctr.S, e500crtrest32gpr.S, e500crtrest64gpr.S)
|
||||
(e500crtresx32gpr.S, e500crtresx64gpr.S, e500crtsav32gpr.S)
|
||||
(e500crtsav64gpr.S, e500crtsav64gprctr.S, e500crtsavg32gpr.S)
|
||||
(e500crtsavg64gpr.S, e500crtsavg64gprctr.S): Remove.
|
||||
* config/rs6000/tramp.S: New file.
|
||||
* config/s390/t-tpf: Remove.
|
||||
* config/sh/linux-atomic.S: New file.
|
||||
* config/sh/t-linux (LIB2ADD): Set.
|
||||
(HOST_LIBGCC2_CFLAGS): Append, remove -fpic.
|
||||
* config/sh/t-netbsd (LIB2ADD, HOST_LIBGCC2_CFLAGS): Set.
|
||||
* config/sh/t-sh (unwind-dw2-Os-4-200.o): Use $(srcdir) to refer
|
||||
to unwind-dw2.c.
|
||||
(HOST_LIBGCC2_CFLAGS): Set.
|
||||
* config/sparc/t-sol2 (CRTSTUFF_T_CFLAGS): Use $(PICFLAG).
|
||||
* config/spu/divmodti4.c, config/spu/divv2df3.c,
|
||||
config/spu/float_disf.c, config/spu/float_unsdidf.c,
|
||||
config/spu/float_unsdisf.c, config/spu/float_unssidf.c,
|
||||
config/spu/mfc_multi_tag_release.c,
|
||||
config/spu/mfc_multi_tag_reserve.c, config/spu/mfc_tag_release.c,
|
||||
config/spu/mfc_tag_reserve.c, config/spu/mfc_tag_table.c,
|
||||
config/spu/multi3.c: New files.
|
||||
* config/spu/t-elf (LIB2ADD, LIB2ADD_ST, LIB2_SIDITI_CONV_FUNCS)
|
||||
(HOST_LIBGCC2_CFLAGS): Set.
|
||||
* config/stormy16/ashlsi3.c, config/stormy16/ashrsi3.c,
|
||||
config/stormy16/clzhi2.c, config/stormy16/cmpsi2.c,
|
||||
config/stormy16/ctzhi2.c, config/stormy16/divsi3.c,
|
||||
config/stormy16/ffshi2.c, config/stormy16/lib2.c,
|
||||
config/stormy16/lshrsi3.c, config/stormy16/modsi3.c,
|
||||
config/stormy16/parityhi2.c, config/stormy16/popcounthi2.c,
|
||||
config/stormy16/t-stormy16, config/stormy16/ucmpsi2.c,
|
||||
config/stormy16/udivmodsi4.c, config/stormy16/udivsi3.c,
|
||||
config/stormy16/umodsi3.c: New files.
|
||||
* config/xtensa/lib2funcs.S: New file.
|
||||
* config/xtensa/t-elf (HOST_LIBGCC2_CFLAGS): Set.
|
||||
* config/xtensa/t-xtensa (LIB2ADD): Set.
|
||||
* config.host (*-*-darwin*): Add t-libgcc-pic to tmake_file.
|
||||
(*-*-freebsd*): Add t-freebsd, t-libgcc-pic to tmake_file.
|
||||
Add t-freebsd-thread to tmake_file for posix threads.
|
||||
(*-*-linux*, frv-*-*linux*, *-*-kfreebsd*-gnu, *-*-knetbsd*-gnu)
|
||||
(*-*-gnu*, *-*-kopensolaris*-gnu): Add t-libgcc-pic to tmake_file.
|
||||
(*-*-lynxos*): Likewise.
|
||||
(*-*-netbsd*): Likewise.
|
||||
(*-*-openbsd*): Likewise.
|
||||
Add t-openbsd-thread to tmake_file for posix threads.
|
||||
(*-*-solaris2*): Add t-libgcc-pic to tmake_file.
|
||||
(*-*-vxworks*): Set tmake_file.
|
||||
(alpha*-*-linux*): Add alpha/t-alpha, alpha/t-ieee to tmake_file.
|
||||
(alpha*-*-freebsd*): Likewise.
|
||||
(alpha*-*-netbsd*): Likewise.
|
||||
(alpha*-*-openbsd*): Likewise.
|
||||
(alpha*-dec-osf5.1*): Remove qrnnd.o, gthr-posix.o from extra_parts.
|
||||
(alpha64-dec-*vms*): Add alpha/t-alpha, alpha/t-ieee to tmake_file.
|
||||
(alpha*-dec-*vms*): Likewise.
|
||||
(arm*-*-netbsdelf*): Add arm/t-netbsd to tmake_file.
|
||||
(bfin*-elf*): Add bfin/t-elf to tmake_file.
|
||||
(bfin*-uclinux*): Likewise.
|
||||
(bfin*-linux-uclibc*): Likewise.
|
||||
(crisv32-*-elf): Add cris/t-cris to tmake_file.
|
||||
(crisv32-*-none): Likewise.
|
||||
(cris-*-elf): Likewise.
|
||||
(cris-*-none): Likewise.
|
||||
(cris-*-linux*, crisv32-*-linux*): Likewise.
|
||||
(hppa[12]*-*-hpux10*): Add pa/t-hpux pa/t-hpux10, t-libgcc-pic to
|
||||
tmake_file.
|
||||
(hppa*64*-*-hpux11*): Add pa/t-hpux, pa/t-pa64, t-libgcc-pic to
|
||||
tmake_file.
|
||||
(hppa[12]*-*-hpux11*): Add pa/t-hpux, t-libgcc-pic to tmake_file.
|
||||
(i[34567]86-*-elf*): Add t-libgcc-pic to tmake_file.
|
||||
(x86_64-*-elf*): Likewise.
|
||||
(i[34567]86-*-nto-qnx*): Likewise.
|
||||
(i[34567]86-*-mingw*): Add i386/t-gthr-win32 to tmake_file for
|
||||
win32 threads.
|
||||
(x86_64-*-mingw*): Likewise.
|
||||
(i[34567]86-*-interix3*): Add i386/t-interix to tmake_file.
|
||||
(lm32-*-uclinux*): Add t-libgcc-pic to tmake_file.
|
||||
(mipsisa32-*-elf*, mipsisa32el-*-elf*, mipsisa32r2-*-elf*)
|
||||
(mipsisa32r2el-*-elf*, mipsisa64-*-elf*, mipsisa64el-*-elf*)
|
||||
(mipsisa64r2-*-elf*, mipsisa64r2el-*-elf*): Add mips/t-elf to
|
||||
tmake_file.
|
||||
(mipsisa64sr71k-*-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.
|
||||
(mips64vr-*-elf*, mips64vrel-*-elf*): Add mips/t-elf, mips/t-vr
|
||||
to tmake_file.
|
||||
(pdp11-*-*): Add pdp11/t-pdp11 to tmake_file.
|
||||
(powerpc64-*-darwin*): Add rs6000/t-darwin64 to tmake_file.
|
||||
(s390x-ibm-tpf*): Add t-libgcc-pic to tmake_file.
|
||||
(spu-*-elf*): Likewise.
|
||||
(tic6x-*-uclinux): Add t-libgcc-pic to tmake_file.
|
||||
|
||||
2011-11-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
|
||||
|
||||
* Makefile.in ($(lib1asmfuncs-o), $(lib1asmfuncs-s-o)): Use
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
libgcc_topdir = @libgcc_topdir@
|
||||
host_subdir = @host_subdir@
|
||||
|
||||
gcc_srcdir = $(libgcc_topdir)/gcc
|
||||
gcc_objdir = $(MULTIBUILDTOP)../../$(host_subdir)/gcc
|
||||
|
||||
srcdir = @srcdir@
|
||||
|
@ -220,6 +219,42 @@ else
|
|||
DECNUMINC =
|
||||
endif
|
||||
|
||||
# Options to use when compiling libgcc2.a.
|
||||
#
|
||||
LIBGCC2_DEBUG_CFLAGS = -g
|
||||
LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(HOST_LIBGCC2_CFLAGS) \
|
||||
$(LIBGCC2_DEBUG_CFLAGS) $(GTHREAD_FLAGS) \
|
||||
-DIN_LIBGCC2 \
|
||||
-fbuilding-libgcc -fno-stack-protector \
|
||||
$(INHIBIT_LIBC_CFLAGS)
|
||||
|
||||
# Additional options to use when compiling libgcc2.a.
|
||||
# Some targets override this to -isystem include
|
||||
LIBGCC2_INCLUDES =
|
||||
|
||||
# Additional target-dependent options for compiling libgcc2.a.
|
||||
HOST_LIBGCC2_CFLAGS =
|
||||
|
||||
PICFLAG = @PICFLAG@
|
||||
|
||||
# Defined in libgcc2.c, included only in the static library.
|
||||
LIB2FUNCS_ST = _eprintf __gcc_bcmp
|
||||
|
||||
# List of functions not to build from libgcc2.c.
|
||||
LIB2FUNCS_EXCLUDE =
|
||||
|
||||
# These might cause a divide overflow trap and so are compiled with
|
||||
# unwinder info.
|
||||
LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4
|
||||
|
||||
# List of extra C and assembler files to add to static and shared libgcc2.
|
||||
# Assembler files should have names ending in `.S'.
|
||||
LIB2ADD =
|
||||
|
||||
# List of extra C and assembler files to add to static libgcc2.
|
||||
# Assembler files should have names ending in `.S'.
|
||||
LIB2ADD_ST =
|
||||
|
||||
# Specify the directories to be searched for header files.
|
||||
# Both . and srcdir are used, in that order,
|
||||
# so that *config.h will be found in the compilation
|
||||
|
@ -416,15 +451,14 @@ endif
|
|||
|
||||
# Build lib2funcs. For the static library also include LIB2FUNCS_ST.
|
||||
lib2funcs-o = $(patsubst %,%$(objext),$(lib2funcs) $(LIB2FUNCS_ST))
|
||||
$(lib2funcs-o): %$(objext): $(gcc_srcdir)/libgcc2.c
|
||||
$(gcc_compile) -DL$* -c $(gcc_srcdir)/libgcc2.c \
|
||||
$(vis_hide)
|
||||
$(lib2funcs-o): %$(objext): $(srcdir)/libgcc2.c
|
||||
$(gcc_compile) -DL$* -c $< $(vis_hide)
|
||||
libgcc-objects += $(lib2funcs-o)
|
||||
|
||||
ifeq ($(enable_shared),yes)
|
||||
lib2funcs-s-o = $(patsubst %,%_s$(objext),$(lib2funcs))
|
||||
$(lib2funcs-s-o): %_s$(objext): $(gcc_srcdir)/libgcc2.c
|
||||
$(gcc_s_compile) -DL$* -c $(gcc_srcdir)/libgcc2.c
|
||||
$(lib2funcs-s-o): %_s$(objext): $(srcdir)/libgcc2.c
|
||||
$(gcc_s_compile) -DL$* -c $<
|
||||
libgcc-s-objects += $(lib2funcs-s-o)
|
||||
endif
|
||||
|
||||
|
@ -452,15 +486,15 @@ endif
|
|||
|
||||
# Build LIB2_DIVMOD_FUNCS.
|
||||
lib2-divmod-o = $(patsubst %,%$(objext),$(LIB2_DIVMOD_FUNCS))
|
||||
$(lib2-divmod-o): %$(objext): $(gcc_srcdir)/libgcc2.c
|
||||
$(gcc_compile) -DL$* -c $(gcc_srcdir)/libgcc2.c \
|
||||
$(lib2-divmod-o): %$(objext): $(srcdir)/libgcc2.c
|
||||
$(gcc_compile) -DL$* -c $< \
|
||||
-fexceptions -fnon-call-exceptions $(vis_hide)
|
||||
libgcc-objects += $(lib2-divmod-o)
|
||||
|
||||
ifeq ($(enable_shared),yes)
|
||||
lib2-divmod-s-o = $(patsubst %,%_s$(objext),$(LIB2_DIVMOD_FUNCS))
|
||||
$(lib2-divmod-s-o): %_s$(objext): $(gcc_srcdir)/libgcc2.c
|
||||
$(gcc_s_compile) -DL$* -c $(gcc_srcdir)/libgcc2.c \
|
||||
$(lib2-divmod-s-o): %_s$(objext): $(srcdir)/libgcc2.c
|
||||
$(gcc_s_compile) -DL$* -c $< \
|
||||
-fexceptions -fnon-call-exceptions
|
||||
libgcc-s-objects += $(lib2-divmod-s-o)
|
||||
endif
|
||||
|
@ -1027,11 +1061,3 @@ install-strip: install
|
|||
.NOEXPORT:
|
||||
|
||||
include $(srcdir)/empty.mk $(wildcard *.dep)
|
||||
|
||||
# TODO QUEUE:
|
||||
# Garbage collect in gcc/:
|
||||
# $(LIBGCC) settings in t-* are now unused
|
||||
#
|
||||
# Remove use of $(gcc_srcdir). Source files referenced using $(gcc_srcdir)
|
||||
# should move into the libgcc directory.
|
||||
|
||||
|
|
|
@ -163,7 +163,7 @@ esac
|
|||
case ${host} in
|
||||
*-*-darwin*)
|
||||
asm_hidden_op=.private_extern
|
||||
tmake_file="$tmake_file t-darwin ${cpu_type}/t-darwin t-slibgcc-darwin"
|
||||
tmake_file="$tmake_file t-darwin ${cpu_type}/t-darwin t-libgcc-pic t-slibgcc-darwin"
|
||||
extra_parts=crt3.o
|
||||
;;
|
||||
*-*-freebsd[12] | *-*-freebsd[12].* | *-*-freebsd*aout*)
|
||||
|
@ -179,10 +179,11 @@ case ${host} in
|
|||
# This is the generic ELF configuration of FreeBSD. Later
|
||||
# machine-specific sections may refine and add to this
|
||||
# configuration.
|
||||
tmake_file="$tmake_file t-crtstuff-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver"
|
||||
tmake_file="$tmake_file t-freebsd t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver"
|
||||
extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
|
||||
case ${target_thread_file} in
|
||||
posix)
|
||||
tmake_file="${tmake_file} t-freebsd-thread"
|
||||
# Before 5.0, FreeBSD can't bind shared libraries to -lc
|
||||
# when "optionally" threaded via weak pthread_* checks.
|
||||
case ${host} in
|
||||
|
@ -194,15 +195,15 @@ case ${host} in
|
|||
esac
|
||||
;;
|
||||
*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu)
|
||||
tmake_file="$tmake_file t-crtstuff-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux"
|
||||
tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux"
|
||||
extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
|
||||
;;
|
||||
*-*-lynxos*)
|
||||
tmake_file="$tmake_file $cpu_type/t-crtstuff t-crtstuff-pic"
|
||||
tmake_file="$tmake_file t-lynx $cpu_type/t-crtstuff t-crtstuff-pic t-libgcc-pic"
|
||||
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
|
||||
;;
|
||||
*-*-netbsd*)
|
||||
tmake_file="$tmake_file t-crtstuff-pic t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver"
|
||||
tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver"
|
||||
# NetBSD 1.7 and later are set up to use GCC's crtstuff for
|
||||
# ELF configurations. We will clear extra_parts in the
|
||||
# a.out configurations.
|
||||
|
@ -213,7 +214,12 @@ case ${host} in
|
|||
esac
|
||||
;;
|
||||
*-*-openbsd*)
|
||||
tmake_file="$tmake_file t-crtstuff-pic"
|
||||
tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic"
|
||||
case ${target_thread_file} in
|
||||
posix)
|
||||
tmake_file="$tmake_file t-openbsd-thread"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*-*-rtems*)
|
||||
extra_parts="crtbegin.o crtend.o"
|
||||
|
@ -221,7 +227,7 @@ case ${host} in
|
|||
*-*-solaris2*)
|
||||
# Unless linker support and dl_iterate_phdr are present,
|
||||
# unwind-dw2-fde-dip.c automatically falls back to unwind-dw2-fde.c.
|
||||
tmake_file="$tmake_file t-sol2 t-eh-dw2-dip t-slibgcc t-slibgcc-elf-ver"
|
||||
tmake_file="$tmake_file t-sol2 t-eh-dw2-dip t-libgcc-pic t-slibgcc t-slibgcc-elf-ver"
|
||||
if test $with_gnu_ld = yes; then
|
||||
tmake_file="$tmake_file t-slibgcc-gld"
|
||||
else
|
||||
|
@ -252,6 +258,7 @@ case ${host} in
|
|||
extra_parts="vcrt0.o pcrt0.o crtbegin.o crtbeginS.o crtend.o crtendS.o"
|
||||
;;
|
||||
*-*-vxworks*)
|
||||
tmake_file=t-vxworks
|
||||
;;
|
||||
*-*-elf)
|
||||
extra_parts="crtbegin.o crtend.o"
|
||||
|
@ -273,17 +280,19 @@ esac
|
|||
|
||||
case ${host} in
|
||||
alpha*-*-linux*)
|
||||
tmake_file="${tmake_file} t-crtfm alpha/t-linux"
|
||||
tmake_file="${tmake_file} alpha/t-alpha alpha/t-ieee t-crtfm alpha/t-linux"
|
||||
extra_parts="$extra_parts crtfastmath.o"
|
||||
md_unwind_header=alpha/linux-unwind.h
|
||||
;;
|
||||
alpha*-*-freebsd*)
|
||||
tmake_file="${tmake_file} t-crtfm"
|
||||
tmake_file="${tmake_file} alpha/t-alpha alpha/t-ieee t-crtfm"
|
||||
extra_parts="$extra_parts crtbeginT.o crtfastmath.o"
|
||||
;;
|
||||
alpha*-*-netbsd*)
|
||||
tmake_file="${tmake_file} alpha/t-alpha alpha/t-ieee"
|
||||
;;
|
||||
alpha*-*-openbsd*)
|
||||
tmake_file="${tmake_file} alpha/t-alpha alpha/t-ieee"
|
||||
;;
|
||||
alpha*-dec-osf5.1*)
|
||||
tmake_file="${tmake_file} alpha/t-alpha alpha/t-ieee t-crtfm t-slibgcc alpha/t-slibgcc-osf"
|
||||
|
@ -292,16 +301,16 @@ alpha*-dec-osf5.1*)
|
|||
tmake_file="${tmake_file} alpha/t-osf-pthread"
|
||||
;;
|
||||
esac
|
||||
extra_parts="${extra_parts} qrnnd.o crtfastmath.o gthr-posix.o"
|
||||
extra_parts="${extra_parts} crtfastmath.o"
|
||||
md_unwind_header=alpha/osf5-unwind.h
|
||||
;;
|
||||
alpha64-dec-*vms*)
|
||||
tmake_file="$tmake_file alpha/t-vms t-slibgcc-vms"
|
||||
tmake_file="$tmake_file alpha/t-alpha alpha/t-ieee alpha/t-vms t-slibgcc-vms"
|
||||
extra_parts="$extra_parts vms-dwarf2.o vms-dwarf2eh.o"
|
||||
md_unwind_header=alpha/vms-unwind.h
|
||||
;;
|
||||
alpha*-dec-*vms*)
|
||||
tmake_file="$tmake_file alpha/t-vms t-slibgcc-vms"
|
||||
tmake_file="$tmake_file alpha/t-alpha alpha/t-ieee alpha/t-vms t-slibgcc-vms"
|
||||
extra_parts="$extra_parts vms-dwarf2.o vms-dwarf2eh.o"
|
||||
md_unwind_header=alpha/vms-unwind.h
|
||||
;;
|
||||
|
@ -313,7 +322,7 @@ arm*-*-freebsd*)
|
|||
tmake_file="$tmake_file arm/t-arm arm/t-strongarm-elf t-fdpbit"
|
||||
;;
|
||||
arm*-*-netbsdelf*)
|
||||
tmake_file="$tmake_file arm/t-arm t-slibgcc-gld-nover"
|
||||
tmake_file="$tmake_file arm/t-arm arm/t-netbsd t-slibgcc-gld-nover"
|
||||
;;
|
||||
arm*-*-linux*) # ARM GNU/Linux with ELF
|
||||
tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix"
|
||||
|
@ -379,16 +388,16 @@ avr-*-*)
|
|||
tmake_file="${cpu_type}/t-avr t-fpbit"
|
||||
;;
|
||||
bfin*-elf*)
|
||||
tmake_file="bfin/t-bfin bfin/t-crtlibid bfin/t-crtstuff t-fdpbit"
|
||||
tmake_file="bfin/t-bfin bfin/t-elf bfin/t-crtlibid bfin/t-crtstuff t-fdpbit"
|
||||
extra_parts="$extra_parts crtbeginS.o crtendS.o crti.o crtn.o crtlibid.o"
|
||||
;;
|
||||
bfin*-uclinux*)
|
||||
tmake_file="bfin/t-bfin bfin/t-crtlibid bfin/t-crtstuff t-fdpbit"
|
||||
tmake_file="bfin/t-bfin bfin/t-elf bfin/t-crtlibid bfin/t-crtstuff t-fdpbit"
|
||||
extra_parts="$extra_parts crtbeginS.o crtendS.o crtlibid.o"
|
||||
md_unwind_header=bfin/linux-unwind.h
|
||||
;;
|
||||
bfin*-linux-uclibc*)
|
||||
tmake_file="$tmake_file bfin/t-bfin bfin/t-crtstuff t-fdpbit bfin/t-linux"
|
||||
tmake_file="$tmake_file bfin/t-bfin bfin/t-elf bfin/t-crtstuff t-fdpbit bfin/t-linux"
|
||||
# No need to build crtbeginT.o on uClibc systems. Should probably
|
||||
# be moved to the OS specific section above.
|
||||
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
|
||||
|
@ -403,21 +412,21 @@ bfin*-*)
|
|||
extra_parts="crtbegin.o crtend.o crti.o crtn.o"
|
||||
;;
|
||||
crisv32-*-elf)
|
||||
tmake_file=t-fdpbit
|
||||
tmake_file="cris/t-cris t-fdpbit"
|
||||
;;
|
||||
crisv32-*-none)
|
||||
tmake_file=t-fdpbit
|
||||
tmake_file="cris/t-cris t-fdpbit"
|
||||
extra_parts="crtbegin.o crtend.o"
|
||||
;;
|
||||
cris-*-elf)
|
||||
tmake_file="$tmake_file cris/t-elfmulti"
|
||||
tmake_file="$tmake_file cris/t-cris cris/t-elfmulti"
|
||||
;;
|
||||
cris-*-none)
|
||||
tmake_file="$tmake_file cris/t-elfmulti"
|
||||
tmake_file="$tmake_file cris/t-cris cris/t-elfmulti"
|
||||
extra_parts="crtbegin.o crtend.o"
|
||||
;;
|
||||
cris-*-linux* | crisv32-*-linux*)
|
||||
tmake_file="$tmake_file t-fdpbit cris/t-linux"
|
||||
tmake_file="$tmake_file cris/t-cris t-fdpbit cris/t-linux"
|
||||
;;
|
||||
fr30-*-elf)
|
||||
tmake_file="$tmake_file fr30/t-fr30 t-fdpbit"
|
||||
|
@ -453,7 +462,7 @@ hppa*-*-linux*)
|
|||
md_unwind_header=pa/linux-unwind.h
|
||||
;;
|
||||
hppa[12]*-*-hpux10*)
|
||||
tmake_file="$tmake_file t-slibgcc"
|
||||
tmake_file="$tmake_file pa/t-hpux pa/t-hpux10 t-libgcc-pic t-slibgcc"
|
||||
# Set the libgcc version number
|
||||
if test x$enable_sjlj_exceptions = xyes; then
|
||||
tmake_file="$tmake_file pa/t-slibgcc-sjlj-ver"
|
||||
|
@ -464,7 +473,7 @@ hppa[12]*-*-hpux10*)
|
|||
md_unwind_header=pa/hpux-unwind.h
|
||||
;;
|
||||
hppa*64*-*-hpux11*)
|
||||
tmake_file="$tmake_file pa/t-stublib pa/t-stublib64 t-slibgcc"
|
||||
tmake_file="$tmake_file pa/t-hpux pa/t-pa64 pa/t-stublib pa/t-stublib64 t-libgcc-pic t-slibgcc"
|
||||
# Set the libgcc version number
|
||||
if test x$enable_sjlj_exceptions = xyes; then
|
||||
tmake_file="$tmake_file pa/t-slibgcc-sjlj-ver"
|
||||
|
@ -477,7 +486,7 @@ hppa*64*-*-hpux11*)
|
|||
md_unwind_header=pa/hpux-unwind.h
|
||||
;;
|
||||
hppa[12]*-*-hpux11*)
|
||||
tmake_file="$tmake_file pa/t-stublib t-slibgcc"
|
||||
tmake_file="$tmake_file pa/t-hpux pa/t-stublib t-libgcc-pic t-slibgcc"
|
||||
# Set the libgcc version number
|
||||
if test x$enable_sjlj_exceptions = xyes; then
|
||||
tmake_file="$tmake_file pa/t-slibgcc-sjlj-ver"
|
||||
|
@ -497,10 +506,10 @@ x86_64-*-darwin*)
|
|||
extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
|
||||
;;
|
||||
i[34567]86-*-elf*)
|
||||
tmake_file="$tmake_file i386/t-crtstuff t-crtstuff-pic"
|
||||
tmake_file="$tmake_file i386/t-crtstuff t-crtstuff-pic t-libgcc-pic"
|
||||
;;
|
||||
x86_64-*-elf*)
|
||||
tmake_file="$tmake_file i386/t-crtstuff t-crtstuff-pic"
|
||||
tmake_file="$tmake_file i386/t-crtstuff t-crtstuff-pic t-libgcc-pic"
|
||||
;;
|
||||
i[34567]86-*-freebsd*)
|
||||
tmake_file="${tmake_file} i386/t-freebsd i386/t-crtstuff"
|
||||
|
@ -540,7 +549,7 @@ i[34567]86-pc-msdosdjgpp*)
|
|||
i[34567]86-*-lynxos*)
|
||||
;;
|
||||
i[34567]86-*-nto-qnx*)
|
||||
tmake_file="$tmake_file i386/t-nto"
|
||||
tmake_file="$tmake_file i386/t-nto t-libgcc-pic"
|
||||
extra_parts=crtbegin.o
|
||||
;;
|
||||
i[34567]86-*-rtems*)
|
||||
|
@ -577,6 +586,11 @@ i[34567]86-*-cygwin*)
|
|||
;;
|
||||
i[34567]86-*-mingw*)
|
||||
extra_parts="crtbegin.o crtend.o crtfastmath.o"
|
||||
case ${target_thread_file} in
|
||||
win32)
|
||||
tmake_file="$tmake_file i386/t-gthr-win32"
|
||||
;;
|
||||
esac
|
||||
# This has to match the logic for DWARF2_UNWIND_INFO in gcc/config/i386/cygming.h
|
||||
if test x$enable_sjlj_exceptions = xyes; then
|
||||
tmake_eh_file="i386/t-sjlj-eh"
|
||||
|
@ -593,6 +607,11 @@ i[34567]86-*-mingw*)
|
|||
md_unwind_header=i386/w32-unwind.h
|
||||
;;
|
||||
x86_64-*-mingw*)
|
||||
case ${target_thread_file} in
|
||||
win32)
|
||||
tmake_file="$tmake_file i386/t-gthr-win32"
|
||||
;;
|
||||
esac
|
||||
# This has to match the logic for DWARF2_UNWIND_INFO in gcc/config/i386/cygming.h
|
||||
if test x$enable_sjlj_exceptions = xyes; then
|
||||
tmake_eh_file="i386/t-sjlj-eh"
|
||||
|
@ -609,7 +628,7 @@ x86_64-*-mingw*)
|
|||
extra_parts="$extra_parts crtfastmath.o"
|
||||
;;
|
||||
i[34567]86-*-interix3*)
|
||||
tmake_file="$tmake_file i386/t-chkstk"
|
||||
tmake_file="$tmake_file i386/t-interix i386/t-chkstk"
|
||||
;;
|
||||
ia64*-*-elf*)
|
||||
extra_parts="$extra_parts crtbeginS.o crtendS.o crtfastmath.o"
|
||||
|
@ -647,7 +666,7 @@ lm32-*-elf*|lm32-*-rtems*)
|
|||
;;
|
||||
lm32-*-uclinux*)
|
||||
extra_parts="$extra_parts crtbegin.o crtendS.o crtbeginT.o"
|
||||
tmake_file="lm32/t-lm32 lm32/t-uclinux t-softfp-sfdf t-softfp"
|
||||
tmake_file="lm32/t-lm32 lm32/t-uclinux t-libgcc-pic t-softfp-sfdf t-softfp"
|
||||
;;
|
||||
m32r-*-elf*)
|
||||
tmake_file=t-fdpbit
|
||||
|
@ -737,35 +756,35 @@ mipsisa32-*-elf* | mipsisa32el-*-elf* | \
|
|||
mipsisa32r2-*-elf* | mipsisa32r2el-*-elf* | \
|
||||
mipsisa64-*-elf* | mipsisa64el-*-elf* | \
|
||||
mipsisa64r2-*-elf* | mipsisa64r2el-*-elf*)
|
||||
tmake_file="$tmake_file mips/t-crtstuff mips/t-mips16"
|
||||
tmake_file="$tmake_file mips/t-elf mips/t-crtstuff mips/t-mips16"
|
||||
extra_parts="$extra_parts crti.o crtn.o"
|
||||
;;
|
||||
mipsisa64sr71k-*-elf*)
|
||||
tmake_file="mips/t-crtstuff t-fdpbit"
|
||||
tmake_file="mips/t-elf mips/t-crtstuff t-fdpbit"
|
||||
extra_parts="$extra_parts crti.o crtn.o"
|
||||
;;
|
||||
mipsisa64sb1-*-elf* | mipsisa64sb1el-*-elf*)
|
||||
tmake_file="$tmake_file mips/t-crtstuff mips/t-mips16"
|
||||
tmake_file="$tmake_file mips/t-elf mips/t-crtstuff mips/t-mips16"
|
||||
extra_parts="$extra_parts crti.o crtn.o"
|
||||
;;
|
||||
mips-*-elf* | mipsel-*-elf*)
|
||||
tmake_file="$tmake_file mips/t-crtstuff mips/t-mips16"
|
||||
tmake_file="$tmake_file mips/t-elf mips/t-crtstuff mips/t-mips16"
|
||||
extra_parts="$extra_parts crti.o crtn.o"
|
||||
;;
|
||||
mips64-*-elf* | mips64el-*-elf*)
|
||||
tmake_file="$tmake_file mips/t-crtstuff mips/t-mips16"
|
||||
tmake_file="$tmake_file mips/t-elf mips/t-crtstuff mips/t-mips16"
|
||||
extra_parts="$extra_parts crti.o crtn.o"
|
||||
;;
|
||||
mips64vr-*-elf* | mips64vrel-*-elf*)
|
||||
tmake_file="$tmake_file mips/t-crtstuff"
|
||||
tmake_file="$tmake_file mips/t-elf mips/t-vr mips/t-crtstuff"
|
||||
extra_parts="$extra_parts crti.o crtn.o"
|
||||
;;
|
||||
mips64orion-*-elf* | mips64orionel-*-elf*)
|
||||
tmake_file="$tmake_file mips/t-crtstuff mips/t-mips16"
|
||||
tmake_file="$tmake_file mips/t-elf mips/t-crtstuff mips/t-mips16"
|
||||
extra_parts="$extra_parts crti.o crtn.o"
|
||||
;;
|
||||
mips*-*-rtems*)
|
||||
tmake_file="$tmake_file mips/t-crtstuff mips/t-mips16"
|
||||
tmake_file="$tmake_file mips/t-elf mips/t-crtstuff mips/t-mips16"
|
||||
extra_parts="$extra_parts crti.o crtn.o"
|
||||
;;
|
||||
mips-wrs-vxworks)
|
||||
|
@ -790,7 +809,7 @@ moxie-*-rtems*)
|
|||
extra_parts=
|
||||
;;
|
||||
pdp11-*-*)
|
||||
tmake_file=t-fdpbit
|
||||
tmake_file="pdp11/t-pdp11 t-fdpbit"
|
||||
;;
|
||||
picochip-*-*)
|
||||
tmake_file="picochip/t-picochip t-fpbit"
|
||||
|
@ -809,7 +828,7 @@ powerpc-*-darwin*)
|
|||
extra_parts="$extra_parts crt2.o"
|
||||
;;
|
||||
powerpc64-*-darwin*)
|
||||
tmake_file="$tmake_file rs6000/t-ibm-ldouble"
|
||||
tmake_file="$tmake_file rs6000/t-darwin64 rs6000/t-ibm-ldouble"
|
||||
extra_parts="$extra_parts crt2.o"
|
||||
;;
|
||||
powerpc-*-freebsd*)
|
||||
|
@ -898,7 +917,7 @@ s390x-*-linux*)
|
|||
md_unwind_header=s390/linux-unwind.h
|
||||
;;
|
||||
s390x-ibm-tpf*)
|
||||
tmake_file="${tmake_file} s390/t-crtstuff s390/t-tpf t-eh-dw2-dip"
|
||||
tmake_file="${tmake_file} s390/t-crtstuff t-libgcc-pic t-eh-dw2-dip"
|
||||
extra_parts="crtbeginS.o crtendS.o"
|
||||
md_unwind_header=s390/tpf-unwind.h
|
||||
;;
|
||||
|
@ -1019,14 +1038,14 @@ sparc64-*-linux*) # 64-bit SPARC's running GNU/Linux
|
|||
sparc64-*-netbsd*)
|
||||
;;
|
||||
spu-*-elf*)
|
||||
tmake_file="$tmake_file spu/t-elf t-fdpbit"
|
||||
tmake_file="$tmake_file spu/t-elf t-libgcc-pic t-fdpbit"
|
||||
extra_parts="$extra_parts \
|
||||
libgcc_cachemgr.a libgcc_cachemgr_nonatomic.a \
|
||||
libgcc_cache8k.a libgcc_cache16k.a libgcc_cache32k.a \
|
||||
libgcc_cache64k.a libgcc_cache128k.a"
|
||||
;;
|
||||
tic6x-*-uclinux)
|
||||
tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl t-softfp c6x/t-elf c6x/t-uclinux t-crtstuff-pic t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-gnu-prefix"
|
||||
tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl t-softfp c6x/t-elf c6x/t-uclinux t-crtstuff-pic t-libgcc-pic t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-gnu-prefix"
|
||||
extra_parts="crtbeginS.o crtendS.o crti.o crtn.o"
|
||||
unwind_header=config/c6x/unwind-c6x.h
|
||||
;;
|
||||
|
|
265
libgcc/config/alpha/gthr-posix.c
Normal file
265
libgcc/config/alpha/gthr-posix.c
Normal file
|
@ -0,0 +1,265 @@
|
|||
/* POSIX threads dummy routines for systems without weak definitions. */
|
||||
/* Compile this one with gcc. */
|
||||
/* Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009, 2011
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "tconfig.h"
|
||||
#include "tm.h"
|
||||
# define __gthrw_pragma(pragma) _Pragma (#pragma)
|
||||
/* Define so we provide weak definitions of functions used by libobjc only. */
|
||||
#define _LIBOBJC_WEAK
|
||||
#include "gthr.h"
|
||||
|
||||
int
|
||||
pthread_once (pthread_once_t *once ATTRIBUTE_UNUSED,
|
||||
void (*func) (void) ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
pthread_key_create (pthread_key_t *key ATTRIBUTE_UNUSED,
|
||||
void (*dtor) (void *) ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
pthread_key_delete (pthread_key_t key ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void *
|
||||
pthread_getspecific (pthread_key_t key ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
pthread_setspecific (pthread_key_t key ATTRIBUTE_UNUSED,
|
||||
const void *ptr ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
pthread_create (pthread_t *thread ATTRIBUTE_UNUSED,
|
||||
const pthread_attr_t *attr ATTRIBUTE_UNUSED,
|
||||
void *(*start_routine) (void *) ATTRIBUTE_UNUSED,
|
||||
void *arg ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
pthread_join (pthread_t thread ATTRIBUTE_UNUSED,
|
||||
void **value_ptr ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
pthread_exit (void *value_ptr ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
int
|
||||
pthread_detach (pthread_t thread ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
pthread_cancel (pthread_t thread ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
pthread_mutex_lock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
pthread_mutex_trylock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef _POSIX_TIMEOUTS
|
||||
#if _POSIX_TIMEOUTS >= 0
|
||||
int
|
||||
pthread_mutex_timedlock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED,
|
||||
const struct timespec *abs_timeout ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#endif /* _POSIX_TIMEOUTS */
|
||||
|
||||
int
|
||||
pthread_mutex_unlock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
pthread_mutexattr_init (pthread_mutexattr_t *attr ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
pthread_mutexattr_settype (pthread_mutexattr_t *attr ATTRIBUTE_UNUSED,
|
||||
int type ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
pthread_mutexattr_destroy (pthread_mutexattr_t *attr ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
pthread_cond_broadcast (pthread_cond_t *cond ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
pthread_cond_destroy (pthread_cond_t *cond ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
pthread_cond_init (pthread_cond_t *cond ATTRIBUTE_UNUSED,
|
||||
const pthread_condattr_t *attr ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
pthread_cond_signal (pthread_cond_t *cond ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
pthread_cond_wait (pthread_cond_t *cond ATTRIBUTE_UNUSED,
|
||||
pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
pthread_cond_timedwait (pthread_cond_t *cond ATTRIBUTE_UNUSED,
|
||||
pthread_mutex_t *mutex ATTRIBUTE_UNUSED,
|
||||
const struct timespec *abstime ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
pthread_mutex_init (pthread_mutex_t *mutex ATTRIBUTE_UNUSED,
|
||||
const pthread_mutexattr_t *attr ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
pthread_mutex_destroy (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
pthread_t
|
||||
pthread_self (void)
|
||||
{
|
||||
return (pthread_t) 0;
|
||||
}
|
||||
|
||||
#ifdef _POSIX_PRIORITY_SCHEDULING
|
||||
#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
|
||||
int
|
||||
sched_get_priority_max (int policy ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
sched_get_priority_min (int policy ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
|
||||
#endif /* _POSIX_PRIORITY_SCHEDULING */
|
||||
|
||||
int
|
||||
sched_yield (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
pthread_attr_destroy (pthread_attr_t *attr ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
pthread_attr_init (pthread_attr_t *attr ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
pthread_attr_setdetachstate (pthread_attr_t *attr ATTRIBUTE_UNUSED,
|
||||
int detachstate ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
|
||||
int
|
||||
pthread_getschedparam (pthread_t thread ATTRIBUTE_UNUSED,
|
||||
int *policy ATTRIBUTE_UNUSED,
|
||||
struct sched_param *param ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
pthread_setschedparam (pthread_t thread ATTRIBUTE_UNUSED,
|
||||
int policy ATTRIBUTE_UNUSED,
|
||||
const struct sched_param *param ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
|
||||
|
163
libgcc/config/alpha/qrnnd.S
Normal file
163
libgcc/config/alpha/qrnnd.S
Normal file
|
@ -0,0 +1,163 @@
|
|||
# Alpha 21064 __udiv_qrnnd
|
||||
# Copyright (C) 1992, 1994, 1995, 2000, 2009 Free Software Foundation, Inc.
|
||||
|
||||
# This file is part of GCC.
|
||||
|
||||
# The GNU MP Library is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or (at your
|
||||
# option) any later version.
|
||||
|
||||
# This file is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
||||
# License for more details.
|
||||
|
||||
# Under Section 7 of GPL version 3, you are granted additional
|
||||
# permissions described in the GCC Runtime Library Exception, version
|
||||
# 3.1, as published by the Free Software Foundation.
|
||||
|
||||
# You should have received a copy of the GNU General Public License and
|
||||
# a copy of the GCC Runtime Library Exception along with this program;
|
||||
# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifdef __ELF__
|
||||
.section .note.GNU-stack,""
|
||||
#endif
|
||||
|
||||
.set noreorder
|
||||
.set noat
|
||||
|
||||
.text
|
||||
|
||||
.globl __udiv_qrnnd
|
||||
.ent __udiv_qrnnd
|
||||
__udiv_qrnnd:
|
||||
.frame $30,0,$26,0
|
||||
.prologue 0
|
||||
|
||||
#define cnt $2
|
||||
#define tmp $3
|
||||
#define rem_ptr $16
|
||||
#define n1 $17
|
||||
#define n0 $18
|
||||
#define d $19
|
||||
#define qb $20
|
||||
#define AT $at
|
||||
|
||||
ldiq cnt,16
|
||||
blt d,$largedivisor
|
||||
|
||||
$loop1: cmplt n0,0,tmp
|
||||
addq n1,n1,n1
|
||||
bis n1,tmp,n1
|
||||
addq n0,n0,n0
|
||||
cmpule d,n1,qb
|
||||
subq n1,d,tmp
|
||||
cmovne qb,tmp,n1
|
||||
bis n0,qb,n0
|
||||
cmplt n0,0,tmp
|
||||
addq n1,n1,n1
|
||||
bis n1,tmp,n1
|
||||
addq n0,n0,n0
|
||||
cmpule d,n1,qb
|
||||
subq n1,d,tmp
|
||||
cmovne qb,tmp,n1
|
||||
bis n0,qb,n0
|
||||
cmplt n0,0,tmp
|
||||
addq n1,n1,n1
|
||||
bis n1,tmp,n1
|
||||
addq n0,n0,n0
|
||||
cmpule d,n1,qb
|
||||
subq n1,d,tmp
|
||||
cmovne qb,tmp,n1
|
||||
bis n0,qb,n0
|
||||
cmplt n0,0,tmp
|
||||
addq n1,n1,n1
|
||||
bis n1,tmp,n1
|
||||
addq n0,n0,n0
|
||||
cmpule d,n1,qb
|
||||
subq n1,d,tmp
|
||||
cmovne qb,tmp,n1
|
||||
bis n0,qb,n0
|
||||
subq cnt,1,cnt
|
||||
bgt cnt,$loop1
|
||||
stq n1,0(rem_ptr)
|
||||
bis $31,n0,$0
|
||||
ret $31,($26),1
|
||||
|
||||
$largedivisor:
|
||||
and n0,1,$4
|
||||
|
||||
srl n0,1,n0
|
||||
sll n1,63,tmp
|
||||
or tmp,n0,n0
|
||||
srl n1,1,n1
|
||||
|
||||
and d,1,$6
|
||||
srl d,1,$5
|
||||
addq $5,$6,$5
|
||||
|
||||
$loop2: cmplt n0,0,tmp
|
||||
addq n1,n1,n1
|
||||
bis n1,tmp,n1
|
||||
addq n0,n0,n0
|
||||
cmpule $5,n1,qb
|
||||
subq n1,$5,tmp
|
||||
cmovne qb,tmp,n1
|
||||
bis n0,qb,n0
|
||||
cmplt n0,0,tmp
|
||||
addq n1,n1,n1
|
||||
bis n1,tmp,n1
|
||||
addq n0,n0,n0
|
||||
cmpule $5,n1,qb
|
||||
subq n1,$5,tmp
|
||||
cmovne qb,tmp,n1
|
||||
bis n0,qb,n0
|
||||
cmplt n0,0,tmp
|
||||
addq n1,n1,n1
|
||||
bis n1,tmp,n1
|
||||
addq n0,n0,n0
|
||||
cmpule $5,n1,qb
|
||||
subq n1,$5,tmp
|
||||
cmovne qb,tmp,n1
|
||||
bis n0,qb,n0
|
||||
cmplt n0,0,tmp
|
||||
addq n1,n1,n1
|
||||
bis n1,tmp,n1
|
||||
addq n0,n0,n0
|
||||
cmpule $5,n1,qb
|
||||
subq n1,$5,tmp
|
||||
cmovne qb,tmp,n1
|
||||
bis n0,qb,n0
|
||||
subq cnt,1,cnt
|
||||
bgt cnt,$loop2
|
||||
|
||||
addq n1,n1,n1
|
||||
addq $4,n1,n1
|
||||
bne $6,$Odd
|
||||
stq n1,0(rem_ptr)
|
||||
bis $31,n0,$0
|
||||
ret $31,($26),1
|
||||
|
||||
$Odd:
|
||||
/* q' in n0. r' in n1 */
|
||||
addq n1,n0,n1
|
||||
|
||||
cmpult n1,n0,tmp # tmp := carry from addq
|
||||
subq n1,d,AT
|
||||
addq n0,tmp,n0
|
||||
cmovne tmp,AT,n1
|
||||
|
||||
cmpult n1,d,tmp
|
||||
addq n0,1,AT
|
||||
cmoveq tmp,AT,n0
|
||||
subq n1,d,AT
|
||||
cmoveq tmp,AT,n1
|
||||
|
||||
stq n1,0(rem_ptr)
|
||||
bis $31,n0,$0
|
||||
ret $31,($26),1
|
||||
|
||||
.end __udiv_qrnnd
|
|
@ -1,2 +1,2 @@
|
|||
# This is a support routine for longlong.h, used by libgcc2.c.
|
||||
LIB2ADD += $(gcc_srcdir)/config/alpha/qrnnd.asm
|
||||
LIB2ADD += $(srcdir)/config/alpha/qrnnd.S
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
HOST_LIBGCC2_CFLAGS += -pthread
|
||||
|
||||
# Provide dummy POSIX threads functions
|
||||
LIB2ADD += $(gcc_srcdir)/gthr-posix.c
|
||||
LIB2ADD += $(srcdir)/config/alpha/gthr-posix.c
|
||||
|
|
|
@ -5,3 +5,5 @@ vms-dwarf2.o: $(srcdir)/config/alpha/vms-dwarf2.S
|
|||
|
||||
vms-dwarf2eh.o: $(srcdir)/config/alpha/vms-dwarf2eh.S
|
||||
$(gcc_compile) -c -x assembler-with-cpp $<
|
||||
|
||||
LIB2ADD += $(srcdir)/config/alpha/vms-gcc_shell_handler.c
|
||||
|
|
124
libgcc/config/alpha/vms-gcc_shell_handler.c
Normal file
124
libgcc/config/alpha/vms-gcc_shell_handler.c
Normal file
|
@ -0,0 +1,124 @@
|
|||
/* Static condition handler for Alpha/VMS.
|
||||
Copyright (C) 2005-2009
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published
|
||||
by the Free Software Foundation; either version 3, or (at your
|
||||
option) any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
||||
License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* This file implements __gcc_shell_handler, the static VMS condition handler
|
||||
used as the indirection wrapper around user level handlers installed with
|
||||
establish_vms_condition_handler GCC builtin.
|
||||
|
||||
[ABI] in comments refers to the "HP OpenVMS calling standard" document
|
||||
dated January 2005. */
|
||||
|
||||
#include <vms/chfdef.h>
|
||||
#include <vms/pdscdef.h>
|
||||
#include <vms/ssdef.h>
|
||||
|
||||
typedef void * ADDR;
|
||||
typedef unsigned long long REG;
|
||||
|
||||
#define REG_AT(addr) (*(REG *)(addr))
|
||||
|
||||
/* Compute pointer to procedure descriptor (Procedure Value) from Frame
|
||||
Pointer FP, according to the rules in [ABI-3.5.1 Current Procedure]. */
|
||||
#define PV_FOR(FP) \
|
||||
(((FP) != 0) \
|
||||
? (((REG_AT (FP) & 0x7) == 0) ? *(PDSCDEF **)(FP) : (PDSCDEF *)(FP)) : 0)
|
||||
|
||||
long
|
||||
__gcc_shell_handler (struct chf$signal_array *sig_arr,
|
||||
struct chf$mech_array *mech_arr);
|
||||
|
||||
/* Helper for __gcc_shell_handler. Fetch the pointer to procedure currently
|
||||
registered as the VMS condition handler for the live function with a frame
|
||||
pointer FP. */
|
||||
|
||||
static ADDR
|
||||
get_dyn_handler_pointer (REG fp)
|
||||
{
|
||||
/* From the frame pointer we find the procedure descriptor, and fetch
|
||||
the handler_data field from there. This field contains the offset
|
||||
from FP at which the address of the currently installed handler is
|
||||
to be found. */
|
||||
|
||||
PDSCDEF * pd = PV_FOR (fp);
|
||||
/* Procedure descriptor pointer for the live subprogram with FP as the frame
|
||||
pointer, and to which _gcc_shell_handler is attached as a condition
|
||||
handler. */
|
||||
|
||||
REG handler_slot_offset;
|
||||
/* Offset from FP at which the address of the currently established real
|
||||
condition handler is to be found. This offset is available from the
|
||||
handler_data field of the procedure descriptor. */
|
||||
|
||||
REG handler_data_offset;
|
||||
/* The handler_data field position in the procedure descriptor, which
|
||||
depends on the kind of procedure at hand. */
|
||||
|
||||
switch (pd->pdsc$w_flags & 0xf)
|
||||
{
|
||||
case PDSC$K_KIND_FP_STACK: /* [3.4.2 PD for stack frame procedures] */
|
||||
handler_data_offset = 40;
|
||||
break;
|
||||
|
||||
case PDSC$K_KIND_FP_REGISTER: /* [3.4.5 PD for reg frame procedures] */
|
||||
handler_data_offset = 32;
|
||||
break;
|
||||
|
||||
default:
|
||||
handler_data_offset = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
/* If we couldn't determine the handler_data field position, give up. */
|
||||
if (handler_data_offset == 0)
|
||||
return 0;
|
||||
|
||||
/* Otherwise, fetch the fp offset at which the real handler address is to be
|
||||
found, then fetch and return the latter in turn. */
|
||||
|
||||
handler_slot_offset = REG_AT ((REG)pd + handler_data_offset);
|
||||
|
||||
return (ADDR) REG_AT (fp + handler_slot_offset);
|
||||
}
|
||||
|
||||
/* The static VMS condition handler for GCC code. Fetch the address of the
|
||||
currently established condition handler, then resignal if there is none or
|
||||
call the handler with the VMS condition arguments. */
|
||||
|
||||
long
|
||||
__gcc_shell_handler (struct chf$signal_array *sig_arr,
|
||||
struct chf$mech_array *mech_arr)
|
||||
{
|
||||
long ret;
|
||||
long (*user_handler) (struct chf$signal_array *, struct chf$mech_array *);
|
||||
|
||||
user_handler = get_dyn_handler_pointer (mech_arr->chf$q_mch_frame);
|
||||
if (!user_handler)
|
||||
ret = SS$_RESIGNAL;
|
||||
else
|
||||
ret = user_handler (sig_arr, mech_arr);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
56
libgcc/config/arm/bpabi.c
Normal file
56
libgcc/config/arm/bpabi.c
Normal file
|
@ -0,0 +1,56 @@
|
|||
/* Miscellaneous BPABI functions.
|
||||
|
||||
Copyright (C) 2003, 2004, 2009 Free Software Foundation, Inc.
|
||||
Contributed by CodeSourcery, LLC.
|
||||
|
||||
This file is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 3, or (at your option) any
|
||||
later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
extern long long __divdi3 (long long, long long);
|
||||
extern unsigned long long __udivdi3 (unsigned long long,
|
||||
unsigned long long);
|
||||
extern long long __gnu_ldivmod_helper (long long, long long, long long *);
|
||||
extern unsigned long long __gnu_uldivmod_helper (unsigned long long,
|
||||
unsigned long long,
|
||||
unsigned long long *);
|
||||
|
||||
|
||||
long long
|
||||
__gnu_ldivmod_helper (long long a,
|
||||
long long b,
|
||||
long long *remainder)
|
||||
{
|
||||
long long quotient;
|
||||
|
||||
quotient = __divdi3 (a, b);
|
||||
*remainder = a - b * quotient;
|
||||
return quotient;
|
||||
}
|
||||
|
||||
unsigned long long
|
||||
__gnu_uldivmod_helper (unsigned long long a,
|
||||
unsigned long long b,
|
||||
unsigned long long *remainder)
|
||||
{
|
||||
unsigned long long quotient;
|
||||
|
||||
quotient = __udivdi3 (a, b);
|
||||
*remainder = a - b * quotient;
|
||||
return quotient;
|
||||
}
|
145
libgcc/config/arm/fp16.c
Normal file
145
libgcc/config/arm/fp16.c
Normal file
|
@ -0,0 +1,145 @@
|
|||
/* Half-float conversion routines.
|
||||
|
||||
Copyright (C) 2008, 2009 Free Software Foundation, Inc.
|
||||
Contributed by CodeSourcery.
|
||||
|
||||
This file is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 3, or (at your option) any
|
||||
later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
static inline unsigned short
|
||||
__gnu_f2h_internal(unsigned int a, int ieee)
|
||||
{
|
||||
unsigned short sign = (a >> 16) & 0x8000;
|
||||
int aexp = (a >> 23) & 0xff;
|
||||
unsigned int mantissa = a & 0x007fffff;
|
||||
unsigned int mask;
|
||||
unsigned int increment;
|
||||
|
||||
if (aexp == 0xff)
|
||||
{
|
||||
if (!ieee)
|
||||
return sign;
|
||||
return sign | 0x7e00 | (mantissa >> 13);
|
||||
}
|
||||
|
||||
if (aexp == 0 && mantissa == 0)
|
||||
return sign;
|
||||
|
||||
aexp -= 127;
|
||||
|
||||
/* Decimal point between bits 22 and 23. */
|
||||
mantissa |= 0x00800000;
|
||||
if (aexp < -14)
|
||||
{
|
||||
mask = 0x007fffff;
|
||||
if (aexp < -25)
|
||||
aexp = -26;
|
||||
else if (aexp != -25)
|
||||
mask >>= 24 + aexp;
|
||||
}
|
||||
else
|
||||
mask = 0x00001fff;
|
||||
|
||||
/* Round. */
|
||||
if (mantissa & mask)
|
||||
{
|
||||
increment = (mask + 1) >> 1;
|
||||
if ((mantissa & mask) == increment)
|
||||
increment = mantissa & (increment << 1);
|
||||
mantissa += increment;
|
||||
if (mantissa >= 0x01000000)
|
||||
{
|
||||
mantissa >>= 1;
|
||||
aexp++;
|
||||
}
|
||||
}
|
||||
|
||||
if (ieee)
|
||||
{
|
||||
if (aexp > 15)
|
||||
return sign | 0x7c00;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (aexp > 16)
|
||||
return sign | 0x7fff;
|
||||
}
|
||||
|
||||
if (aexp < -24)
|
||||
return sign;
|
||||
|
||||
if (aexp < -14)
|
||||
{
|
||||
mantissa >>= -14 - aexp;
|
||||
aexp = -14;
|
||||
}
|
||||
|
||||
/* We leave the leading 1 in the mantissa, and subtract one
|
||||
from the exponent bias to compensate. */
|
||||
return sign | (((aexp + 14) << 10) + (mantissa >> 13));
|
||||
}
|
||||
|
||||
unsigned int
|
||||
__gnu_h2f_internal(unsigned short a, int ieee)
|
||||
{
|
||||
unsigned int sign = (unsigned int)(a & 0x8000) << 16;
|
||||
int aexp = (a >> 10) & 0x1f;
|
||||
unsigned int mantissa = a & 0x3ff;
|
||||
|
||||
if (aexp == 0x1f && ieee)
|
||||
return sign | 0x7f800000 | (mantissa << 13);
|
||||
|
||||
if (aexp == 0)
|
||||
{
|
||||
int shift;
|
||||
|
||||
if (mantissa == 0)
|
||||
return sign;
|
||||
|
||||
shift = __builtin_clz(mantissa) - 21;
|
||||
mantissa <<= shift;
|
||||
aexp = -shift;
|
||||
}
|
||||
|
||||
return sign | (((aexp + 0x70) << 23) + (mantissa << 13));
|
||||
}
|
||||
|
||||
unsigned short
|
||||
__gnu_f2h_ieee(unsigned int a)
|
||||
{
|
||||
return __gnu_f2h_internal(a, 1);
|
||||
}
|
||||
|
||||
unsigned int
|
||||
__gnu_h2f_ieee(unsigned short a)
|
||||
{
|
||||
return __gnu_h2f_internal(a, 1);
|
||||
}
|
||||
|
||||
unsigned short
|
||||
__gnu_f2h_alternative(unsigned int x)
|
||||
{
|
||||
return __gnu_f2h_internal(x, 0);
|
||||
}
|
||||
|
||||
unsigned int
|
||||
__gnu_h2f_alternative(unsigned short a)
|
||||
{
|
||||
return __gnu_h2f_internal(a, 0);
|
||||
}
|
166
libgcc/config/arm/linux-atomic-64bit.c
Normal file
166
libgcc/config/arm/linux-atomic-64bit.c
Normal file
|
@ -0,0 +1,166 @@
|
|||
/* 64bit Linux-specific atomic operations for ARM EABI.
|
||||
Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
|
||||
Based on linux-atomic.c
|
||||
|
||||
64 bit additions david.gilbert@linaro.org
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* 64bit helper functions for atomic operations; the compiler will
|
||||
call these when the code is compiled for a CPU without ldrexd/strexd.
|
||||
(If the CPU had those then the compiler inlines the operation).
|
||||
|
||||
These helpers require a kernel helper that's only present on newer
|
||||
kernels; we check for that in an init section and bail out rather
|
||||
unceremoneously. */
|
||||
|
||||
extern unsigned int __write (int fd, const void *buf, unsigned int count);
|
||||
extern void abort (void);
|
||||
|
||||
/* Kernel helper for compare-and-exchange. */
|
||||
typedef int (__kernel_cmpxchg64_t) (const long long* oldval,
|
||||
const long long* newval,
|
||||
long long *ptr);
|
||||
#define __kernel_cmpxchg64 (*(__kernel_cmpxchg64_t *) 0xffff0f60)
|
||||
|
||||
/* Kernel helper page version number. */
|
||||
#define __kernel_helper_version (*(unsigned int *)0xffff0ffc)
|
||||
|
||||
/* Check that the kernel has a new enough version at load. */
|
||||
static void __check_for_sync8_kernelhelper (void)
|
||||
{
|
||||
if (__kernel_helper_version < 5)
|
||||
{
|
||||
const char err[] = "A newer kernel is required to run this binary. "
|
||||
"(__kernel_cmpxchg64 helper)\n";
|
||||
/* At this point we need a way to crash with some information
|
||||
for the user - I'm not sure I can rely on much else being
|
||||
available at this point, so do the same as generic-morestack.c
|
||||
write () and abort (). */
|
||||
__write (2 /* stderr. */, err, sizeof (err));
|
||||
abort ();
|
||||
}
|
||||
};
|
||||
|
||||
static void (*__sync8_kernelhelper_inithook[]) (void)
|
||||
__attribute__ ((used, section (".init_array"))) = {
|
||||
&__check_for_sync8_kernelhelper
|
||||
};
|
||||
|
||||
#define HIDDEN __attribute__ ((visibility ("hidden")))
|
||||
|
||||
#define FETCH_AND_OP_WORD64(OP, PFX_OP, INF_OP) \
|
||||
long long HIDDEN \
|
||||
__sync_fetch_and_##OP##_8 (long long *ptr, long long val) \
|
||||
{ \
|
||||
int failure; \
|
||||
long long tmp,tmp2; \
|
||||
\
|
||||
do { \
|
||||
tmp = *ptr; \
|
||||
tmp2 = PFX_OP (tmp INF_OP val); \
|
||||
failure = __kernel_cmpxchg64 (&tmp, &tmp2, ptr); \
|
||||
} while (failure != 0); \
|
||||
\
|
||||
return tmp; \
|
||||
}
|
||||
|
||||
FETCH_AND_OP_WORD64 (add, , +)
|
||||
FETCH_AND_OP_WORD64 (sub, , -)
|
||||
FETCH_AND_OP_WORD64 (or, , |)
|
||||
FETCH_AND_OP_WORD64 (and, , &)
|
||||
FETCH_AND_OP_WORD64 (xor, , ^)
|
||||
FETCH_AND_OP_WORD64 (nand, ~, &)
|
||||
|
||||
#define NAME_oldval(OP, WIDTH) __sync_fetch_and_##OP##_##WIDTH
|
||||
#define NAME_newval(OP, WIDTH) __sync_##OP##_and_fetch_##WIDTH
|
||||
|
||||
/* Implement both __sync_<op>_and_fetch and __sync_fetch_and_<op> for
|
||||
subword-sized quantities. */
|
||||
|
||||
#define OP_AND_FETCH_WORD64(OP, PFX_OP, INF_OP) \
|
||||
long long HIDDEN \
|
||||
__sync_##OP##_and_fetch_8 (long long *ptr, long long val) \
|
||||
{ \
|
||||
int failure; \
|
||||
long long tmp,tmp2; \
|
||||
\
|
||||
do { \
|
||||
tmp = *ptr; \
|
||||
tmp2 = PFX_OP (tmp INF_OP val); \
|
||||
failure = __kernel_cmpxchg64 (&tmp, &tmp2, ptr); \
|
||||
} while (failure != 0); \
|
||||
\
|
||||
return tmp2; \
|
||||
}
|
||||
|
||||
OP_AND_FETCH_WORD64 (add, , +)
|
||||
OP_AND_FETCH_WORD64 (sub, , -)
|
||||
OP_AND_FETCH_WORD64 (or, , |)
|
||||
OP_AND_FETCH_WORD64 (and, , &)
|
||||
OP_AND_FETCH_WORD64 (xor, , ^)
|
||||
OP_AND_FETCH_WORD64 (nand, ~, &)
|
||||
|
||||
long long HIDDEN
|
||||
__sync_val_compare_and_swap_8 (long long *ptr, long long oldval,
|
||||
long long newval)
|
||||
{
|
||||
int failure;
|
||||
long long actual_oldval;
|
||||
|
||||
while (1)
|
||||
{
|
||||
actual_oldval = *ptr;
|
||||
|
||||
if (__builtin_expect (oldval != actual_oldval, 0))
|
||||
return actual_oldval;
|
||||
|
||||
failure = __kernel_cmpxchg64 (&actual_oldval, &newval, ptr);
|
||||
|
||||
if (__builtin_expect (!failure, 1))
|
||||
return oldval;
|
||||
}
|
||||
}
|
||||
|
||||
typedef unsigned char bool;
|
||||
|
||||
bool HIDDEN
|
||||
__sync_bool_compare_and_swap_8 (long long *ptr, long long oldval,
|
||||
long long newval)
|
||||
{
|
||||
int failure = __kernel_cmpxchg64 (&oldval, &newval, ptr);
|
||||
return (failure == 0);
|
||||
}
|
||||
|
||||
long long HIDDEN
|
||||
__sync_lock_test_and_set_8 (long long *ptr, long long val)
|
||||
{
|
||||
int failure;
|
||||
long long oldval;
|
||||
|
||||
do {
|
||||
oldval = *ptr;
|
||||
failure = __kernel_cmpxchg64 (&oldval, &val, ptr);
|
||||
} while (failure != 0);
|
||||
|
||||
return oldval;
|
||||
}
|
279
libgcc/config/arm/linux-atomic.c
Normal file
279
libgcc/config/arm/linux-atomic.c
Normal file
|
@ -0,0 +1,279 @@
|
|||
/* Linux-specific atomic operations for ARM EABI.
|
||||
Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
|
||||
Contributed by CodeSourcery.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Kernel helper for compare-and-exchange. */
|
||||
typedef int (__kernel_cmpxchg_t) (int oldval, int newval, int *ptr);
|
||||
#define __kernel_cmpxchg (*(__kernel_cmpxchg_t *) 0xffff0fc0)
|
||||
|
||||
/* Kernel helper for memory barrier. */
|
||||
typedef void (__kernel_dmb_t) (void);
|
||||
#define __kernel_dmb (*(__kernel_dmb_t *) 0xffff0fa0)
|
||||
|
||||
/* Note: we implement byte, short and int versions of atomic operations using
|
||||
the above kernel helpers; see linux-atomic-64bit.c for "long long" (64-bit)
|
||||
operations. */
|
||||
|
||||
#define HIDDEN __attribute__ ((visibility ("hidden")))
|
||||
|
||||
#ifdef __ARMEL__
|
||||
#define INVERT_MASK_1 0
|
||||
#define INVERT_MASK_2 0
|
||||
#else
|
||||
#define INVERT_MASK_1 24
|
||||
#define INVERT_MASK_2 16
|
||||
#endif
|
||||
|
||||
#define MASK_1 0xffu
|
||||
#define MASK_2 0xffffu
|
||||
|
||||
#define FETCH_AND_OP_WORD(OP, PFX_OP, INF_OP) \
|
||||
int HIDDEN \
|
||||
__sync_fetch_and_##OP##_4 (int *ptr, int val) \
|
||||
{ \
|
||||
int failure, tmp; \
|
||||
\
|
||||
do { \
|
||||
tmp = *ptr; \
|
||||
failure = __kernel_cmpxchg (tmp, PFX_OP (tmp INF_OP val), ptr); \
|
||||
} while (failure != 0); \
|
||||
\
|
||||
return tmp; \
|
||||
}
|
||||
|
||||
FETCH_AND_OP_WORD (add, , +)
|
||||
FETCH_AND_OP_WORD (sub, , -)
|
||||
FETCH_AND_OP_WORD (or, , |)
|
||||
FETCH_AND_OP_WORD (and, , &)
|
||||
FETCH_AND_OP_WORD (xor, , ^)
|
||||
FETCH_AND_OP_WORD (nand, ~, &)
|
||||
|
||||
#define NAME_oldval(OP, WIDTH) __sync_fetch_and_##OP##_##WIDTH
|
||||
#define NAME_newval(OP, WIDTH) __sync_##OP##_and_fetch_##WIDTH
|
||||
|
||||
/* Implement both __sync_<op>_and_fetch and __sync_fetch_and_<op> for
|
||||
subword-sized quantities. */
|
||||
|
||||
#define SUBWORD_SYNC_OP(OP, PFX_OP, INF_OP, TYPE, WIDTH, RETURN) \
|
||||
TYPE HIDDEN \
|
||||
NAME##_##RETURN (OP, WIDTH) (TYPE *ptr, TYPE val) \
|
||||
{ \
|
||||
int *wordptr = (int *) ((unsigned int) ptr & ~3); \
|
||||
unsigned int mask, shift, oldval, newval; \
|
||||
int failure; \
|
||||
\
|
||||
shift = (((unsigned int) ptr & 3) << 3) ^ INVERT_MASK_##WIDTH; \
|
||||
mask = MASK_##WIDTH << shift; \
|
||||
\
|
||||
do { \
|
||||
oldval = *wordptr; \
|
||||
newval = ((PFX_OP (((oldval & mask) >> shift) \
|
||||
INF_OP (unsigned int) val)) << shift) & mask; \
|
||||
newval |= oldval & ~mask; \
|
||||
failure = __kernel_cmpxchg (oldval, newval, wordptr); \
|
||||
} while (failure != 0); \
|
||||
\
|
||||
return (RETURN & mask) >> shift; \
|
||||
}
|
||||
|
||||
SUBWORD_SYNC_OP (add, , +, unsigned short, 2, oldval)
|
||||
SUBWORD_SYNC_OP (sub, , -, unsigned short, 2, oldval)
|
||||
SUBWORD_SYNC_OP (or, , |, unsigned short, 2, oldval)
|
||||
SUBWORD_SYNC_OP (and, , &, unsigned short, 2, oldval)
|
||||
SUBWORD_SYNC_OP (xor, , ^, unsigned short, 2, oldval)
|
||||
SUBWORD_SYNC_OP (nand, ~, &, unsigned short, 2, oldval)
|
||||
|
||||
SUBWORD_SYNC_OP (add, , +, unsigned char, 1, oldval)
|
||||
SUBWORD_SYNC_OP (sub, , -, unsigned char, 1, oldval)
|
||||
SUBWORD_SYNC_OP (or, , |, unsigned char, 1, oldval)
|
||||
SUBWORD_SYNC_OP (and, , &, unsigned char, 1, oldval)
|
||||
SUBWORD_SYNC_OP (xor, , ^, unsigned char, 1, oldval)
|
||||
SUBWORD_SYNC_OP (nand, ~, &, unsigned char, 1, oldval)
|
||||
|
||||
#define OP_AND_FETCH_WORD(OP, PFX_OP, INF_OP) \
|
||||
int HIDDEN \
|
||||
__sync_##OP##_and_fetch_4 (int *ptr, int val) \
|
||||
{ \
|
||||
int tmp, failure; \
|
||||
\
|
||||
do { \
|
||||
tmp = *ptr; \
|
||||
failure = __kernel_cmpxchg (tmp, PFX_OP (tmp INF_OP val), ptr); \
|
||||
} while (failure != 0); \
|
||||
\
|
||||
return PFX_OP (tmp INF_OP val); \
|
||||
}
|
||||
|
||||
OP_AND_FETCH_WORD (add, , +)
|
||||
OP_AND_FETCH_WORD (sub, , -)
|
||||
OP_AND_FETCH_WORD (or, , |)
|
||||
OP_AND_FETCH_WORD (and, , &)
|
||||
OP_AND_FETCH_WORD (xor, , ^)
|
||||
OP_AND_FETCH_WORD (nand, ~, &)
|
||||
|
||||
SUBWORD_SYNC_OP (add, , +, unsigned short, 2, newval)
|
||||
SUBWORD_SYNC_OP (sub, , -, unsigned short, 2, newval)
|
||||
SUBWORD_SYNC_OP (or, , |, unsigned short, 2, newval)
|
||||
SUBWORD_SYNC_OP (and, , &, unsigned short, 2, newval)
|
||||
SUBWORD_SYNC_OP (xor, , ^, unsigned short, 2, newval)
|
||||
SUBWORD_SYNC_OP (nand, ~, &, unsigned short, 2, newval)
|
||||
|
||||
SUBWORD_SYNC_OP (add, , +, unsigned char, 1, newval)
|
||||
SUBWORD_SYNC_OP (sub, , -, unsigned char, 1, newval)
|
||||
SUBWORD_SYNC_OP (or, , |, unsigned char, 1, newval)
|
||||
SUBWORD_SYNC_OP (and, , &, unsigned char, 1, newval)
|
||||
SUBWORD_SYNC_OP (xor, , ^, unsigned char, 1, newval)
|
||||
SUBWORD_SYNC_OP (nand, ~, &, unsigned char, 1, newval)
|
||||
|
||||
int HIDDEN
|
||||
__sync_val_compare_and_swap_4 (int *ptr, int oldval, int newval)
|
||||
{
|
||||
int actual_oldval, fail;
|
||||
|
||||
while (1)
|
||||
{
|
||||
actual_oldval = *ptr;
|
||||
|
||||
if (__builtin_expect (oldval != actual_oldval, 0))
|
||||
return actual_oldval;
|
||||
|
||||
fail = __kernel_cmpxchg (actual_oldval, newval, ptr);
|
||||
|
||||
if (__builtin_expect (!fail, 1))
|
||||
return oldval;
|
||||
}
|
||||
}
|
||||
|
||||
#define SUBWORD_VAL_CAS(TYPE, WIDTH) \
|
||||
TYPE HIDDEN \
|
||||
__sync_val_compare_and_swap_##WIDTH (TYPE *ptr, TYPE oldval, \
|
||||
TYPE newval) \
|
||||
{ \
|
||||
int *wordptr = (int *)((unsigned int) ptr & ~3), fail; \
|
||||
unsigned int mask, shift, actual_oldval, actual_newval; \
|
||||
\
|
||||
shift = (((unsigned int) ptr & 3) << 3) ^ INVERT_MASK_##WIDTH; \
|
||||
mask = MASK_##WIDTH << shift; \
|
||||
\
|
||||
while (1) \
|
||||
{ \
|
||||
actual_oldval = *wordptr; \
|
||||
\
|
||||
if (__builtin_expect (((actual_oldval & mask) >> shift) != \
|
||||
(unsigned int) oldval, 0)) \
|
||||
return (actual_oldval & mask) >> shift; \
|
||||
\
|
||||
actual_newval = (actual_oldval & ~mask) \
|
||||
| (((unsigned int) newval << shift) & mask); \
|
||||
\
|
||||
fail = __kernel_cmpxchg (actual_oldval, actual_newval, \
|
||||
wordptr); \
|
||||
\
|
||||
if (__builtin_expect (!fail, 1)) \
|
||||
return oldval; \
|
||||
} \
|
||||
}
|
||||
|
||||
SUBWORD_VAL_CAS (unsigned short, 2)
|
||||
SUBWORD_VAL_CAS (unsigned char, 1)
|
||||
|
||||
typedef unsigned char bool;
|
||||
|
||||
bool HIDDEN
|
||||
__sync_bool_compare_and_swap_4 (int *ptr, int oldval, int newval)
|
||||
{
|
||||
int failure = __kernel_cmpxchg (oldval, newval, ptr);
|
||||
return (failure == 0);
|
||||
}
|
||||
|
||||
#define SUBWORD_BOOL_CAS(TYPE, WIDTH) \
|
||||
bool HIDDEN \
|
||||
__sync_bool_compare_and_swap_##WIDTH (TYPE *ptr, TYPE oldval, \
|
||||
TYPE newval) \
|
||||
{ \
|
||||
TYPE actual_oldval \
|
||||
= __sync_val_compare_and_swap_##WIDTH (ptr, oldval, newval); \
|
||||
return (oldval == actual_oldval); \
|
||||
}
|
||||
|
||||
SUBWORD_BOOL_CAS (unsigned short, 2)
|
||||
SUBWORD_BOOL_CAS (unsigned char, 1)
|
||||
|
||||
void HIDDEN
|
||||
__sync_synchronize (void)
|
||||
{
|
||||
__kernel_dmb ();
|
||||
}
|
||||
|
||||
int HIDDEN
|
||||
__sync_lock_test_and_set_4 (int *ptr, int val)
|
||||
{
|
||||
int failure, oldval;
|
||||
|
||||
do {
|
||||
oldval = *ptr;
|
||||
failure = __kernel_cmpxchg (oldval, val, ptr);
|
||||
} while (failure != 0);
|
||||
|
||||
return oldval;
|
||||
}
|
||||
|
||||
#define SUBWORD_TEST_AND_SET(TYPE, WIDTH) \
|
||||
TYPE HIDDEN \
|
||||
__sync_lock_test_and_set_##WIDTH (TYPE *ptr, TYPE val) \
|
||||
{ \
|
||||
int failure; \
|
||||
unsigned int oldval, newval, shift, mask; \
|
||||
int *wordptr = (int *) ((unsigned int) ptr & ~3); \
|
||||
\
|
||||
shift = (((unsigned int) ptr & 3) << 3) ^ INVERT_MASK_##WIDTH; \
|
||||
mask = MASK_##WIDTH << shift; \
|
||||
\
|
||||
do { \
|
||||
oldval = *wordptr; \
|
||||
newval = (oldval & ~mask) \
|
||||
| (((unsigned int) val << shift) & mask); \
|
||||
failure = __kernel_cmpxchg (oldval, newval, wordptr); \
|
||||
} while (failure != 0); \
|
||||
\
|
||||
return (oldval & mask) >> shift; \
|
||||
}
|
||||
|
||||
SUBWORD_TEST_AND_SET (unsigned short, 2)
|
||||
SUBWORD_TEST_AND_SET (unsigned char, 1)
|
||||
|
||||
#define SYNC_LOCK_RELEASE(TYPE, WIDTH) \
|
||||
void HIDDEN \
|
||||
__sync_lock_release_##WIDTH (TYPE *ptr) \
|
||||
{ \
|
||||
/* All writes before this point must be seen before we release \
|
||||
the lock itself. */ \
|
||||
__kernel_dmb (); \
|
||||
*ptr = 0; \
|
||||
}
|
||||
|
||||
SYNC_LOCK_RELEASE (long long, 8)
|
||||
SYNC_LOCK_RELEASE (int, 4)
|
||||
SYNC_LOCK_RELEASE (short, 2)
|
||||
SYNC_LOCK_RELEASE (char, 1)
|
|
@ -1,6 +1,12 @@
|
|||
# Add the bpabi.S functions.
|
||||
LIB1ASMFUNCS += _aeabi_lcmp _aeabi_ulcmp _aeabi_ldivmod _aeabi_uldivmod
|
||||
|
||||
# Add the BPABI C functions.
|
||||
LIB2ADD += $(srcdir)/config/arm/bpabi.c \
|
||||
$(srcdir)/config/arm/unaligned-funcs.c
|
||||
|
||||
LIB2ADD_ST += $(srcdir)/config/arm/fp16.c
|
||||
|
||||
LIB2ADDEH = $(srcdir)/config/arm/unwind-arm.c \
|
||||
$(srcdir)/config/arm/libunwind.S \
|
||||
$(srcdir)/config/arm/pr-support.c $(srcdir)/unwind-c.c
|
||||
|
|
|
@ -11,3 +11,8 @@ LIB1ASMFUNCS += _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func \
|
|||
_arm_cmpsf2 _arm_unordsf2 _arm_fixsfsi _arm_fixunssfsi \
|
||||
_arm_floatdidf _arm_floatdisf _arm_floatundidf _arm_floatundisf \
|
||||
_clzsi2 _clzdi2
|
||||
|
||||
# Currently there is a bug somewhere in GCC's alias analysis
|
||||
# or scheduling code that is breaking _fpmul_parts in fp-bit.c.
|
||||
# Disabling function inlining is a workaround for this problem.
|
||||
HOST_LIBGCC2_CFLAGS = -fno-inline
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
LIB1ASMSRC = arm/lib1funcs.S
|
||||
LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \
|
||||
_arm_addsubdf3 _arm_addsubsf3
|
||||
|
||||
# Just for these, we omit the frame pointer since it makes such a big
|
||||
# difference.
|
||||
HOST_LIBGCC2_CFLAGS += -fomit-frame-pointer
|
||||
|
|
|
@ -1,2 +1,5 @@
|
|||
# Use a version of div0 which raises SIGFPE, and a special __clear_cache.
|
||||
LIB1ASMFUNCS := $(filter-out _dvmd_tls,$(LIB1ASMFUNCS)) _dvmd_lnx _clear_cache
|
||||
|
||||
LIB2ADD_ST += $(srcdir)/config/arm/linux-atomic.c \
|
||||
$(srcdir)/config/arm/linux-atomic-64bit.c
|
||||
|
|
7
libgcc/config/arm/t-netbsd
Normal file
7
libgcc/config/arm/t-netbsd
Normal file
|
@ -0,0 +1,7 @@
|
|||
# Just for these, we omit the frame pointer since it makes such a big
|
||||
# difference. It is then pointless adding debugging.
|
||||
HOST_LIBGCC2_CFLAGS += -fomit-frame-pointer
|
||||
|
||||
LIBGCC2_DEBUG_CFLAGS = -g0
|
||||
|
||||
LIB2ADD += $(srcdir)/floatunsidf.c $(srcdir)/floatunsisf.c
|
|
@ -1 +1,6 @@
|
|||
LIB1ASMFUNCS += _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func _clzsi2 _clzdi2
|
||||
|
||||
# Currently there is a bug somewhere in GCC's alias analysis
|
||||
# or scheduling code that is breaking _fpmul_parts in fp-bit.c.
|
||||
# Disabling function inlining is a workaround for this problem.
|
||||
HOST_LIBGCC2_CFLAGS = -fno-inline
|
||||
|
|
|
@ -12,5 +12,8 @@ LIB1ASMFUNCS += \
|
|||
_truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
|
||||
_fixsfsi _fixunssfsi
|
||||
|
||||
# Include half-float helpers.
|
||||
LIB2ADD_ST += $(srcdir)/config/arm/fp16.c
|
||||
|
||||
# Include the gcc personality routine
|
||||
LIB2ADDEH = $(srcdir)/unwind-c.c $(srcdir)/config/arm/pr-support.c
|
||||
|
|
57
libgcc/config/arm/unaligned-funcs.c
Normal file
57
libgcc/config/arm/unaligned-funcs.c
Normal file
|
@ -0,0 +1,57 @@
|
|||
/* EABI unaligned read/write functions.
|
||||
|
||||
Copyright (C) 2005, 2009 Free Software Foundation, Inc.
|
||||
Contributed by CodeSourcery, LLC.
|
||||
|
||||
This file is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 3, or (at your option) any
|
||||
later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
int __aeabi_uread4 (void *);
|
||||
int __aeabi_uwrite4 (int, void *);
|
||||
long long __aeabi_uread8 (void *);
|
||||
long long __aeabi_uwrite8 (long long, void *);
|
||||
|
||||
struct __attribute__((packed)) u4 { int data; };
|
||||
struct __attribute__((packed)) u8 { long long data; };
|
||||
|
||||
int
|
||||
__aeabi_uread4 (void *ptr)
|
||||
{
|
||||
return ((struct u4 *) ptr)->data;
|
||||
}
|
||||
|
||||
int
|
||||
__aeabi_uwrite4 (int data, void *ptr)
|
||||
{
|
||||
((struct u4 *) ptr)->data = data;
|
||||
return data;
|
||||
}
|
||||
|
||||
long long
|
||||
__aeabi_uread8 (void *ptr)
|
||||
{
|
||||
return ((struct u8 *) ptr)->data;
|
||||
}
|
||||
|
||||
long long
|
||||
__aeabi_uwrite8 (long long data, void *ptr)
|
||||
{
|
||||
((struct u8 *) ptr)->data = data;
|
||||
return data;
|
||||
}
|
|
@ -46,6 +46,14 @@ LIB1ASMFUNCS = \
|
|||
_lshrdi3 \
|
||||
_fmul _fmuls _fmulsu
|
||||
|
||||
LIB2FUNCS_EXCLUDE = \
|
||||
_clz
|
||||
|
||||
# We do not have the DF type.
|
||||
# Most of the C functions in libgcc2 use almost all registers,
|
||||
# so use -mcall-prologues for smaller code size.
|
||||
HOST_LIBGCC2_CFLAGS = -DDF=SF -Dinhibit_libc -mcall-prologues -Os
|
||||
|
||||
# Extra 16-bit integer functions.
|
||||
intfuncs16 = _absvXX2 _addvXX3 _subvXX3 _mulvXX3 _negvXX2 _clrsbXX2
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
CRTSTUFF_T_CFLAGS = -fpic
|
||||
CRTSTUFF_T_CFLAGS = $(PICFLAG)
|
||||
|
|
1
libgcc/config/bfin/t-elf
Normal file
1
libgcc/config/bfin/t-elf
Normal file
|
@ -0,0 +1 @@
|
|||
HOST_LIBGCC2_CFLAGS = $(PICFLAG)
|
47
libgcc/config/c6x/eqd.c
Normal file
47
libgcc/config/c6x/eqd.c
Normal file
|
@ -0,0 +1,47 @@
|
|||
/* Software floating-point emulation.
|
||||
Return 1 iff a == b, 0 otherwise.
|
||||
Copyright (C) 1997,1999,2006,2007,2011 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson (rth@cygnus.com) and
|
||||
Jakub Jelinek (jj@ultra.linux.cz).
|
||||
|
||||
This file is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
In addition to the permissions in the GNU Lesser General Public
|
||||
License, the Free Software Foundation gives you unlimited
|
||||
permission to link the compiled version of this file into
|
||||
combinations with other programs, and to distribute those
|
||||
combinations without any restriction coming from the use of this
|
||||
file. (The Lesser General Public License restrictions do apply in
|
||||
other respects; for example, they cover modification of the file,
|
||||
and distribution when not linked into a combine executable.)
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with GCC; see the file COPYING.LIB. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <soft-fp/soft-fp.h>
|
||||
#include <soft-fp/double.h>
|
||||
|
||||
CMPtype __c6xabi_eqd(DFtype a, DFtype b)
|
||||
{
|
||||
FP_DECL_EX;
|
||||
FP_DECL_D(A); FP_DECL_D(B);
|
||||
CMPtype r;
|
||||
|
||||
FP_UNPACK_RAW_D(A, a);
|
||||
FP_UNPACK_RAW_D(B, b);
|
||||
FP_CMP_EQ_D(r, A, B);
|
||||
if (r && (FP_ISSIGNAN_D(A) || FP_ISSIGNAN_D(B)))
|
||||
FP_SET_EXCEPTION(FP_EX_INVALID);
|
||||
FP_HANDLE_EXCEPTIONS;
|
||||
|
||||
return !r;
|
||||
}
|
47
libgcc/config/c6x/eqf.c
Normal file
47
libgcc/config/c6x/eqf.c
Normal file
|
@ -0,0 +1,47 @@
|
|||
/* Software floating-point emulation.
|
||||
Return 1 iff a == b, 0 otherwise.
|
||||
Copyright (C) 1997,1999,2006,2007,2011 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson (rth@cygnus.com) and
|
||||
Jakub Jelinek (jj@ultra.linux.cz).
|
||||
|
||||
This file is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
In addition to the permissions in the GNU Lesser General Public
|
||||
License, the Free Software Foundation gives you unlimited
|
||||
permission to link the compiled version of this file into
|
||||
combinations with other programs, and to distribute those
|
||||
combinations without any restriction coming from the use of this
|
||||
file. (The Lesser General Public License restrictions do apply in
|
||||
other respects; for example, they cover modification of the file,
|
||||
and distribution when not linked into a combine executable.)
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with GCC; see the file COPYING.LIB. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <soft-fp/soft-fp.h>
|
||||
#include <soft-fp/single.h>
|
||||
|
||||
CMPtype __c6xabi_eqf(SFtype a, SFtype b)
|
||||
{
|
||||
FP_DECL_EX;
|
||||
FP_DECL_S(A); FP_DECL_S(B);
|
||||
CMPtype r;
|
||||
|
||||
FP_UNPACK_RAW_S(A, a);
|
||||
FP_UNPACK_RAW_S(B, b);
|
||||
FP_CMP_EQ_S(r, A, B);
|
||||
if (r && (FP_ISSIGNAN_S(A) || FP_ISSIGNAN_S(B)))
|
||||
FP_SET_EXCEPTION(FP_EX_INVALID);
|
||||
FP_HANDLE_EXCEPTIONS;
|
||||
|
||||
return !r;
|
||||
}
|
47
libgcc/config/c6x/ged.c
Normal file
47
libgcc/config/c6x/ged.c
Normal file
|
@ -0,0 +1,47 @@
|
|||
/* Software floating-point emulation.
|
||||
Return 1 iff a >= b, 0 otherwise.
|
||||
Copyright (C) 1997,1999,2006,2007,2011 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson (rth@cygnus.com) and
|
||||
Jakub Jelinek (jj@ultra.linux.cz).
|
||||
|
||||
This file is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
In addition to the permissions in the GNU Lesser General Public
|
||||
License, the Free Software Foundation gives you unlimited
|
||||
permission to link the compiled version of this file into
|
||||
combinations with other programs, and to distribute those
|
||||
combinations without any restriction coming from the use of this
|
||||
file. (The Lesser General Public License restrictions do apply in
|
||||
other respects; for example, they cover modification of the file,
|
||||
and distribution when not linked into a combine executable.)
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with GCC; see the file COPYING.LIB. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <soft-fp/soft-fp.h>
|
||||
#include <soft-fp/double.h>
|
||||
|
||||
CMPtype __c6xabi_ged(DFtype a, DFtype b)
|
||||
{
|
||||
FP_DECL_EX;
|
||||
FP_DECL_D(A); FP_DECL_D(B);
|
||||
CMPtype r;
|
||||
|
||||
FP_UNPACK_RAW_D(A, a);
|
||||
FP_UNPACK_RAW_D(B, b);
|
||||
FP_CMP_D(r, A, B, -2);
|
||||
if (r == -2 && (FP_ISSIGNAN_D(A) || FP_ISSIGNAN_D(B)))
|
||||
FP_SET_EXCEPTION(FP_EX_INVALID);
|
||||
FP_HANDLE_EXCEPTIONS;
|
||||
|
||||
return r >= 0;
|
||||
}
|
47
libgcc/config/c6x/gef.c
Normal file
47
libgcc/config/c6x/gef.c
Normal file
|
@ -0,0 +1,47 @@
|
|||
/* Software floating-point emulation.
|
||||
Return 1 iff a >= b, 0 otherwise.
|
||||
Copyright (C) 1997,1999,2006,2007 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson (rth@cygnus.com) and
|
||||
Jakub Jelinek (jj@ultra.linux.cz).
|
||||
|
||||
This file is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
In addition to the permissions in the GNU Lesser General Public
|
||||
License, the Free Software Foundation gives you unlimited
|
||||
permission to link the compiled version of this file into
|
||||
combinations with other programs, and to distribute those
|
||||
combinations without any restriction coming from the use of this
|
||||
file. (The Lesser General Public License restrictions do apply in
|
||||
other respects; for example, they cover modification of the file,
|
||||
and distribution when not linked into a combine executable.)
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with GCC; see the file COPYING.LIB. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <soft-fp/soft-fp.h>
|
||||
#include <soft-fp/single.h>
|
||||
|
||||
CMPtype __c6xabi_gef(SFtype a, SFtype b)
|
||||
{
|
||||
FP_DECL_EX;
|
||||
FP_DECL_S(A); FP_DECL_S(B);
|
||||
CMPtype r;
|
||||
|
||||
FP_UNPACK_RAW_S(A, a);
|
||||
FP_UNPACK_RAW_S(B, b);
|
||||
FP_CMP_S(r, A, B, -2);
|
||||
if (r == -2 && (FP_ISSIGNAN_S(A) || FP_ISSIGNAN_S(B)))
|
||||
FP_SET_EXCEPTION(FP_EX_INVALID);
|
||||
FP_HANDLE_EXCEPTIONS;
|
||||
|
||||
return r >= 0;
|
||||
}
|
47
libgcc/config/c6x/gtd.c
Normal file
47
libgcc/config/c6x/gtd.c
Normal file
|
@ -0,0 +1,47 @@
|
|||
/* Software floating-point emulation.
|
||||
Return 1 iff a > b, 0 otherwise.
|
||||
Copyright (C) 1997,1999,2006,2007,2011 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson (rth@cygnus.com) and
|
||||
Jakub Jelinek (jj@ultra.linux.cz).
|
||||
|
||||
This file is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
In addition to the permissions in the GNU Lesser General Public
|
||||
License, the Free Software Foundation gives you unlimited
|
||||
permission to link the compiled version of this file into
|
||||
combinations with other programs, and to distribute those
|
||||
combinations without any restriction coming from the use of this
|
||||
file. (The Lesser General Public License restrictions do apply in
|
||||
other respects; for example, they cover modification of the file,
|
||||
and distribution when not linked into a combine executable.)
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with GCC; see the file COPYING.LIB. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <soft-fp/soft-fp.h>
|
||||
#include <soft-fp/double.h>
|
||||
|
||||
CMPtype __c6xabi_gtd(DFtype a, DFtype b)
|
||||
{
|
||||
FP_DECL_EX;
|
||||
FP_DECL_D(A); FP_DECL_D(B);
|
||||
CMPtype r;
|
||||
|
||||
FP_UNPACK_RAW_D(A, a);
|
||||
FP_UNPACK_RAW_D(B, b);
|
||||
FP_CMP_D(r, A, B, -2);
|
||||
if (r == -2 && (FP_ISSIGNAN_D(A) || FP_ISSIGNAN_D(B)))
|
||||
FP_SET_EXCEPTION(FP_EX_INVALID);
|
||||
FP_HANDLE_EXCEPTIONS;
|
||||
|
||||
return r > 0;
|
||||
}
|
47
libgcc/config/c6x/gtf.c
Normal file
47
libgcc/config/c6x/gtf.c
Normal file
|
@ -0,0 +1,47 @@
|
|||
/* Software floating-point emulation.
|
||||
Return 1 iff a > b, 0 otherwise.
|
||||
Copyright (C) 1997,1999,2006,2007,2011 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson (rth@cygnus.com) and
|
||||
Jakub Jelinek (jj@ultra.linux.cz).
|
||||
|
||||
This file is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
In addition to the permissions in the GNU Lesser General Public
|
||||
License, the Free Software Foundation gives you unlimited
|
||||
permission to link the compiled version of this file into
|
||||
combinations with other programs, and to distribute those
|
||||
combinations without any restriction coming from the use of this
|
||||
file. (The Lesser General Public License restrictions do apply in
|
||||
other respects; for example, they cover modification of the file,
|
||||
and distribution when not linked into a combine executable.)
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with GCC; see the file COPYING.LIB. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <soft-fp/soft-fp.h>
|
||||
#include <soft-fp/single.h>
|
||||
|
||||
CMPtype __c6xabi_gtf(SFtype a, SFtype b)
|
||||
{
|
||||
FP_DECL_EX;
|
||||
FP_DECL_S(A); FP_DECL_S(B);
|
||||
CMPtype r;
|
||||
|
||||
FP_UNPACK_RAW_S(A, a);
|
||||
FP_UNPACK_RAW_S(B, b);
|
||||
FP_CMP_S(r, A, B, -2);
|
||||
if (r == -2 && (FP_ISSIGNAN_S(A) || FP_ISSIGNAN_S(B)))
|
||||
FP_SET_EXCEPTION(FP_EX_INVALID);
|
||||
FP_HANDLE_EXCEPTIONS;
|
||||
|
||||
return r > 0;
|
||||
}
|
47
libgcc/config/c6x/led.c
Normal file
47
libgcc/config/c6x/led.c
Normal file
|
@ -0,0 +1,47 @@
|
|||
/* Software floating-point emulation.
|
||||
Return 1 iff a <= b, 0 otherwise.
|
||||
Copyright (C) 1997,1999,2006,2007,2011 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson (rth@cygnus.com) and
|
||||
Jakub Jelinek (jj@ultra.linux.cz).
|
||||
|
||||
This file is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
In addition to the permissions in the GNU Lesser General Public
|
||||
License, the Free Software Foundation gives you unlimited
|
||||
permission to link the compiled version of this file into
|
||||
combinations with other programs, and to distribute those
|
||||
combinations without any restriction coming from the use of this
|
||||
file. (The Lesser General Public License restrictions do apply in
|
||||
other respects; for example, they cover modification of the file,
|
||||
and distribution when not linked into a combine executable.)
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with GCC; see the file COPYING.LIB. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <soft-fp/soft-fp.h>
|
||||
#include <soft-fp/double.h>
|
||||
|
||||
CMPtype __c6xabi_led(DFtype a, DFtype b)
|
||||
{
|
||||
FP_DECL_EX;
|
||||
FP_DECL_D(A); FP_DECL_D(B);
|
||||
CMPtype r;
|
||||
|
||||
FP_UNPACK_RAW_D(A, a);
|
||||
FP_UNPACK_RAW_D(B, b);
|
||||
FP_CMP_D(r, A, B, 2);
|
||||
if (r == 2 && (FP_ISSIGNAN_D(A) || FP_ISSIGNAN_D(B)))
|
||||
FP_SET_EXCEPTION(FP_EX_INVALID);
|
||||
FP_HANDLE_EXCEPTIONS;
|
||||
|
||||
return r <= 0;
|
||||
}
|
47
libgcc/config/c6x/lef.c
Normal file
47
libgcc/config/c6x/lef.c
Normal file
|
@ -0,0 +1,47 @@
|
|||
/* Software floating-point emulation.
|
||||
Return 1 iff a <= b, 0 otherwise.
|
||||
Copyright (C) 1997,1999,2006,2007,2011 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson (rth@cygnus.com) and
|
||||
Jakub Jelinek (jj@ultra.linux.cz).
|
||||
|
||||
This file is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
In addition to the permissions in the GNU Lesser General Public
|
||||
License, the Free Software Foundation gives you unlimited
|
||||
permission to link the compiled version of this file into
|
||||
combinations with other programs, and to distribute those
|
||||
combinations without any restriction coming from the use of this
|
||||
file. (The Lesser General Public License restrictions do apply in
|
||||
other respects; for example, they cover modification of the file,
|
||||
and distribution when not linked into a combine executable.)
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with GCC; see the file COPYING.LIB. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <soft-fp/soft-fp.h>
|
||||
#include <soft-fp/single.h>
|
||||
|
||||
CMPtype __c6xabi_lef(SFtype a, SFtype b)
|
||||
{
|
||||
FP_DECL_EX;
|
||||
FP_DECL_S(A); FP_DECL_S(B);
|
||||
CMPtype r;
|
||||
|
||||
FP_UNPACK_RAW_S(A, a);
|
||||
FP_UNPACK_RAW_S(B, b);
|
||||
FP_CMP_S(r, A, B, 2);
|
||||
if (r == 2 && (FP_ISSIGNAN_S(A) || FP_ISSIGNAN_S(B)))
|
||||
FP_SET_EXCEPTION(FP_EX_INVALID);
|
||||
FP_HANDLE_EXCEPTIONS;
|
||||
|
||||
return r <= 0;
|
||||
}
|
47
libgcc/config/c6x/ltd.c
Normal file
47
libgcc/config/c6x/ltd.c
Normal file
|
@ -0,0 +1,47 @@
|
|||
/* Software floating-point emulation.
|
||||
Return 1 iff a < b, 0 otherwise.
|
||||
Copyright (C) 1997,1999,2006,2007,2011 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson (rth@cygnus.com) and
|
||||
Jakub Jelinek (jj@ultra.linux.cz).
|
||||
|
||||
This file is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
In addition to the permissions in the GNU Lesser General Public
|
||||
License, the Free Software Foundation gives you unlimited
|
||||
permission to link the compiled version of this file into
|
||||
combinations with other programs, and to distribute those
|
||||
combinations without any restriction coming from the use of this
|
||||
file. (The Lesser General Public License restrictions do apply in
|
||||
other respects; for example, they cover modification of the file,
|
||||
and distribution when not linked into a combine executable.)
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with GCC; see the file COPYING.LIB. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <soft-fp/soft-fp.h>
|
||||
#include <soft-fp/double.h>
|
||||
|
||||
CMPtype __c6xabi_ltd(DFtype a, DFtype b)
|
||||
{
|
||||
FP_DECL_EX;
|
||||
FP_DECL_D(A); FP_DECL_D(B);
|
||||
CMPtype r;
|
||||
|
||||
FP_UNPACK_RAW_D(A, a);
|
||||
FP_UNPACK_RAW_D(B, b);
|
||||
FP_CMP_D(r, A, B, 2);
|
||||
if (r == 2 && (FP_ISSIGNAN_D(A) || FP_ISSIGNAN_D(B)))
|
||||
FP_SET_EXCEPTION(FP_EX_INVALID);
|
||||
FP_HANDLE_EXCEPTIONS;
|
||||
|
||||
return r < 0;
|
||||
}
|
47
libgcc/config/c6x/ltf.c
Normal file
47
libgcc/config/c6x/ltf.c
Normal file
|
@ -0,0 +1,47 @@
|
|||
/* Software floating-point emulation.
|
||||
Return 1 iff a < b, 0 otherwise.
|
||||
Copyright (C) 1997,1999,2006,2007,2011 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson (rth@cygnus.com) and
|
||||
Jakub Jelinek (jj@ultra.linux.cz).
|
||||
|
||||
This file is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
In addition to the permissions in the GNU Lesser General Public
|
||||
License, the Free Software Foundation gives you unlimited
|
||||
permission to link the compiled version of this file into
|
||||
combinations with other programs, and to distribute those
|
||||
combinations without any restriction coming from the use of this
|
||||
file. (The Lesser General Public License restrictions do apply in
|
||||
other respects; for example, they cover modification of the file,
|
||||
and distribution when not linked into a combine executable.)
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with GCC; see the file COPYING.LIB. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <soft-fp/soft-fp.h>
|
||||
#include <soft-fp/single.h>
|
||||
|
||||
CMPtype __c6xabi_ltf(SFtype a, SFtype b)
|
||||
{
|
||||
FP_DECL_EX;
|
||||
FP_DECL_S(A); FP_DECL_S(B);
|
||||
CMPtype r;
|
||||
|
||||
FP_UNPACK_RAW_S(A, a);
|
||||
FP_UNPACK_RAW_S(B, b);
|
||||
FP_CMP_S(r, A, B, 2);
|
||||
if (r == 2 && (FP_ISSIGNAN_S(A) || FP_ISSIGNAN_S(B)))
|
||||
FP_SET_EXCEPTION(FP_EX_INVALID);
|
||||
FP_HANDLE_EXCEPTIONS;
|
||||
|
||||
return r < 0;
|
||||
}
|
|
@ -6,6 +6,22 @@ LIB1ASMFUNCS = _divsi3 _udivsi3 _umodsi3 _modsi3 _udivmodsi4 _divmodsi4
|
|||
LIB1ASMFUNCS += _strasgi _strasgi_64plus _clzsi2 _clzdi2 _clz
|
||||
LIB1ASMFUNCS += _push_rts _pop_rts _call_stub
|
||||
|
||||
LIB2FUNCS_EXCLUDE = _cmpdi2 _ucmpdi2 _gcc_bcmp _eprintf _clzsi _clzdi
|
||||
|
||||
LIB2ADD = $(srcdir)/config/c6x/gef.c \
|
||||
$(srcdir)/config/c6x/gtf.c \
|
||||
$(srcdir)/config/c6x/lef.c \
|
||||
$(srcdir)/config/c6x/ltf.c \
|
||||
$(srcdir)/config/c6x/eqf.c \
|
||||
$(srcdir)/config/c6x/ged.c \
|
||||
$(srcdir)/config/c6x/gtd.c \
|
||||
$(srcdir)/config/c6x/led.c \
|
||||
$(srcdir)/config/c6x/ltd.c \
|
||||
$(srcdir)/config/c6x/eqd.c
|
||||
|
||||
# Avoid failures when the user's GOT becomes too large.
|
||||
HOST_LIBGCC2_CFLAGS = -msdata=none
|
||||
|
||||
# Assemble startup files.
|
||||
crti.o: $(srcdir)/config/c6x/crti.S
|
||||
$(crt_compile) -c $(CRTSTUFF_T_CFLAGS) $<
|
||||
|
|
|
@ -1 +1,3 @@
|
|||
CRTSTUFF_T_CFLAGS += -fPIC
|
||||
HOST_LIBGCC2_CFLAGS += -msdata=none
|
||||
|
||||
CRTSTUFF_T_CFLAGS += $(PICFLAG)
|
||||
|
|
304
libgcc/config/cris/arit.c
Normal file
304
libgcc/config/cris/arit.c
Normal file
|
@ -0,0 +1,304 @@
|
|||
/* Signed and unsigned multiplication and division and modulus for CRIS.
|
||||
Contributed by Axis Communications.
|
||||
Written by Hans-Peter Nilsson <hp@axis.se>, c:a 1992.
|
||||
|
||||
Copyright (C) 1998, 1999, 2000, 2001, 2002,
|
||||
2005, 2009 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 3, or (at your option) any
|
||||
later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
|
||||
/* Note that we provide prototypes for all "const" functions, to attach
|
||||
the const attribute. This is necessary in 2.7.2 - adding the
|
||||
attribute to the function *definition* is a syntax error.
|
||||
This did not work with e.g. 2.1; back then, the return type had to
|
||||
be "const". */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#if defined (__CRIS_arch_version) && __CRIS_arch_version >= 3
|
||||
#define LZ(v) __builtin_clz (v)
|
||||
#endif
|
||||
|
||||
|
||||
#if defined (L_udivsi3) || defined (L_divsi3) || defined (L_umodsi3) \
|
||||
|| defined (L_modsi3)
|
||||
/* Result type of divmod worker function. */
|
||||
struct quot_rem
|
||||
{
|
||||
long quot;
|
||||
long rem;
|
||||
};
|
||||
|
||||
/* This is the worker function for div and mod. It is inlined into the
|
||||
respective library function. Parameter A must have bit 31 == 0. */
|
||||
|
||||
static __inline__ struct quot_rem
|
||||
do_31div (unsigned long a, unsigned long b)
|
||||
__attribute__ ((__const__, __always_inline__));
|
||||
|
||||
static __inline__ struct quot_rem
|
||||
do_31div (unsigned long a, unsigned long b)
|
||||
{
|
||||
/* Adjust operands and result if a is 31 bits. */
|
||||
long extra = 0;
|
||||
int quot_digits = 0;
|
||||
|
||||
if (b == 0)
|
||||
{
|
||||
struct quot_rem ret;
|
||||
ret.quot = 0xffffffff;
|
||||
ret.rem = 0xffffffff;
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (a < b)
|
||||
return (struct quot_rem) { 0, a };
|
||||
|
||||
#ifdef LZ
|
||||
if (b <= a)
|
||||
{
|
||||
quot_digits = LZ (b) - LZ (a);
|
||||
quot_digits += (a >= (b << quot_digits));
|
||||
b <<= quot_digits;
|
||||
}
|
||||
#else
|
||||
while (b <= a)
|
||||
{
|
||||
b <<= 1;
|
||||
quot_digits++;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Is a 31 bits? Note that bit 31 is handled by the caller. */
|
||||
if (a & 0x40000000)
|
||||
{
|
||||
/* Then make b:s highest bit max 0x40000000, because it must have
|
||||
been 0x80000000 to be 1 bit higher than a. */
|
||||
b >>= 1;
|
||||
|
||||
/* Adjust a to be maximum 0x3fffffff, i.e. two upper bits zero. */
|
||||
if (a >= b)
|
||||
{
|
||||
a -= b;
|
||||
extra = 1 << (quot_digits - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
a -= b >> 1;
|
||||
|
||||
/* Remember that we adjusted a by subtracting b * 2 ** Something. */
|
||||
extra = 1 << quot_digits;
|
||||
}
|
||||
|
||||
/* The number of quotient digits will be one less, because
|
||||
we just adjusted b. */
|
||||
quot_digits--;
|
||||
}
|
||||
|
||||
/* Now do the division part. */
|
||||
|
||||
/* Subtract b and add ones to the right when a >= b
|
||||
i.e. "a - (b - 1) == (a - b) + 1". */
|
||||
b--;
|
||||
|
||||
#define DS __asm__ ("dstep %2,%0" : "=r" (a) : "0" (a), "r" (b))
|
||||
|
||||
switch (quot_digits)
|
||||
{
|
||||
case 32: DS; case 31: DS; case 30: DS; case 29: DS;
|
||||
case 28: DS; case 27: DS; case 26: DS; case 25: DS;
|
||||
case 24: DS; case 23: DS; case 22: DS; case 21: DS;
|
||||
case 20: DS; case 19: DS; case 18: DS; case 17: DS;
|
||||
case 16: DS; case 15: DS; case 14: DS; case 13: DS;
|
||||
case 12: DS; case 11: DS; case 10: DS; case 9: DS;
|
||||
case 8: DS; case 7: DS; case 6: DS; case 5: DS;
|
||||
case 4: DS; case 3: DS; case 2: DS; case 1: DS;
|
||||
case 0:;
|
||||
}
|
||||
|
||||
{
|
||||
struct quot_rem ret;
|
||||
ret.quot = (a & ((1 << quot_digits) - 1)) + extra;
|
||||
ret.rem = a >> quot_digits;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef L_udivsi3
|
||||
unsigned long
|
||||
__Udiv (unsigned long a, unsigned long b) __attribute__ ((__const__));
|
||||
|
||||
unsigned long
|
||||
__Udiv (unsigned long a, unsigned long b)
|
||||
{
|
||||
long extra = 0;
|
||||
|
||||
/* Adjust operands and result, if a and/or b is 32 bits. */
|
||||
/* Effectively: b & 0x80000000. */
|
||||
if ((long) b < 0)
|
||||
return a >= b;
|
||||
|
||||
/* Effectively: a & 0x80000000. */
|
||||
if ((long) a < 0)
|
||||
{
|
||||
int tmp = 0;
|
||||
|
||||
if (b == 0)
|
||||
return 0xffffffff;
|
||||
#ifdef LZ
|
||||
tmp = LZ (b);
|
||||
#else
|
||||
for (tmp = 31; (((long) b & (1 << tmp)) == 0); tmp--)
|
||||
;
|
||||
|
||||
tmp = 31 - tmp;
|
||||
#endif
|
||||
|
||||
if ((b << tmp) > a)
|
||||
{
|
||||
extra = 1 << (tmp-1);
|
||||
a -= b << (tmp - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
extra = 1 << tmp;
|
||||
a -= b << tmp;
|
||||
}
|
||||
}
|
||||
|
||||
return do_31div (a, b).quot+extra;
|
||||
}
|
||||
#endif /* L_udivsi3 */
|
||||
|
||||
#ifdef L_divsi3
|
||||
long
|
||||
__Div (long a, long b) __attribute__ ((__const__));
|
||||
|
||||
long
|
||||
__Div (long a, long b)
|
||||
{
|
||||
long extra = 0;
|
||||
long sign = (b < 0) ? -1 : 1;
|
||||
|
||||
/* We need to handle a == -2147483648 as expected and must while
|
||||
doing that avoid producing a sequence like "abs (a) < 0" as GCC
|
||||
may optimize out the test. That sequence may not be obvious as
|
||||
we call inline functions. Testing for a being negative and
|
||||
handling (presumably much rarer than positive) enables us to get
|
||||
a bit of optimization for an (accumulated) reduction of the
|
||||
penalty of the 0x80000000 special-case. */
|
||||
if (a < 0)
|
||||
{
|
||||
sign = -sign;
|
||||
|
||||
if ((a & 0x7fffffff) == 0)
|
||||
{
|
||||
/* We're at 0x80000000. Tread carefully. */
|
||||
a -= b * sign;
|
||||
extra = sign;
|
||||
}
|
||||
a = -a;
|
||||
}
|
||||
|
||||
/* We knowingly penalize pre-v10 models by multiplication with the
|
||||
sign. */
|
||||
return sign * do_31div (a, __builtin_labs (b)).quot + extra;
|
||||
}
|
||||
#endif /* L_divsi3 */
|
||||
|
||||
|
||||
#ifdef L_umodsi3
|
||||
unsigned long
|
||||
__Umod (unsigned long a, unsigned long b) __attribute__ ((__const__));
|
||||
|
||||
unsigned long
|
||||
__Umod (unsigned long a, unsigned long b)
|
||||
{
|
||||
/* Adjust operands and result if a and/or b is 32 bits. */
|
||||
if ((long) b < 0)
|
||||
return a >= b ? a - b : a;
|
||||
|
||||
if ((long) a < 0)
|
||||
{
|
||||
int tmp = 0;
|
||||
|
||||
if (b == 0)
|
||||
return a;
|
||||
#ifdef LZ
|
||||
tmp = LZ (b);
|
||||
#else
|
||||
for (tmp = 31; (((long) b & (1 << tmp)) == 0); tmp--)
|
||||
;
|
||||
tmp = 31 - tmp;
|
||||
#endif
|
||||
|
||||
if ((b << tmp) > a)
|
||||
{
|
||||
a -= b << (tmp - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
a -= b << tmp;
|
||||
}
|
||||
}
|
||||
|
||||
return do_31div (a, b).rem;
|
||||
}
|
||||
#endif /* L_umodsi3 */
|
||||
|
||||
#ifdef L_modsi3
|
||||
long
|
||||
__Mod (long a, long b) __attribute__ ((__const__));
|
||||
|
||||
long
|
||||
__Mod (long a, long b)
|
||||
{
|
||||
long sign = 1;
|
||||
|
||||
/* We need to handle a == -2147483648 as expected and must while
|
||||
doing that avoid producing a sequence like "abs (a) < 0" as GCC
|
||||
may optimize out the test. That sequence may not be obvious as
|
||||
we call inline functions. Testing for a being negative and
|
||||
handling (presumably much rarer than positive) enables us to get
|
||||
a bit of optimization for an (accumulated) reduction of the
|
||||
penalty of the 0x80000000 special-case. */
|
||||
if (a < 0)
|
||||
{
|
||||
sign = -1;
|
||||
if ((a & 0x7fffffff) == 0)
|
||||
/* We're at 0x80000000. Tread carefully. */
|
||||
a += __builtin_labs (b);
|
||||
a = -a;
|
||||
}
|
||||
|
||||
return sign * do_31div (a, __builtin_labs (b)).rem;
|
||||
}
|
||||
#endif /* L_modsi3 */
|
||||
#endif /* L_udivsi3 || L_divsi3 || L_umodsi3 || L_modsi3 */
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* eval: (c-set-style "gnu")
|
||||
* indent-tabs-mode: t
|
||||
* End:
|
||||
*/
|
255
libgcc/config/cris/mulsi3.S
Normal file
255
libgcc/config/cris/mulsi3.S
Normal file
|
@ -0,0 +1,255 @@
|
|||
;; Copyright (C) 2001, 2004 Free Software Foundation, Inc.
|
||||
;;
|
||||
;; This file is part of GCC.
|
||||
;;
|
||||
;; GCC is free software; you can redistribute it and/or modify it under
|
||||
;; the terms of the GNU General Public License as published by the Free
|
||||
;; Software Foundation; either version 3, or (at your option) any later
|
||||
;; version.
|
||||
;;
|
||||
;; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
;; WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
;; for more details.
|
||||
;;
|
||||
;; Under Section 7 of GPL version 3, you are granted additional
|
||||
;; permissions described in the GCC Runtime Library Exception, version
|
||||
;; 3.1, as published by the Free Software Foundation.
|
||||
;;
|
||||
;; You should have received a copy of the GNU General Public License and
|
||||
;; a copy of the GCC Runtime Library Exception along with this program;
|
||||
;; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
;; <http://www.gnu.org/licenses/>.
|
||||
;;
|
||||
;; This code used to be expanded through interesting expansions in
|
||||
;; the machine description, compiled from this code:
|
||||
;;
|
||||
;; #ifdef L_mulsi3
|
||||
;; long __Mul (unsigned long a, unsigned long b) __attribute__ ((__const__));
|
||||
;;
|
||||
;; /* This must be compiled with the -mexpand-mul flag, to synthesize the
|
||||
;; multiplication from the mstep instructions. The check for
|
||||
;; smaller-size multiplication pays off in the order of .5-10%;
|
||||
;; estimated median 1%, depending on application.
|
||||
;; FIXME: It can be further optimized if we go to assembler code, as
|
||||
;; gcc 2.7.2 adds a few unnecessary instructions and does not put the
|
||||
;; basic blocks in optimal order. */
|
||||
;; long
|
||||
;; __Mul (unsigned long a, unsigned long b)
|
||||
;; {
|
||||
;; #if defined (__CRIS_arch_version) && __CRIS_arch_version >= 10
|
||||
;; /* In case other code is compiled without -march=v10, they will
|
||||
;; contain calls to __Mul, regardless of flags at link-time. The
|
||||
;; "else"-code below will work, but is unnecessarily slow. This
|
||||
;; sometimes cuts a few minutes off from simulation time by just
|
||||
;; returning a "mulu.d". */
|
||||
;; return a * b;
|
||||
;; #else
|
||||
;; unsigned long min;
|
||||
;;
|
||||
;; /* Get minimum via the bound insn. */
|
||||
;; min = a < b ? a : b;
|
||||
;;
|
||||
;; /* Can we omit computation of the high part? */
|
||||
;; if (min > 65535)
|
||||
;; /* No. Perform full multiplication. */
|
||||
;; return a * b;
|
||||
;; else
|
||||
;; {
|
||||
;; /* Check if both operands are within 16 bits. */
|
||||
;; unsigned long max;
|
||||
;;
|
||||
;; /* Get maximum, by knowing the minimum.
|
||||
;; This will partition a and b into max and min.
|
||||
;; This is not currently something GCC understands,
|
||||
;; so do this trick by asm. */
|
||||
;; __asm__ ("xor %1,%0\n\txor %2,%0"
|
||||
;; : "=r" (max)
|
||||
;; : "r" (b), "r" (a), "0" (min));
|
||||
;;
|
||||
;; if (max > 65535)
|
||||
;; /* Make GCC understand that only the low part of "min" will be
|
||||
;; used. */
|
||||
;; return max * (unsigned short) min;
|
||||
;; else
|
||||
;; /* Only the low parts of both operands are necessary. */
|
||||
;; return ((unsigned short) max) * (unsigned short) min;
|
||||
;; }
|
||||
;; #endif /* not __CRIS_arch_version >= 10 */
|
||||
;; }
|
||||
;; #endif /* L_mulsi3 */
|
||||
;;
|
||||
;; That approach was abandoned since the caveats outweighted the
|
||||
;; benefits. The expand-multiplication machinery is also removed, so you
|
||||
;; can't do this anymore.
|
||||
;;
|
||||
;; For doubters of there being any benefits, some where: insensitivity to:
|
||||
;; - ABI changes (mostly for experimentation)
|
||||
;; - assembler syntax differences (mostly debug format).
|
||||
;; - insn scheduling issues.
|
||||
;; Most ABI experiments will presumably happen with arches with mul insns,
|
||||
;; so that argument doesn't really hold anymore, and it's unlikely there
|
||||
;; being new arch variants needing insn scheduling and not having mul
|
||||
;; insns.
|
||||
|
||||
;; ELF and a.out have different syntax for local labels: the "wrong"
|
||||
;; one may not be omitted from the object.
|
||||
#undef L
|
||||
#ifdef __AOUT__
|
||||
# define L(x) x
|
||||
#else
|
||||
# define L(x) .x
|
||||
#endif
|
||||
|
||||
.global ___Mul
|
||||
.type ___Mul,@function
|
||||
___Mul:
|
||||
#if defined (__CRIS_arch_version) && __CRIS_arch_version >= 10
|
||||
;; Can't have the mulu.d last on a cache-line (in the delay-slot of the
|
||||
;; "ret"), due to hardware bug. See documentation for -mmul-bug-workaround.
|
||||
;; Not worthwhile to conditionalize here.
|
||||
.p2alignw 2,0x050f
|
||||
mulu.d $r11,$r10
|
||||
ret
|
||||
nop
|
||||
#else
|
||||
move.d $r10,$r12
|
||||
move.d $r11,$r9
|
||||
bound.d $r12,$r9
|
||||
cmpu.w 65535,$r9
|
||||
bls L(L3)
|
||||
move.d $r12,$r13
|
||||
|
||||
movu.w $r11,$r9
|
||||
lslq 16,$r13
|
||||
mstep $r9,$r13
|
||||
mstep $r9,$r13
|
||||
mstep $r9,$r13
|
||||
mstep $r9,$r13
|
||||
mstep $r9,$r13
|
||||
mstep $r9,$r13
|
||||
mstep $r9,$r13
|
||||
mstep $r9,$r13
|
||||
mstep $r9,$r13
|
||||
mstep $r9,$r13
|
||||
mstep $r9,$r13
|
||||
mstep $r9,$r13
|
||||
mstep $r9,$r13
|
||||
mstep $r9,$r13
|
||||
mstep $r9,$r13
|
||||
mstep $r9,$r13
|
||||
clear.w $r10
|
||||
test.d $r10
|
||||
mstep $r9,$r10
|
||||
mstep $r9,$r10
|
||||
mstep $r9,$r10
|
||||
mstep $r9,$r10
|
||||
mstep $r9,$r10
|
||||
mstep $r9,$r10
|
||||
mstep $r9,$r10
|
||||
mstep $r9,$r10
|
||||
mstep $r9,$r10
|
||||
mstep $r9,$r10
|
||||
mstep $r9,$r10
|
||||
mstep $r9,$r10
|
||||
mstep $r9,$r10
|
||||
mstep $r9,$r10
|
||||
mstep $r9,$r10
|
||||
mstep $r9,$r10
|
||||
movu.w $r12,$r12
|
||||
move.d $r11,$r9
|
||||
clear.w $r9
|
||||
test.d $r9
|
||||
mstep $r12,$r9
|
||||
mstep $r12,$r9
|
||||
mstep $r12,$r9
|
||||
mstep $r12,$r9
|
||||
mstep $r12,$r9
|
||||
mstep $r12,$r9
|
||||
mstep $r12,$r9
|
||||
mstep $r12,$r9
|
||||
mstep $r12,$r9
|
||||
mstep $r12,$r9
|
||||
mstep $r12,$r9
|
||||
mstep $r12,$r9
|
||||
mstep $r12,$r9
|
||||
mstep $r12,$r9
|
||||
mstep $r12,$r9
|
||||
mstep $r12,$r9
|
||||
add.w $r9,$r10
|
||||
lslq 16,$r10
|
||||
ret
|
||||
add.d $r13,$r10
|
||||
|
||||
L(L3):
|
||||
move.d $r9,$r10
|
||||
xor $r11,$r10
|
||||
xor $r12,$r10
|
||||
cmpu.w 65535,$r10
|
||||
bls L(L5)
|
||||
movu.w $r9,$r13
|
||||
|
||||
movu.w $r13,$r13
|
||||
move.d $r10,$r9
|
||||
lslq 16,$r9
|
||||
mstep $r13,$r9
|
||||
mstep $r13,$r9
|
||||
mstep $r13,$r9
|
||||
mstep $r13,$r9
|
||||
mstep $r13,$r9
|
||||
mstep $r13,$r9
|
||||
mstep $r13,$r9
|
||||
mstep $r13,$r9
|
||||
mstep $r13,$r9
|
||||
mstep $r13,$r9
|
||||
mstep $r13,$r9
|
||||
mstep $r13,$r9
|
||||
mstep $r13,$r9
|
||||
mstep $r13,$r9
|
||||
mstep $r13,$r9
|
||||
mstep $r13,$r9
|
||||
clear.w $r10
|
||||
test.d $r10
|
||||
mstep $r13,$r10
|
||||
mstep $r13,$r10
|
||||
mstep $r13,$r10
|
||||
mstep $r13,$r10
|
||||
mstep $r13,$r10
|
||||
mstep $r13,$r10
|
||||
mstep $r13,$r10
|
||||
mstep $r13,$r10
|
||||
mstep $r13,$r10
|
||||
mstep $r13,$r10
|
||||
mstep $r13,$r10
|
||||
mstep $r13,$r10
|
||||
mstep $r13,$r10
|
||||
mstep $r13,$r10
|
||||
mstep $r13,$r10
|
||||
mstep $r13,$r10
|
||||
lslq 16,$r10
|
||||
ret
|
||||
add.d $r9,$r10
|
||||
|
||||
L(L5):
|
||||
movu.w $r9,$r9
|
||||
lslq 16,$r10
|
||||
mstep $r9,$r10
|
||||
mstep $r9,$r10
|
||||
mstep $r9,$r10
|
||||
mstep $r9,$r10
|
||||
mstep $r9,$r10
|
||||
mstep $r9,$r10
|
||||
mstep $r9,$r10
|
||||
mstep $r9,$r10
|
||||
mstep $r9,$r10
|
||||
mstep $r9,$r10
|
||||
mstep $r9,$r10
|
||||
mstep $r9,$r10
|
||||
mstep $r9,$r10
|
||||
mstep $r9,$r10
|
||||
mstep $r9,$r10
|
||||
ret
|
||||
mstep $r9,$r10
|
||||
#endif
|
||||
L(Lfe1):
|
||||
.size ___Mul,L(Lfe1)-___Mul
|
10
libgcc/config/cris/t-cris
Normal file
10
libgcc/config/cris/t-cris
Normal file
|
@ -0,0 +1,10 @@
|
|||
LIB2ADD = _udivsi3.c _divsi3.c _umodsi3.c _modsi3.c
|
||||
|
||||
# The fixed-point arithmetic code is in one file, arit.c,
|
||||
# similar to libgcc2.c (or the old libgcc1.c). We need to
|
||||
# "split it up" with one file per define.
|
||||
$(LIB2ADD): $(srcdir)/config/cris/arit.c
|
||||
name=`echo $@ | sed -e 's,.*/,,' | sed -e 's,.c$$,,'`; \
|
||||
echo "#define L$$name" > tmp-$@ \
|
||||
&& echo '#include "$<"' >> tmp-$@ \
|
||||
&& mv -f tmp-$@ $@
|
|
@ -1 +1,3 @@
|
|||
LIB2ADD_ST = $(srcdir)/config/cris/mulsi3.S
|
||||
|
||||
CRTSTUFF_T_CFLAGS = -moverride-best-lib-options
|
||||
|
|
|
@ -1,4 +1,2 @@
|
|||
CRTSTUFF_T_CFLAGS_S = $(HOST_LIBGCC2_CFLAGS)
|
||||
|
||||
# Override t-linux default.
|
||||
SHLIB_MAPFILES = libgcc-std.ver $(srcdir)/config/cris/libgcc-glibc.ver
|
||||
|
|
72
libgcc/config/darwin-64.c
Normal file
72
libgcc/config/darwin-64.c
Normal file
|
@ -0,0 +1,72 @@
|
|||
/* Functions shipped in the ppc64 and x86_64 version of libgcc_s.1.dylib
|
||||
in older Mac OS X versions, preserved for backwards compatibility.
|
||||
Copyright (C) 2006, 2009 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#if defined (__ppc64__) || defined (__x86_64__)
|
||||
/* Many of these functions have probably never been used by anyone
|
||||
anywhere on these targets, but it's hard to prove this, so they're defined
|
||||
here. None are actually necessary, as demonstrated below by defining
|
||||
each function using the operation it implements. */
|
||||
|
||||
typedef long DI;
|
||||
typedef unsigned long uDI;
|
||||
typedef int SI;
|
||||
typedef unsigned int uSI;
|
||||
typedef int word_type __attribute__ ((mode (__word__)));
|
||||
|
||||
DI __ashldi3 (DI x, word_type c);
|
||||
DI __ashrdi3 (DI x, word_type c);
|
||||
int __clzsi2 (uSI x);
|
||||
word_type __cmpdi2 (DI x, DI y);
|
||||
int __ctzsi2 (uSI x);
|
||||
DI __divdi3 (DI x, DI y);
|
||||
uDI __lshrdi3 (uDI x, word_type c);
|
||||
DI __moddi3 (DI x, DI y);
|
||||
DI __muldi3 (DI x, DI y);
|
||||
DI __negdi2 (DI x);
|
||||
int __paritysi2 (uSI x);
|
||||
int __popcountsi2 (uSI x);
|
||||
word_type __ucmpdi2 (uDI x, uDI y);
|
||||
uDI __udivdi3 (uDI x, uDI y);
|
||||
uDI __udivmoddi4 (uDI x, uDI y, uDI *r);
|
||||
uDI __umoddi3 (uDI x, uDI y);
|
||||
|
||||
DI __ashldi3 (DI x, word_type c) { return x << c; }
|
||||
DI __ashrdi3 (DI x, word_type c) { return x >> c; }
|
||||
int __clzsi2 (uSI x) { return __builtin_clz (x); }
|
||||
word_type __cmpdi2 (DI x, DI y) { return x < y ? 0 : x == y ? 1 : 2; }
|
||||
int __ctzsi2 (uSI x) { return __builtin_ctz (x); }
|
||||
DI __divdi3 (DI x, DI y) { return x / y; }
|
||||
uDI __lshrdi3 (uDI x, word_type c) { return x >> c; }
|
||||
DI __moddi3 (DI x, DI y) { return x % y; }
|
||||
DI __muldi3 (DI x, DI y) { return x * y; }
|
||||
DI __negdi2 (DI x) { return -x; }
|
||||
int __paritysi2 (uSI x) { return __builtin_parity (x); }
|
||||
int __popcountsi2 (uSI x) { return __builtin_popcount (x); }
|
||||
word_type __ucmpdi2 (uDI x, uDI y) { return x < y ? 0 : x == y ? 1 : 2; }
|
||||
uDI __udivdi3 (uDI x, uDI y) { return x / y; }
|
||||
uDI __udivmoddi4 (uDI x, uDI y, uDI *r) { *r = x % y; return x / y; }
|
||||
uDI __umoddi3 (uDI x, uDI y) { return x % y; }
|
||||
|
||||
#endif /* __ppc64__ || __x86_64__ */
|
|
@ -1,5 +1,5 @@
|
|||
/* __cxa_atexit backwards-compatibility support for Darwin.
|
||||
Copyright (C) 2006, 2009 Free Software Foundation, Inc.
|
||||
Copyright (C) 2006, 2009, 2011 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
|
@ -25,10 +25,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|||
/* Don't do anything if we are compiling for a kext multilib. */
|
||||
#ifdef __PIC__
|
||||
|
||||
/* It is incorrect to include config.h here, because this file is being
|
||||
compiled for the target, and hence definitions concerning only the host
|
||||
do not apply. */
|
||||
|
||||
#include "tconfig.h"
|
||||
#include "tsystem.h"
|
||||
|
||||
|
|
51
libgcc/config/frv/cmovd.c
Normal file
51
libgcc/config/frv/cmovd.c
Normal file
|
@ -0,0 +1,51 @@
|
|||
/* Move double-word library function.
|
||||
Copyright (C) 2000, 2003, 2009 Free Software Foundation, Inc.
|
||||
Contributed by Red Hat, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software ; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY ; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
void
|
||||
__cmovd (long long *dest, const long long *src, unsigned len)
|
||||
{
|
||||
unsigned i;
|
||||
unsigned num = len >> 3;
|
||||
unsigned xlen = len & ~7;
|
||||
char *dest_byte = (char *)dest;
|
||||
const char *src_byte = (const char *)src;
|
||||
|
||||
if (dest_byte < src_byte || dest_byte > src_byte+len)
|
||||
{
|
||||
for (i = 0; i < num; i++)
|
||||
dest[i] = src[i];
|
||||
|
||||
while (len > xlen)
|
||||
{
|
||||
dest_byte[xlen] = src_byte[xlen];
|
||||
xlen++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (len-- > 0)
|
||||
dest_byte[len] = src_byte[len];
|
||||
}
|
||||
}
|
47
libgcc/config/frv/cmovh.c
Normal file
47
libgcc/config/frv/cmovh.c
Normal file
|
@ -0,0 +1,47 @@
|
|||
/* Move half-word library function.
|
||||
Copyright (C) 2000, 2003, 2009 Free Software Foundation, Inc.
|
||||
Contributed by Red Hat, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software ; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY ; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
void
|
||||
__cmovh (short *dest, const short *src, unsigned len)
|
||||
{
|
||||
unsigned i;
|
||||
unsigned num = len >> 1;
|
||||
char *dest_byte = (char *)dest;
|
||||
const char *src_byte = (const char *)src;
|
||||
|
||||
if (dest_byte < src_byte || dest_byte > src_byte+len)
|
||||
{
|
||||
for (i = 0; i < num; i++)
|
||||
dest[i] = src[i];
|
||||
|
||||
if ((len & 1) != 0)
|
||||
dest_byte[len-1] = src_byte[len-1];
|
||||
}
|
||||
else
|
||||
{
|
||||
while (len-- > 0)
|
||||
dest_byte[len] = src_byte[len];
|
||||
}
|
||||
}
|
51
libgcc/config/frv/cmovw.c
Normal file
51
libgcc/config/frv/cmovw.c
Normal file
|
@ -0,0 +1,51 @@
|
|||
/* Move word library function.
|
||||
Copyright (C) 2000, 2003, 2009 Free Software Foundation, Inc.
|
||||
Contributed by Red Hat, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software ; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY ; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
void
|
||||
__cmovw (int *dest, const int *src, unsigned len)
|
||||
{
|
||||
unsigned i;
|
||||
unsigned num = len >> 2;
|
||||
unsigned xlen = len & ~3;
|
||||
char *dest_byte = (char *)dest;
|
||||
const char *src_byte = (const char *)src;
|
||||
|
||||
if (dest_byte < src_byte || dest_byte > src_byte+len)
|
||||
{
|
||||
for (i = 0; i < num; i++)
|
||||
dest[i] = src[i];
|
||||
|
||||
while (len > xlen)
|
||||
{
|
||||
dest_byte[xlen] = src_byte[xlen];
|
||||
xlen++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (len-- > 0)
|
||||
dest_byte[len] = src_byte[len];
|
||||
}
|
||||
}
|
4
libgcc/config/frv/modi.c
Normal file
4
libgcc/config/frv/modi.c
Normal file
|
@ -0,0 +1,4 @@
|
|||
int __modi (int a, int b)
|
||||
{
|
||||
return a % b;
|
||||
}
|
|
@ -1,6 +1,16 @@
|
|||
LIB1ASMSRC = frv/lib1funcs.S
|
||||
LIB1ASMFUNCS = _cmpll _cmpf _cmpd _addll _subll _andll _orll _xorll _notll _cmov
|
||||
|
||||
LIB2ADD = $(srcdir)/config/frv/cmovh.c \
|
||||
$(srcdir)/config/frv/cmovw.c \
|
||||
$(srcdir)/config/frv/cmovd.c \
|
||||
$(srcdir)/config/frv/modi.c \
|
||||
$(srcdir)/config/frv/umodi.c \
|
||||
$(srcdir)/config/frv/uitof.c \
|
||||
$(srcdir)/config/frv/uitod.c \
|
||||
$(srcdir)/config/frv/ulltof.c \
|
||||
$(srcdir)/config/frv/ulltod.c
|
||||
|
||||
# Compile two additional files that are linked with every program
|
||||
# linked using GCC on systems using COFF or ELF, for the sake of C++
|
||||
# constructors.
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
CRTSTUFF_T_CFLAGS = -fPIC
|
||||
CRTSTUFF_T_CFLAGS = $(PICFLAG)
|
||||
|
||||
SHLIB_MAPFILES = libgcc-std.ver $(srcdir)/config/frv/libgcc-glibc.ver
|
||||
|
|
4
libgcc/config/frv/uitod.c
Normal file
4
libgcc/config/frv/uitod.c
Normal file
|
@ -0,0 +1,4 @@
|
|||
double __uitod (unsigned int a)
|
||||
{
|
||||
return a;
|
||||
}
|
4
libgcc/config/frv/uitof.c
Normal file
4
libgcc/config/frv/uitof.c
Normal file
|
@ -0,0 +1,4 @@
|
|||
float __uitof (unsigned int a)
|
||||
{
|
||||
return a;
|
||||
}
|
4
libgcc/config/frv/ulltod.c
Normal file
4
libgcc/config/frv/ulltod.c
Normal file
|
@ -0,0 +1,4 @@
|
|||
double __ulltod (unsigned long long a)
|
||||
{
|
||||
return a;
|
||||
}
|
4
libgcc/config/frv/ulltof.c
Normal file
4
libgcc/config/frv/ulltof.c
Normal file
|
@ -0,0 +1,4 @@
|
|||
float __ulltof (unsigned long long a)
|
||||
{
|
||||
return a;
|
||||
}
|
4
libgcc/config/frv/umodi.c
Normal file
4
libgcc/config/frv/umodi.c
Normal file
|
@ -0,0 +1,4 @@
|
|||
unsigned int __umodi (unsigned int a, unsigned int b)
|
||||
{
|
||||
return a % b;
|
||||
}
|
35
libgcc/config/h8300/clzhi2.c
Normal file
35
libgcc/config/h8300/clzhi2.c
Normal file
|
@ -0,0 +1,35 @@
|
|||
/* The implementation of __clzhi2.
|
||||
Copyright (C) 2003, 2009 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
int __clzhi2 (unsigned short x);
|
||||
|
||||
int
|
||||
__clzhi2 (unsigned short x)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < 16; i++)
|
||||
if (x & ((unsigned short) 1 << (15 - i)))
|
||||
break;
|
||||
return i;
|
||||
}
|
35
libgcc/config/h8300/ctzhi2.c
Normal file
35
libgcc/config/h8300/ctzhi2.c
Normal file
|
@ -0,0 +1,35 @@
|
|||
/* The implementation of __ctzhi2.
|
||||
Copyright (C) 2003, 2009 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
int __ctzhi2 (unsigned short x);
|
||||
|
||||
int
|
||||
__ctzhi2 (unsigned short x)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < 16; i++)
|
||||
if (x & ((unsigned short) 1 << i))
|
||||
break;
|
||||
return i;
|
||||
}
|
41
libgcc/config/h8300/fixunssfsi.c
Normal file
41
libgcc/config/h8300/fixunssfsi.c
Normal file
|
@ -0,0 +1,41 @@
|
|||
/* More subroutines needed by GCC output code on some machines. */
|
||||
/* Compile this one with gcc. */
|
||||
/* Copyright (C) 1989, 1992, 2001, 2002, 2003, 2004, 2009, 2011
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* The libgcc2.c implementation gets confused by our type setup and creates
|
||||
a directly recursive call, so we do our own implementation. For
|
||||
the H8/300, that's in lib1funcs.S, for H8/300H and H8S, it's here. */
|
||||
|
||||
#ifndef __H8300__
|
||||
long __fixunssfsi (float a);
|
||||
|
||||
long
|
||||
__fixunssfsi (float a)
|
||||
{
|
||||
if (a >= (float) 32768L)
|
||||
return (long) (a - 32768L) + 32768L;
|
||||
return (long) a;
|
||||
}
|
||||
#endif
|
36
libgcc/config/h8300/parityhi2.c
Normal file
36
libgcc/config/h8300/parityhi2.c
Normal file
|
@ -0,0 +1,36 @@
|
|||
/* The implementation of __parityhi2.
|
||||
Copyright (C) 2003, 2009 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
int __parityhi2 (unsigned short x);
|
||||
|
||||
int
|
||||
__parityhi2 (unsigned short x)
|
||||
{
|
||||
int i;
|
||||
int count = 0;
|
||||
for (i = 0; i < 16; i++)
|
||||
if (x & ((unsigned short) 1 << i))
|
||||
count++;
|
||||
return count & 1;
|
||||
}
|
36
libgcc/config/h8300/popcounthi2.c
Normal file
36
libgcc/config/h8300/popcounthi2.c
Normal file
|
@ -0,0 +1,36 @@
|
|||
/* The implementation of __popcounthi2.
|
||||
Copyright (C) 2003, 2009 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
int __popcounthi2 (unsigned short x);
|
||||
|
||||
int
|
||||
__popcounthi2 (unsigned short x)
|
||||
{
|
||||
int i;
|
||||
int count = 0;
|
||||
for (i = 0; i < 16; i++)
|
||||
if (x & ((unsigned short) 1 << i))
|
||||
count++;
|
||||
return count;
|
||||
}
|
|
@ -1,3 +1,13 @@
|
|||
LIB1ASMSRC = h8300/lib1funcs.S
|
||||
LIB1ASMFUNCS = _cmpsi2 _ucmpsi2 _divhi3 _divsi3 _mulhi3 _mulsi3 \
|
||||
_fixunssfsi_asm
|
||||
|
||||
LIB2ADD = \
|
||||
$(srcdir)/config/h8300/clzhi2.c \
|
||||
$(srcdir)/config/h8300/ctzhi2.c \
|
||||
$(srcdir)/config/h8300/parityhi2.c \
|
||||
$(srcdir)/config/h8300/popcounthi2.c \
|
||||
$(srcdir)/config/h8300/fixunssfsi.c
|
||||
|
||||
# We do not have DF type, so fake out the libgcc2 compilation.
|
||||
HOST_LIBGCC2_CFLAGS = -DDF=SF
|
||||
|
|
260
libgcc/config/i386/gthr-win32.c
Normal file
260
libgcc/config/i386/gthr-win32.c
Normal file
|
@ -0,0 +1,260 @@
|
|||
/* Implementation of W32-specific threads compatibility routines for
|
||||
libgcc2. */
|
||||
|
||||
/* Copyright (C) 1999, 2000, 2002, 2004, 2008, 2009 Free Software Foundation, Inc.
|
||||
Contributed by Mumit Khan <khan@xraylith.wisc.edu>.
|
||||
Modified and moved to separate file by Danny Smith
|
||||
<dannysmith@users.sourceforge.net>.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <windows.h>
|
||||
#ifndef __GTHREAD_HIDE_WIN32API
|
||||
# define __GTHREAD_HIDE_WIN32API 1
|
||||
#endif
|
||||
#undef __GTHREAD_I486_INLINE_LOCK_PRIMITIVES
|
||||
#define __GTHREAD_I486_INLINE_LOCK_PRIMITIVES
|
||||
#include <gthr-win32.h>
|
||||
|
||||
/* Windows32 threads specific definitions. The windows32 threading model
|
||||
does not map well into pthread-inspired gcc's threading model, and so
|
||||
there are caveats one needs to be aware of.
|
||||
|
||||
1. The destructor supplied to __gthread_key_create is ignored for
|
||||
generic x86-win32 ports. This will certainly cause memory leaks
|
||||
due to unreclaimed eh contexts (sizeof (eh_context) is at least
|
||||
24 bytes for x86 currently).
|
||||
|
||||
This memory leak may be significant for long-running applications
|
||||
that make heavy use of C++ EH.
|
||||
|
||||
However, Mingw runtime (version 0.3 or newer) provides a mechanism
|
||||
to emulate pthreads key dtors; the runtime provides a special DLL,
|
||||
linked in if -mthreads option is specified, that runs the dtors in
|
||||
the reverse order of registration when each thread exits. If
|
||||
-mthreads option is not given, a stub is linked in instead of the
|
||||
DLL, which results in memory leak. Other x86-win32 ports can use
|
||||
the same technique of course to avoid the leak.
|
||||
|
||||
2. The error codes returned are non-POSIX like, and cast into ints.
|
||||
This may cause incorrect error return due to truncation values on
|
||||
hw where sizeof (DWORD) > sizeof (int).
|
||||
|
||||
3. We are currently using a special mutex instead of the Critical
|
||||
Sections, since Win9x does not support TryEnterCriticalSection
|
||||
(while NT does).
|
||||
|
||||
The basic framework should work well enough. In the long term, GCC
|
||||
needs to use Structured Exception Handling on Windows32. */
|
||||
|
||||
int
|
||||
__gthr_win32_once (__gthread_once_t *once, void (*func) (void))
|
||||
{
|
||||
if (once == NULL || func == NULL)
|
||||
return EINVAL;
|
||||
|
||||
if (! once->done)
|
||||
{
|
||||
if (InterlockedIncrement (&(once->started)) == 0)
|
||||
{
|
||||
(*func) ();
|
||||
once->done = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Another thread is currently executing the code, so wait for it
|
||||
to finish; yield the CPU in the meantime. If performance
|
||||
does become an issue, the solution is to use an Event that
|
||||
we wait on here (and set above), but that implies a place to
|
||||
create the event before this routine is called. */
|
||||
while (! once->done)
|
||||
Sleep (0);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Windows32 thread local keys don't support destructors; this leads to
|
||||
leaks, especially in threaded applications making extensive use of
|
||||
C++ EH. Mingw uses a thread-support DLL to work-around this problem. */
|
||||
|
||||
int
|
||||
__gthr_win32_key_create (__gthread_key_t *key,
|
||||
void (*dtor) (void *) __attribute__((unused)))
|
||||
{
|
||||
int status = 0;
|
||||
DWORD tls_index = TlsAlloc ();
|
||||
if (tls_index != 0xFFFFFFFF)
|
||||
{
|
||||
*key = tls_index;
|
||||
#ifdef MINGW32_SUPPORTS_MT_EH
|
||||
/* Mingw runtime will run the dtors in reverse order for each thread
|
||||
when the thread exits. */
|
||||
status = __mingwthr_key_dtor (*key, dtor);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
status = (int) GetLastError ();
|
||||
return status;
|
||||
}
|
||||
|
||||
int
|
||||
__gthr_win32_key_delete (__gthread_key_t key)
|
||||
{
|
||||
return (TlsFree (key) != 0) ? 0 : (int) GetLastError ();
|
||||
}
|
||||
|
||||
void *
|
||||
__gthr_win32_getspecific (__gthread_key_t key)
|
||||
{
|
||||
DWORD lasterror;
|
||||
void *ptr;
|
||||
lasterror = GetLastError();
|
||||
ptr = TlsGetValue(key);
|
||||
SetLastError( lasterror );
|
||||
return ptr;
|
||||
}
|
||||
|
||||
int
|
||||
__gthr_win32_setspecific (__gthread_key_t key, const void *ptr)
|
||||
{
|
||||
if (TlsSetValue (key, CONST_CAST2(void *, const void *, ptr)) != 0)
|
||||
return 0;
|
||||
else
|
||||
return GetLastError ();
|
||||
}
|
||||
|
||||
void
|
||||
__gthr_win32_mutex_init_function (__gthread_mutex_t *mutex)
|
||||
{
|
||||
mutex->counter = -1;
|
||||
mutex->sema = CreateSemaphore (NULL, 0, 65535, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
__gthr_win32_mutex_destroy (__gthread_mutex_t *mutex)
|
||||
{
|
||||
CloseHandle ((HANDLE) mutex->sema);
|
||||
}
|
||||
|
||||
int
|
||||
__gthr_win32_mutex_lock (__gthread_mutex_t *mutex)
|
||||
{
|
||||
if (InterlockedIncrement (&mutex->counter) == 0 ||
|
||||
WaitForSingleObject (mutex->sema, INFINITE) == WAIT_OBJECT_0)
|
||||
return 0;
|
||||
else
|
||||
{
|
||||
/* WaitForSingleObject returns WAIT_FAILED, and we can only do
|
||||
some best-effort cleanup here. */
|
||||
InterlockedDecrement (&mutex->counter);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
__gthr_win32_mutex_trylock (__gthread_mutex_t *mutex)
|
||||
{
|
||||
if (__GTHR_W32_InterlockedCompareExchange (&mutex->counter, 0, -1) < 0)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
__gthr_win32_mutex_unlock (__gthread_mutex_t *mutex)
|
||||
{
|
||||
if (InterlockedDecrement (&mutex->counter) >= 0)
|
||||
return ReleaseSemaphore (mutex->sema, 1, NULL) ? 0 : 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
__gthr_win32_recursive_mutex_init_function (__gthread_recursive_mutex_t *mutex)
|
||||
{
|
||||
mutex->counter = -1;
|
||||
mutex->depth = 0;
|
||||
mutex->owner = 0;
|
||||
mutex->sema = CreateSemaphore (NULL, 0, 65535, NULL);
|
||||
}
|
||||
|
||||
int
|
||||
__gthr_win32_recursive_mutex_lock (__gthread_recursive_mutex_t *mutex)
|
||||
{
|
||||
DWORD me = GetCurrentThreadId();
|
||||
if (InterlockedIncrement (&mutex->counter) == 0)
|
||||
{
|
||||
mutex->depth = 1;
|
||||
mutex->owner = me;
|
||||
}
|
||||
else if (mutex->owner == me)
|
||||
{
|
||||
InterlockedDecrement (&mutex->counter);
|
||||
++(mutex->depth);
|
||||
}
|
||||
else if (WaitForSingleObject (mutex->sema, INFINITE) == WAIT_OBJECT_0)
|
||||
{
|
||||
mutex->depth = 1;
|
||||
mutex->owner = me;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* WaitForSingleObject returns WAIT_FAILED, and we can only do
|
||||
some best-effort cleanup here. */
|
||||
InterlockedDecrement (&mutex->counter);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
__gthr_win32_recursive_mutex_trylock (__gthread_recursive_mutex_t *mutex)
|
||||
{
|
||||
DWORD me = GetCurrentThreadId();
|
||||
if (__GTHR_W32_InterlockedCompareExchange (&mutex->counter, 0, -1) < 0)
|
||||
{
|
||||
mutex->depth = 1;
|
||||
mutex->owner = me;
|
||||
}
|
||||
else if (mutex->owner == me)
|
||||
++(mutex->depth);
|
||||
else
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
__gthr_win32_recursive_mutex_unlock (__gthread_recursive_mutex_t *mutex)
|
||||
{
|
||||
--(mutex->depth);
|
||||
if (mutex->depth == 0)
|
||||
{
|
||||
mutex->owner = 0;
|
||||
|
||||
if (InterlockedDecrement (&mutex->counter) >= 0)
|
||||
return ReleaseSemaphore (mutex->sema, 1, NULL) ? 0 : 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,3 +1,8 @@
|
|||
# If we are building next to winsup, this will let us find the real
|
||||
# limits.h when building libgcc2. Otherwise, winsup must be installed
|
||||
# first.
|
||||
LIBGCC2_INCLUDES = -I$(srcdir)/../winsup/w32api/include
|
||||
|
||||
CUSTOM_CRTSTUFF = yes
|
||||
|
||||
crtbegin.o: $(srcdir)/config/i386/cygming-crtbegin.c
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
# If we are building next to winsup, this will let us find the real
|
||||
# limits.h when building libgcc2. Otherwise, winsup must be installed
|
||||
# first.
|
||||
LIBGCC2_INCLUDES += -I$(srcdir)/../winsup/include \
|
||||
-I$(srcdir)/../winsup/cygwin/include
|
||||
|
||||
# Cygwin-specific parts of LIB_SPEC
|
||||
SHLIB_LC = -lcygwin -ladvapi32 -lshell32 -luser32 -lkernel32
|
||||
|
||||
|
|
3
libgcc/config/i386/t-darwin
Normal file
3
libgcc/config/i386/t-darwin
Normal file
|
@ -0,0 +1,3 @@
|
|||
LIB2_SIDITI_CONV_FUNCS = yes
|
||||
LIB2ADD = $(srcdir)/config/darwin-64.c
|
||||
LIB2FUNCS_EXCLUDE = _fixtfdi _fixunstfdi _floatditf _floatunditf
|
2
libgcc/config/i386/t-darwin64
Normal file
2
libgcc/config/i386/t-darwin64
Normal file
|
@ -0,0 +1,2 @@
|
|||
LIB2_SIDITI_CONV_FUNCS = yes
|
||||
LIB2ADD = $(srcdir)/config/darwin-64.c
|
2
libgcc/config/i386/t-gthr-win32
Normal file
2
libgcc/config/i386/t-gthr-win32
Normal file
|
@ -0,0 +1,2 @@
|
|||
# We hide calls to w32api needed for w32 thread support here:
|
||||
LIB2ADD = $(srcdir)/config/i386/gthr-win32.c
|
3
libgcc/config/i386/t-interix
Normal file
3
libgcc/config/i386/t-interix
Normal file
|
@ -0,0 +1,3 @@
|
|||
# We need to override LIBGCC2_DEBUG_CFLAGS so libgcc2 will be
|
||||
# built without debugging information
|
||||
LIBGCC2_DEBUG_CFLAGS =
|
|
@ -1 +1,3 @@
|
|||
CRTSTUFF_T_CFLAGS = -fno-omit-frame-pointer -fPIC
|
||||
HOST_LIBGCC2_CFLAGS += -fexceptions
|
||||
|
||||
CRTSTUFF_T_CFLAGS = -fno-omit-frame-pointer $(PICFLAG)
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
# We must also enable optimization to avoid having any code appear after
|
||||
# the call & alignment statement, but before we switch back to the
|
||||
# .text section.
|
||||
CRTSTUFF_T_CFLAGS = -fPIC -O2
|
||||
CRTSTUFF_T_CFLAGS = $(PICFLAG) -O2
|
||||
|
||||
# Add support for the introduction of 128-bit long double.
|
||||
SHLIB_MAPFILES += $(srcdir)/config/i386/libgcc-sol2.ver
|
||||
|
|
78
libgcc/config/ia64/quadlib.c
Normal file
78
libgcc/config/ia64/quadlib.c
Normal file
|
@ -0,0 +1,78 @@
|
|||
/* Subroutines for long double support.
|
||||
Copyright (C) 2000, 2001, 2002, 2009 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
extern int _U_Qfcmp (long double a, long double b, int);
|
||||
|
||||
int _U_Qfeq (long double, long double);
|
||||
int _U_Qfne (long double, long double);
|
||||
int _U_Qfgt (long double, long double);
|
||||
int _U_Qfge (long double, long double);
|
||||
int _U_Qflt (long double, long double);
|
||||
int _U_Qfle (long double, long double);
|
||||
int _U_Qfcomp (long double, long double);
|
||||
|
||||
int
|
||||
_U_Qfeq (long double a, long double b)
|
||||
{
|
||||
return (_U_Qfcmp (a, b, 4) != 0);
|
||||
}
|
||||
|
||||
int
|
||||
_U_Qfne (long double a, long double b)
|
||||
{
|
||||
return (_U_Qfcmp (a, b, 4) == 0);
|
||||
}
|
||||
|
||||
int
|
||||
_U_Qfgt (long double a, long double b)
|
||||
{
|
||||
return (_U_Qfcmp (a, b, 17) != 0);
|
||||
}
|
||||
|
||||
int
|
||||
_U_Qfge (long double a, long double b)
|
||||
{
|
||||
return (_U_Qfcmp (a, b, 21) != 0);
|
||||
}
|
||||
|
||||
int
|
||||
_U_Qflt (long double a, long double b)
|
||||
{
|
||||
return (_U_Qfcmp (a, b, 9) != 0);
|
||||
}
|
||||
|
||||
int
|
||||
_U_Qfle (long double a, long double b)
|
||||
{
|
||||
return (_U_Qfcmp (a, b, 13) != 0);
|
||||
}
|
||||
|
||||
int
|
||||
_U_Qfcomp (long double a, long double b)
|
||||
{
|
||||
if (_U_Qfcmp (a, b, 4) == 0)
|
||||
return 0;
|
||||
|
||||
return (_U_Qfcmp (a, b, 22) != 0 ? 1 : -1);
|
||||
}
|
|
@ -3,4 +3,7 @@
|
|||
# to 80 bit conversions and were done for Linux backwards compatibility.
|
||||
LIB1ASMFUNCS := $(filter-out _fixtfdi _fixunstfdi _floatditf,$(LIB1ASMFUNCS))
|
||||
|
||||
# Support routines for HP-UX 128 bit floats.
|
||||
LIB2ADD = $(srcdir)/config/ia64/quadlib.c $(srcdir)/floatunsitf.c
|
||||
|
||||
LIB2ADDEH = $(srcdir)/unwind-c.c
|
||||
|
|
|
@ -11,6 +11,13 @@ LIB1ASMFUNCS = __divxf3 __divdf3 __divsf3 \
|
|||
__nonlocal_goto __restore_stack_nonlocal __trampoline \
|
||||
_fixtfdi _fixunstfdi _floatditf
|
||||
|
||||
# ??? Hack to get -P option used when compiling lib1funcs.S, because Intel
|
||||
# assembler does not accept # line number as a comment.
|
||||
# ??? This breaks C++ pragma interface/implementation, which is used in the
|
||||
# C++ part of libgcc2, hence it had to be disabled. Must find some other way
|
||||
# to support the Intel assembler.
|
||||
#LIBGCC2_DEBUG_CFLAGS = -g1 -P
|
||||
|
||||
CUSTOM_CRTSTUFF = yes
|
||||
|
||||
# Assemble startup files.
|
||||
|
|
40
libgcc/config/iq2000/lib2funcs.c
Normal file
40
libgcc/config/iq2000/lib2funcs.c
Normal file
|
@ -0,0 +1,40 @@
|
|||
/* Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
typedef unsigned int USItype __attribute__ ((mode (SI)));
|
||||
|
||||
USItype
|
||||
__mulsi3 (USItype a, USItype b)
|
||||
{
|
||||
USItype c = 0;
|
||||
|
||||
while (a != 0)
|
||||
{
|
||||
if (a & 1)
|
||||
c += b;
|
||||
a >>= 1;
|
||||
b <<= 1;
|
||||
}
|
||||
|
||||
return c;
|
||||
}
|
5
libgcc/config/iq2000/t-iq2000
Normal file
5
libgcc/config/iq2000/t-iq2000
Normal file
|
@ -0,0 +1,5 @@
|
|||
LIB2ADD = $(srcdir)/udivmod.c \
|
||||
$(srcdir)/divmod.c \
|
||||
$(srcdir)/udivmodsi4.c \
|
||||
$(srcdir)/config/iq2000/lib2funcs.c
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
CRTSTUFF_T_CFLAGS = -fPIC -msign-extend-enabled
|
||||
HOST_LIBGCC2_CFLAGS = -fPIC -msign-extend-enabled
|
||||
CRTSTUFF_T_CFLAGS = $(PICFLAG) -msign-extend-enabled
|
||||
HOST_LIBGCC2_CFLAGS += -msign-extend-enabled
|
||||
|
|
134
libgcc/config/m32c/lib2funcs.c
Normal file
134
libgcc/config/m32c/lib2funcs.c
Normal file
|
@ -0,0 +1,134 @@
|
|||
/* libgcc routines for R8C/M16C/M32C
|
||||
Copyright (C) 2005, 2009
|
||||
Free Software Foundation, Inc.
|
||||
Contributed by Red Hat.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published
|
||||
by the Free Software Foundation; either version 3, or (at your
|
||||
option) any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
||||
License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
typedef int sint32_type __attribute__ ((mode (SI)));
|
||||
typedef unsigned int uint32_type __attribute__ ((mode (SI)));
|
||||
typedef int word_type __attribute__ ((mode (__word__)));
|
||||
|
||||
uint32_type udivmodsi4 (uint32_type, uint32_type, word_type);
|
||||
sint32_type __divsi3 (sint32_type, sint32_type);
|
||||
sint32_type __modsi3 (sint32_type, sint32_type);
|
||||
|
||||
uint32_type
|
||||
udivmodsi4 (uint32_type num, uint32_type den, word_type modwanted)
|
||||
{
|
||||
uint32_type bit = 1;
|
||||
uint32_type res = 0;
|
||||
|
||||
while (den < num && bit && !(den & (1L << 31)))
|
||||
{
|
||||
den <<= 1;
|
||||
bit <<= 1;
|
||||
}
|
||||
while (bit)
|
||||
{
|
||||
if (num >= den)
|
||||
{
|
||||
num -= den;
|
||||
res |= bit;
|
||||
}
|
||||
bit >>= 1;
|
||||
den >>= 1;
|
||||
}
|
||||
if (modwanted)
|
||||
return num;
|
||||
return res;
|
||||
}
|
||||
|
||||
sint32_type
|
||||
__divsi3 (sint32_type a, sint32_type b)
|
||||
{
|
||||
word_type neg = 0;
|
||||
sint32_type res;
|
||||
|
||||
if (a < 0)
|
||||
{
|
||||
a = -a;
|
||||
neg = !neg;
|
||||
}
|
||||
|
||||
if (b < 0)
|
||||
{
|
||||
b = -b;
|
||||
neg = !neg;
|
||||
}
|
||||
|
||||
res = udivmodsi4 (a, b, 0);
|
||||
|
||||
if (neg)
|
||||
res = -res;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
sint32_type
|
||||
__modsi3 (sint32_type a, sint32_type b)
|
||||
{
|
||||
word_type neg = 0;
|
||||
sint32_type res;
|
||||
|
||||
if (a < 0)
|
||||
{
|
||||
a = -a;
|
||||
neg = 1;
|
||||
}
|
||||
|
||||
if (b < 0)
|
||||
b = -b;
|
||||
|
||||
res = udivmodsi4 (a, b, 1);
|
||||
|
||||
if (neg)
|
||||
res = -res;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
/* See the comment by the definition of LIBGCC2_UNITS_PER_WORD in
|
||||
m32c.h for why we are creating extra versions of some of the
|
||||
functions defined in libgcc2.c. */
|
||||
|
||||
#define LIBGCC2_UNITS_PER_WORD 2
|
||||
|
||||
#define L_clzsi2
|
||||
#define L_ctzsi2
|
||||
#define L_ffssi2
|
||||
#define L_paritysi2
|
||||
#define L_popcountsi2
|
||||
|
||||
#include "libgcc2.c"
|
||||
|
||||
uint32_type
|
||||
__udivsi3 (uint32_type a, uint32_type b)
|
||||
{
|
||||
return udivmodsi4 (a, b, 0);
|
||||
}
|
||||
|
||||
uint32_type
|
||||
__umoddi3 (uint32_type a, uint32_type b)
|
||||
{
|
||||
return udivmodsi4 (a, b, 1);
|
||||
}
|
|
@ -7,3 +7,7 @@ LIB1ASMFUNCS = \
|
|||
__m32c_cmpsi2 \
|
||||
__m32c_ucmpsi2 \
|
||||
__m32c_jsri16
|
||||
|
||||
LIB2ADD = $(srcdir)/config/m32c/lib2funcs.c \
|
||||
$(srcdir)/config/m32c/trapv.c
|
||||
|
||||
|
|
43
libgcc/config/m32c/trapv.c
Normal file
43
libgcc/config/m32c/trapv.c
Normal file
|
@ -0,0 +1,43 @@
|
|||
/* 16-bit trapping arithmetic routines for R8C/M16C/M32C
|
||||
Copyright (C) 2009, 2011
|
||||
Free Software Foundation, Inc.
|
||||
Contributed by Red Hat.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published
|
||||
by the Free Software Foundation; either version 3, or (at your
|
||||
option) any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
||||
License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* See the comment by the definition of LIBGCC2_UNITS_PER_WORD in
|
||||
m32c.h for why we are creating extra versions of some of the
|
||||
functions defined in libgcc2.c.
|
||||
|
||||
Note - this file is separate from lib2funcs.c so that the following
|
||||
functions will appear in the their object file. This is necessary
|
||||
because they call abort() which is defined in the C library whereas
|
||||
the functions in lib2funcs.c are completely self sufficient. */
|
||||
|
||||
#define LIBGCC2_UNITS_PER_WORD 2
|
||||
|
||||
#define L_mulvsi3
|
||||
#define L_negvsi2
|
||||
#define L_addvsi3
|
||||
#define L_subvsi3
|
||||
|
||||
#include "libgcc2.c"
|
|
@ -1 +1,5 @@
|
|||
# Turn off the SDA while compiling libgcc2. There are no headers for it
|
||||
# and we want maximal upward compatibility here.
|
||||
HOST_LIBGCC2_CFLAGS += -G 0
|
||||
|
||||
SHLIB_MAPFILES = libgcc-std.ver $(srcdir)/config/m32r/libgcc-glibc.ver
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
# Turn off the SDA while compiling libgcc2. There are no headers for it
|
||||
# and we want maximal upward compatibility here.
|
||||
HOST_LIBGCC2_CFLAGS = -G 0
|
||||
|
||||
# We need to use -fpic when we are using gcc to compile the routines in
|
||||
# initfini.c. This is only really needed when we are going to use gcc/g++
|
||||
# to produce a shared library, but since we don't know ahead of time when
|
||||
|
|
595
libgcc/config/m68k/fpgnulib.c
Normal file
595
libgcc/config/m68k/fpgnulib.c
Normal file
|
@ -0,0 +1,595 @@
|
|||
/* This is a stripped down version of floatlib.c. It supplies only those
|
||||
functions which exist in libgcc, but for which there is not assembly
|
||||
language versions in m68k/lb1sf68.S.
|
||||
|
||||
It also includes simplistic support for extended floats (by working in
|
||||
double precision). You must compile this file again with -DEXTFLOAT
|
||||
to get this support. */
|
||||
|
||||
/*
|
||||
** gnulib support for software floating point.
|
||||
** Copyright (C) 1991 by Pipeline Associates, Inc. All rights reserved.
|
||||
** Permission is granted to do *anything* you want with this file,
|
||||
** commercial or otherwise, provided this message remains intact. So there!
|
||||
** I would appreciate receiving any updates/patches/changes that anyone
|
||||
** makes, and am willing to be the repository for said changes (am I
|
||||
** making a big mistake?).
|
||||
**
|
||||
** Pat Wood
|
||||
** Pipeline Associates, Inc.
|
||||
** pipeline!phw@motown.com or
|
||||
** sun!pipeline!phw or
|
||||
** uunet!motown!pipeline!phw
|
||||
**
|
||||
** 05/01/91 -- V1.0 -- first release to gcc mailing lists
|
||||
** 05/04/91 -- V1.1 -- added float and double prototypes and return values
|
||||
** -- fixed problems with adding and subtracting zero
|
||||
** -- fixed rounding in truncdfsf2
|
||||
** -- fixed SWAP define and tested on 386
|
||||
*/
|
||||
|
||||
/*
|
||||
** The following are routines that replace the gnulib soft floating point
|
||||
** routines that are called automatically when -msoft-float is selected.
|
||||
** The support single and double precision IEEE format, with provisions
|
||||
** for byte-swapped machines (tested on 386). Some of the double-precision
|
||||
** routines work at full precision, but most of the hard ones simply punt
|
||||
** and call the single precision routines, producing a loss of accuracy.
|
||||
** long long support is not assumed or included.
|
||||
** Overall accuracy is close to IEEE (actually 68882) for single-precision
|
||||
** arithmetic. I think there may still be a 1 in 1000 chance of a bit
|
||||
** being rounded the wrong way during a multiply. I'm not fussy enough to
|
||||
** bother with it, but if anyone is, knock yourself out.
|
||||
**
|
||||
** Efficiency has only been addressed where it was obvious that something
|
||||
** would make a big difference. Anyone who wants to do this right for
|
||||
** best speed should go in and rewrite in assembler.
|
||||
**
|
||||
** I have tested this only on a 68030 workstation and 386/ix integrated
|
||||
** in with -msoft-float.
|
||||
*/
|
||||
|
||||
/* the following deal with IEEE single-precision numbers */
|
||||
#define EXCESS 126L
|
||||
#define SIGNBIT 0x80000000L
|
||||
#define HIDDEN (1L << 23L)
|
||||
#define SIGN(fp) ((fp) & SIGNBIT)
|
||||
#define EXP(fp) (((fp) >> 23L) & 0xFF)
|
||||
#define MANT(fp) (((fp) & 0x7FFFFFL) | HIDDEN)
|
||||
#define PACK(s,e,m) ((s) | ((e) << 23L) | (m))
|
||||
|
||||
/* the following deal with IEEE double-precision numbers */
|
||||
#define EXCESSD 1022L
|
||||
#define HIDDEND (1L << 20L)
|
||||
#define EXPDBITS 11
|
||||
#define EXPDMASK 0x7FFL
|
||||
#define EXPD(fp) (((fp.l.upper) >> 20L) & 0x7FFL)
|
||||
#define SIGND(fp) ((fp.l.upper) & SIGNBIT)
|
||||
#define MANTD(fp) (((((fp.l.upper) & 0xFFFFF) | HIDDEND) << 10) | \
|
||||
(fp.l.lower >> 22))
|
||||
#define MANTDMASK 0xFFFFFL /* mask of upper part */
|
||||
|
||||
/* the following deal with IEEE extended-precision numbers */
|
||||
#define EXCESSX 16382L
|
||||
#define HIDDENX (1L << 31L)
|
||||
#define EXPXBITS 15
|
||||
#define EXPXMASK 0x7FFF
|
||||
#define EXPX(fp) (((fp.l.upper) >> 16) & EXPXMASK)
|
||||
#define SIGNX(fp) ((fp.l.upper) & SIGNBIT)
|
||||
#define MANTXMASK 0x7FFFFFFFL /* mask of upper part */
|
||||
|
||||
union double_long
|
||||
{
|
||||
double d;
|
||||
struct {
|
||||
long upper;
|
||||
unsigned long lower;
|
||||
} l;
|
||||
};
|
||||
|
||||
union float_long {
|
||||
float f;
|
||||
long l;
|
||||
};
|
||||
|
||||
union long_double_long
|
||||
{
|
||||
long double ld;
|
||||
struct
|
||||
{
|
||||
long upper;
|
||||
unsigned long middle;
|
||||
unsigned long lower;
|
||||
} l;
|
||||
};
|
||||
|
||||
#ifndef EXTFLOAT
|
||||
|
||||
int
|
||||
__unordsf2(float a, float b)
|
||||
{
|
||||
union float_long fl;
|
||||
|
||||
fl.f = a;
|
||||
if (EXP(fl.l) == EXP(~0u) && (MANT(fl.l) & ~HIDDEN) != 0)
|
||||
return 1;
|
||||
fl.f = b;
|
||||
if (EXP(fl.l) == EXP(~0u) && (MANT(fl.l) & ~HIDDEN) != 0)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
__unorddf2(double a, double b)
|
||||
{
|
||||
union double_long dl;
|
||||
|
||||
dl.d = a;
|
||||
if (EXPD(dl) == EXPDMASK
|
||||
&& ((dl.l.upper & MANTDMASK) != 0 || dl.l.lower != 0))
|
||||
return 1;
|
||||
dl.d = b;
|
||||
if (EXPD(dl) == EXPDMASK
|
||||
&& ((dl.l.upper & MANTDMASK) != 0 || dl.l.lower != 0))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* convert unsigned int to double */
|
||||
double
|
||||
__floatunsidf (unsigned long a1)
|
||||
{
|
||||
long exp = 32 + EXCESSD;
|
||||
union double_long dl;
|
||||
|
||||
if (!a1)
|
||||
{
|
||||
dl.l.upper = dl.l.lower = 0;
|
||||
return dl.d;
|
||||
}
|
||||
|
||||
while (a1 < 0x2000000L)
|
||||
{
|
||||
a1 <<= 4;
|
||||
exp -= 4;
|
||||
}
|
||||
|
||||
while (a1 < 0x80000000L)
|
||||
{
|
||||
a1 <<= 1;
|
||||
exp--;
|
||||
}
|
||||
|
||||
/* pack up and go home */
|
||||
dl.l.upper = exp << 20L;
|
||||
dl.l.upper |= (a1 >> 11L) & ~HIDDEND;
|
||||
dl.l.lower = a1 << 21L;
|
||||
|
||||
return dl.d;
|
||||
}
|
||||
|
||||
/* convert int to double */
|
||||
double
|
||||
__floatsidf (long a1)
|
||||
{
|
||||
long sign = 0, exp = 31 + EXCESSD;
|
||||
union double_long dl;
|
||||
|
||||
if (!a1)
|
||||
{
|
||||
dl.l.upper = dl.l.lower = 0;
|
||||
return dl.d;
|
||||
}
|
||||
|
||||
if (a1 < 0)
|
||||
{
|
||||
sign = SIGNBIT;
|
||||
a1 = (long)-(unsigned long)a1;
|
||||
if (a1 < 0)
|
||||
{
|
||||
dl.l.upper = SIGNBIT | ((32 + EXCESSD) << 20L);
|
||||
dl.l.lower = 0;
|
||||
return dl.d;
|
||||
}
|
||||
}
|
||||
|
||||
while (a1 < 0x1000000L)
|
||||
{
|
||||
a1 <<= 4;
|
||||
exp -= 4;
|
||||
}
|
||||
|
||||
while (a1 < 0x40000000L)
|
||||
{
|
||||
a1 <<= 1;
|
||||
exp--;
|
||||
}
|
||||
|
||||
/* pack up and go home */
|
||||
dl.l.upper = sign;
|
||||
dl.l.upper |= exp << 20L;
|
||||
dl.l.upper |= (a1 >> 10L) & ~HIDDEND;
|
||||
dl.l.lower = a1 << 22L;
|
||||
|
||||
return dl.d;
|
||||
}
|
||||
|
||||
/* convert unsigned int to float */
|
||||
float
|
||||
__floatunsisf (unsigned long l)
|
||||
{
|
||||
double foo = __floatunsidf (l);
|
||||
return foo;
|
||||
}
|
||||
|
||||
/* convert int to float */
|
||||
float
|
||||
__floatsisf (long l)
|
||||
{
|
||||
double foo = __floatsidf (l);
|
||||
return foo;
|
||||
}
|
||||
|
||||
/* convert float to double */
|
||||
double
|
||||
__extendsfdf2 (float a1)
|
||||
{
|
||||
register union float_long fl1;
|
||||
register union double_long dl;
|
||||
register long exp;
|
||||
register long mant;
|
||||
|
||||
fl1.f = a1;
|
||||
|
||||
dl.l.upper = SIGN (fl1.l);
|
||||
if ((fl1.l & ~SIGNBIT) == 0)
|
||||
{
|
||||
dl.l.lower = 0;
|
||||
return dl.d;
|
||||
}
|
||||
|
||||
exp = EXP(fl1.l);
|
||||
mant = MANT (fl1.l) & ~HIDDEN;
|
||||
if (exp == 0)
|
||||
{
|
||||
/* Denormal. */
|
||||
exp = 1;
|
||||
while (!(mant & HIDDEN))
|
||||
{
|
||||
mant <<= 1;
|
||||
exp--;
|
||||
}
|
||||
mant &= ~HIDDEN;
|
||||
}
|
||||
exp = exp - EXCESS + EXCESSD;
|
||||
dl.l.upper |= exp << 20;
|
||||
dl.l.upper |= mant >> 3;
|
||||
dl.l.lower = mant << 29;
|
||||
|
||||
return dl.d;
|
||||
}
|
||||
|
||||
/* convert double to float */
|
||||
float
|
||||
__truncdfsf2 (double a1)
|
||||
{
|
||||
register long exp;
|
||||
register long mant;
|
||||
register union float_long fl;
|
||||
register union double_long dl1;
|
||||
int sticky;
|
||||
int shift;
|
||||
|
||||
dl1.d = a1;
|
||||
|
||||
if ((dl1.l.upper & ~SIGNBIT) == 0 && !dl1.l.lower)
|
||||
{
|
||||
fl.l = SIGND(dl1);
|
||||
return fl.f;
|
||||
}
|
||||
|
||||
exp = EXPD (dl1) - EXCESSD + EXCESS;
|
||||
|
||||
sticky = dl1.l.lower & ((1 << 22) - 1);
|
||||
mant = MANTD (dl1);
|
||||
/* shift double mantissa 6 bits so we can round */
|
||||
sticky |= mant & ((1 << 6) - 1);
|
||||
mant >>= 6;
|
||||
|
||||
/* Check for underflow and denormals. */
|
||||
if (exp <= 0)
|
||||
{
|
||||
if (exp < -24)
|
||||
{
|
||||
sticky |= mant;
|
||||
mant = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
sticky |= mant & ((1 << (1 - exp)) - 1);
|
||||
mant >>= 1 - exp;
|
||||
}
|
||||
exp = 0;
|
||||
}
|
||||
|
||||
/* now round */
|
||||
shift = 1;
|
||||
if ((mant & 1) && (sticky || (mant & 2)))
|
||||
{
|
||||
int rounding = exp ? 2 : 1;
|
||||
|
||||
mant += 1;
|
||||
|
||||
/* did the round overflow? */
|
||||
if (mant >= (HIDDEN << rounding))
|
||||
{
|
||||
exp++;
|
||||
shift = rounding;
|
||||
}
|
||||
}
|
||||
/* shift down */
|
||||
mant >>= shift;
|
||||
|
||||
mant &= ~HIDDEN;
|
||||
|
||||
/* pack up and go home */
|
||||
fl.l = PACK (SIGND (dl1), exp, mant);
|
||||
return (fl.f);
|
||||
}
|
||||
|
||||
/* convert double to int */
|
||||
long
|
||||
__fixdfsi (double a1)
|
||||
{
|
||||
register union double_long dl1;
|
||||
register long exp;
|
||||
register long l;
|
||||
|
||||
dl1.d = a1;
|
||||
|
||||
if (!dl1.l.upper && !dl1.l.lower)
|
||||
return 0;
|
||||
|
||||
exp = EXPD (dl1) - EXCESSD - 31;
|
||||
l = MANTD (dl1);
|
||||
|
||||
if (exp > 0)
|
||||
{
|
||||
/* Return largest integer. */
|
||||
return SIGND (dl1) ? 0x80000000L : 0x7fffffffL;
|
||||
}
|
||||
|
||||
if (exp <= -32)
|
||||
return 0;
|
||||
|
||||
/* shift down until exp = 0 */
|
||||
if (exp < 0)
|
||||
l >>= -exp;
|
||||
|
||||
return (SIGND (dl1) ? -l : l);
|
||||
}
|
||||
|
||||
/* convert float to int */
|
||||
long
|
||||
__fixsfsi (float a1)
|
||||
{
|
||||
double foo = a1;
|
||||
return __fixdfsi (foo);
|
||||
}
|
||||
|
||||
#else /* EXTFLOAT */
|
||||
|
||||
/* We do not need these routines for coldfire, as it has no extended
|
||||
float format. */
|
||||
#if !defined (__mcoldfire__)
|
||||
|
||||
/* Primitive extended precision floating point support.
|
||||
|
||||
We assume all numbers are normalized, don't do any rounding, etc. */
|
||||
|
||||
/* Prototypes for the above in case we use them. */
|
||||
double __floatunsidf (unsigned long);
|
||||
double __floatsidf (long);
|
||||
float __floatsisf (long);
|
||||
double __extendsfdf2 (float);
|
||||
float __truncdfsf2 (double);
|
||||
long __fixdfsi (double);
|
||||
long __fixsfsi (float);
|
||||
|
||||
int
|
||||
__unordxf2(long double a, long double b)
|
||||
{
|
||||
union long_double_long ldl;
|
||||
|
||||
ldl.ld = a;
|
||||
if (EXPX(ldl) == EXPXMASK
|
||||
&& ((ldl.l.middle & MANTXMASK) != 0 || ldl.l.lower != 0))
|
||||
return 1;
|
||||
ldl.ld = b;
|
||||
if (EXPX(ldl) == EXPXMASK
|
||||
&& ((ldl.l.middle & MANTXMASK) != 0 || ldl.l.lower != 0))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* convert double to long double */
|
||||
long double
|
||||
__extenddfxf2 (double d)
|
||||
{
|
||||
register union double_long dl;
|
||||
register union long_double_long ldl;
|
||||
register long exp;
|
||||
|
||||
dl.d = d;
|
||||
/*printf ("dfxf in: %g\n", d);*/
|
||||
|
||||
ldl.l.upper = SIGND (dl);
|
||||
if ((dl.l.upper & ~SIGNBIT) == 0 && !dl.l.lower)
|
||||
{
|
||||
ldl.l.middle = 0;
|
||||
ldl.l.lower = 0;
|
||||
return ldl.ld;
|
||||
}
|
||||
|
||||
exp = EXPD (dl) - EXCESSD + EXCESSX;
|
||||
ldl.l.upper |= exp << 16;
|
||||
ldl.l.middle = HIDDENX;
|
||||
/* 31-20: # mantissa bits in ldl.l.middle - # mantissa bits in dl.l.upper */
|
||||
ldl.l.middle |= (dl.l.upper & MANTDMASK) << (31 - 20);
|
||||
/* 1+20: explicit-integer-bit + # mantissa bits in dl.l.upper */
|
||||
ldl.l.middle |= dl.l.lower >> (1 + 20);
|
||||
/* 32 - 21: # bits of dl.l.lower in ldl.l.middle */
|
||||
ldl.l.lower = dl.l.lower << (32 - 21);
|
||||
|
||||
/*printf ("dfxf out: %s\n", dumpxf (ldl.ld));*/
|
||||
return ldl.ld;
|
||||
}
|
||||
|
||||
/* convert long double to double */
|
||||
double
|
||||
__truncxfdf2 (long double ld)
|
||||
{
|
||||
register long exp;
|
||||
register union double_long dl;
|
||||
register union long_double_long ldl;
|
||||
|
||||
ldl.ld = ld;
|
||||
/*printf ("xfdf in: %s\n", dumpxf (ld));*/
|
||||
|
||||
dl.l.upper = SIGNX (ldl);
|
||||
if ((ldl.l.upper & ~SIGNBIT) == 0 && !ldl.l.middle && !ldl.l.lower)
|
||||
{
|
||||
dl.l.lower = 0;
|
||||
return dl.d;
|
||||
}
|
||||
|
||||
exp = EXPX (ldl) - EXCESSX + EXCESSD;
|
||||
/* ??? quick and dirty: keep `exp' sane */
|
||||
if (exp >= EXPDMASK)
|
||||
exp = EXPDMASK - 1;
|
||||
dl.l.upper |= exp << (32 - (EXPDBITS + 1));
|
||||
/* +1-1: add one for sign bit, but take one off for explicit-integer-bit */
|
||||
dl.l.upper |= (ldl.l.middle & MANTXMASK) >> (EXPDBITS + 1 - 1);
|
||||
dl.l.lower = (ldl.l.middle & MANTXMASK) << (32 - (EXPDBITS + 1 - 1));
|
||||
dl.l.lower |= ldl.l.lower >> (EXPDBITS + 1 - 1);
|
||||
|
||||
/*printf ("xfdf out: %g\n", dl.d);*/
|
||||
return dl.d;
|
||||
}
|
||||
|
||||
/* convert a float to a long double */
|
||||
long double
|
||||
__extendsfxf2 (float f)
|
||||
{
|
||||
long double foo = __extenddfxf2 (__extendsfdf2 (f));
|
||||
return foo;
|
||||
}
|
||||
|
||||
/* convert a long double to a float */
|
||||
float
|
||||
__truncxfsf2 (long double ld)
|
||||
{
|
||||
float foo = __truncdfsf2 (__truncxfdf2 (ld));
|
||||
return foo;
|
||||
}
|
||||
|
||||
/* convert an int to a long double */
|
||||
long double
|
||||
__floatsixf (long l)
|
||||
{
|
||||
double foo = __floatsidf (l);
|
||||
return foo;
|
||||
}
|
||||
|
||||
/* convert an unsigned int to a long double */
|
||||
long double
|
||||
__floatunsixf (unsigned long l)
|
||||
{
|
||||
double foo = __floatunsidf (l);
|
||||
return foo;
|
||||
}
|
||||
|
||||
/* convert a long double to an int */
|
||||
long
|
||||
__fixxfsi (long double ld)
|
||||
{
|
||||
long foo = __fixdfsi ((double) ld);
|
||||
return foo;
|
||||
}
|
||||
|
||||
/* The remaining provide crude math support by working in double precision. */
|
||||
|
||||
long double
|
||||
__addxf3 (long double x1, long double x2)
|
||||
{
|
||||
return (double) x1 + (double) x2;
|
||||
}
|
||||
|
||||
long double
|
||||
__subxf3 (long double x1, long double x2)
|
||||
{
|
||||
return (double) x1 - (double) x2;
|
||||
}
|
||||
|
||||
long double
|
||||
__mulxf3 (long double x1, long double x2)
|
||||
{
|
||||
return (double) x1 * (double) x2;
|
||||
}
|
||||
|
||||
long double
|
||||
__divxf3 (long double x1, long double x2)
|
||||
{
|
||||
return (double) x1 / (double) x2;
|
||||
}
|
||||
|
||||
long double
|
||||
__negxf2 (long double x1)
|
||||
{
|
||||
return - (double) x1;
|
||||
}
|
||||
|
||||
long
|
||||
__cmpxf2 (long double x1, long double x2)
|
||||
{
|
||||
return __cmpdf2 ((double) x1, (double) x2);
|
||||
}
|
||||
|
||||
long
|
||||
__eqxf2 (long double x1, long double x2)
|
||||
{
|
||||
return __cmpdf2 ((double) x1, (double) x2);
|
||||
}
|
||||
|
||||
long
|
||||
__nexf2 (long double x1, long double x2)
|
||||
{
|
||||
return __cmpdf2 ((double) x1, (double) x2);
|
||||
}
|
||||
|
||||
long
|
||||
__ltxf2 (long double x1, long double x2)
|
||||
{
|
||||
return __cmpdf2 ((double) x1, (double) x2);
|
||||
}
|
||||
|
||||
long
|
||||
__lexf2 (long double x1, long double x2)
|
||||
{
|
||||
return __cmpdf2 ((double) x1, (double) x2);
|
||||
}
|
||||
|
||||
long
|
||||
__gtxf2 (long double x1, long double x2)
|
||||
{
|
||||
return __cmpdf2 ((double) x1, (double) x2);
|
||||
}
|
||||
|
||||
long
|
||||
__gexf2 (long double x1, long double x2)
|
||||
{
|
||||
return __cmpdf2 ((double) x1, (double) x2);
|
||||
}
|
||||
|
||||
#endif /* !__mcoldfire__ */
|
||||
#endif /* EXTFLOAT */
|
|
@ -3,3 +3,9 @@ LIB1ASMFUNCS = _mulsi3 _udivsi3 _divsi3 _umodsi3 _modsi3 \
|
|||
_double _float _floatex \
|
||||
_eqdf2 _nedf2 _gtdf2 _gedf2 _ltdf2 _ledf2 \
|
||||
_eqsf2 _nesf2 _gtsf2 _gesf2 _ltsf2 _lesf2
|
||||
|
||||
LIB2ADD = $(srcdir)/config/m68k/fpgnulib.c xfgnulib.c
|
||||
|
||||
xfgnulib.c: $(srcdir)/config/m68k/fpgnulib.c
|
||||
echo '#define EXTFLOAT' > xfgnulib.c
|
||||
cat $< >> xfgnulib.c
|
||||
|
|
|
@ -1,2 +1,5 @@
|
|||
LIB1ASMSRC = mcore/lib1funcs.S
|
||||
LIB1ASMFUNCS = _divsi3 _udivsi3 _modsi3 _umodsi3
|
||||
|
||||
# could use -msifilter to be safe from interrupt/jmp interactions and others.
|
||||
HOST_LIBGCC2_CFLAGS = -O3 -DNO_FLOATLIB_FIXUNSDFSI #-msifilter
|
||||
|
|
139
libgcc/config/mep/lib2funcs.c
Normal file
139
libgcc/config/mep/lib2funcs.c
Normal file
|
@ -0,0 +1,139 @@
|
|||
/* libgcc routines for MeP.
|
||||
Copyright 2001, 2002, 2009 Free Software Foundation, Inc
|
||||
|
||||
This file is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 3 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
typedef int SItype __attribute__ ((mode (SI)));
|
||||
typedef unsigned int USItype __attribute__ ((mode (SI)));
|
||||
|
||||
typedef int word_type __attribute__ ((mode (__word__)));
|
||||
|
||||
USItype
|
||||
__mulsi3 (USItype a, USItype b)
|
||||
{
|
||||
USItype c = 0;
|
||||
|
||||
while (a != 0)
|
||||
{
|
||||
if (a & 1)
|
||||
c += b;
|
||||
a >>= 1;
|
||||
b <<= 1;
|
||||
}
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
|
||||
USItype
|
||||
udivmodsi4(USItype num, USItype den, word_type modwanted)
|
||||
{
|
||||
USItype bit = 1;
|
||||
USItype res = 0;
|
||||
|
||||
while (den < num && bit && !(den & (1L<<31)))
|
||||
{
|
||||
den <<=1;
|
||||
bit <<=1;
|
||||
}
|
||||
while (bit)
|
||||
{
|
||||
if (num >= den)
|
||||
{
|
||||
num -= den;
|
||||
res |= bit;
|
||||
}
|
||||
bit >>=1;
|
||||
den >>=1;
|
||||
}
|
||||
if (modwanted) return num;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
SItype
|
||||
__divsi3 (SItype a, SItype b)
|
||||
{
|
||||
word_type neg = 0;
|
||||
SItype res;
|
||||
|
||||
if (a < 0)
|
||||
{
|
||||
a = -a;
|
||||
neg = !neg;
|
||||
}
|
||||
|
||||
if (b < 0)
|
||||
{
|
||||
b = -b;
|
||||
neg = !neg;
|
||||
}
|
||||
|
||||
res = udivmodsi4 (a, b, 0);
|
||||
|
||||
if (neg)
|
||||
res = -res;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
SItype
|
||||
__modsi3 (SItype a, SItype b)
|
||||
{
|
||||
word_type neg = 0;
|
||||
SItype res;
|
||||
|
||||
if (a < 0)
|
||||
{
|
||||
a = -a;
|
||||
neg = 1;
|
||||
}
|
||||
|
||||
if (b < 0)
|
||||
b = -b;
|
||||
|
||||
res = udivmodsi4 (a, b, 1);
|
||||
|
||||
if (neg)
|
||||
res = -res;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
SItype
|
||||
__udivsi3 (SItype a, SItype b)
|
||||
{
|
||||
return udivmodsi4 (a, b, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
SItype
|
||||
__umodsi3 (SItype a, SItype b)
|
||||
{
|
||||
return udivmodsi4 (a, b, 1);
|
||||
}
|
|
@ -7,5 +7,10 @@ LIB1ASMFUNCS = _mep_profile \
|
|||
_mep_bb_trace \
|
||||
_mep_bb_increment
|
||||
|
||||
# multiply and divide routines
|
||||
LIB2ADD = \
|
||||
$(srcdir)/config/mep/lib2funcs.c \
|
||||
$(srcdir)/config/mep/tramp.c
|
||||
|
||||
# Use -O0 instead of -O2 so we don't get complex relocations
|
||||
CRTSTUFF_CFLAGS += -O0
|
||||
|
|
103
libgcc/config/mep/tramp.c
Normal file
103
libgcc/config/mep/tramp.c
Normal file
|
@ -0,0 +1,103 @@
|
|||
/* Trampoline support for MeP
|
||||
Copyright (C) 2004, 2007 Free Software Foundation, Inc.
|
||||
Contributed by Red Hat Inc.
|
||||
|
||||
This file is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 3 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/*
|
||||
7a0a ldc $10,$pc
|
||||
c0ae000a lw $0,10($10)
|
||||
caae000e lw $10,14($10)
|
||||
10ae jmp $10
|
||||
00000000 static chain
|
||||
00000000 function address
|
||||
*/
|
||||
|
||||
static inline int
|
||||
cache_config_register(void) {
|
||||
int rv;
|
||||
asm ("ldc\t%0, $ccfg" : "=r" (rv));
|
||||
return rv;
|
||||
}
|
||||
|
||||
#define ICACHE_SIZE ((cache_config_register() >> 16) & 0x7f)
|
||||
#define DCACHE_SIZE (cache_config_register() & 0x7f)
|
||||
|
||||
#define ICACHE_DATA_BASE 0x00300000
|
||||
#define ICACHE_TAG_BASE 0x00310000
|
||||
#define DCACHE_DATA_BASE 0x00320000
|
||||
#define DCACHE_TAG_BASE 0x00330000
|
||||
|
||||
static inline void
|
||||
flush_dcache (int addr)
|
||||
{
|
||||
asm volatile ("cache\t0, (%0)" : : "r" (addr));
|
||||
}
|
||||
|
||||
void
|
||||
__mep_trampoline_helper (unsigned long *tramp,
|
||||
int function_address,
|
||||
int static_chain);
|
||||
|
||||
void
|
||||
__mep_trampoline_helper (unsigned long *tramp,
|
||||
int function_address,
|
||||
int static_chain)
|
||||
{
|
||||
int dsize, isize;
|
||||
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
tramp[0] = 0xc0ae7a0a;
|
||||
tramp[1] = 0xcaae000a;
|
||||
tramp[2] = 0x10ae000e;
|
||||
#else
|
||||
tramp[0] = 0x7a0ac0ae;
|
||||
tramp[1] = 0x000acaae;
|
||||
tramp[2] = 0x000e10ae;
|
||||
#endif
|
||||
tramp[3] = static_chain;
|
||||
tramp[4] = function_address;
|
||||
|
||||
dsize = DCACHE_SIZE;
|
||||
isize = ICACHE_SIZE;
|
||||
|
||||
if (dsize)
|
||||
{
|
||||
flush_dcache ((int)tramp);
|
||||
flush_dcache ((int)tramp+16);
|
||||
}
|
||||
|
||||
if (isize)
|
||||
{
|
||||
int imask = (isize * 1024) - 1;
|
||||
int tmask = ~imask;
|
||||
unsigned int i;
|
||||
volatile unsigned int *tags;
|
||||
|
||||
imask &= 0xffe0;
|
||||
|
||||
for (i=(unsigned int)tramp; i<(unsigned int)tramp+20; i+=16)
|
||||
{
|
||||
tags = (unsigned int *)(ICACHE_TAG_BASE + (i & imask));
|
||||
if ((*tags & tmask) == (i & tmask))
|
||||
*tags &= ~1;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
###################################-
|
||||
#
|
||||
# Copyright 2009, 2010 Free Software Foundation, Inc.
|
||||
# Copyright 2009, 2010, 2011 Free Software Foundation, Inc.
|
||||
#
|
||||
# Contributed by Michael Eager <eager@eagercon.com>.
|
||||
#
|
||||
|
@ -23,7 +23,7 @@
|
|||
# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# divsi3.asm
|
||||
# divsi3.S
|
||||
#
|
||||
# Divide operation for 32 bit integers.
|
||||
# Input : Dividend in Reg r5
|
|
@ -1,6 +1,6 @@
|
|||
###################################
|
||||
#
|
||||
# Copyright 2009, 2010 Free Software Foundation, Inc.
|
||||
# Copyright 2009, 2010, 2011 Free Software Foundation, Inc.
|
||||
#
|
||||
# Contributed by Michael Eager <eager@eagercon.com>.
|
||||
#
|
||||
|
@ -23,7 +23,7 @@
|
|||
# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# modsi3.asm
|
||||
# modsi3.S
|
||||
#
|
||||
# modulo operation for 64 bit integers.
|
||||
#
|
|
@ -1,6 +1,6 @@
|
|||
###################################
|
||||
#
|
||||
# Copyright 2009, 2010 Free Software Foundation, Inc.
|
||||
# Copyright 2009, 2010, 2011 Free Software Foundation, Inc.
|
||||
#
|
||||
# Contributed by Michael Eager <eager@eagercon.com>.
|
||||
#
|
||||
|
@ -23,7 +23,7 @@
|
|||
# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# modsi3.asm
|
||||
# modsi3.S
|
||||
#
|
||||
# modulo operation for 32 bit integers.
|
||||
# Input : op1 in Reg r5
|
|
@ -1,6 +1,6 @@
|
|||
###################################-
|
||||
#
|
||||
# Copyright 2009, 2010 Free Software Foundation, Inc.
|
||||
# Copyright 2009, 2010, 2011 Free Software Foundation, Inc.
|
||||
#
|
||||
# Contributed by Michael Eager <eager@eagercon.com>.
|
||||
#
|
||||
|
@ -23,7 +23,7 @@
|
|||
# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# muldi3_hard.asm
|
||||
# muldi3_hard.S
|
||||
#
|
||||
# Multiply operation for 64 bit integers, for devices with hard multiply
|
||||
# Input : Operand1[H] in Reg r5
|
|
@ -1,6 +1,6 @@
|
|||
###################################-*-asm*-
|
||||
#
|
||||
# Copyright 2009, 2010 Free Software Foundation, Inc.
|
||||
# Copyright 2009, 2010, 2011 Free Software Foundation, Inc.
|
||||
#
|
||||
# Contributed by Michael Eager <eager@eagercon.com>.
|
||||
#
|
||||
|
@ -23,7 +23,7 @@
|
|||
# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# mulsi3.asm
|
||||
# mulsi3.S
|
||||
#
|
||||
# Multiply operation for 32 bit integers.
|
||||
# Input : Operand1 in Reg r5
|
|
@ -1,6 +1,6 @@
|
|||
###################################-*-asm*-
|
||||
#
|
||||
# Copyright 2009 Free Software Foundation, Inc.
|
||||
# Copyright 2009, 2011 Free Software Foundation, Inc.
|
||||
#
|
||||
#
|
||||
# Contributed by Michael Eager <eager@eagercon.com>.
|
||||
|
@ -24,7 +24,7 @@
|
|||
# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# stack_overflow_exit.asm
|
||||
# stack_overflow_exit.S
|
||||
#
|
||||
# Checks for stack overflows and sets the global variable
|
||||
# stack_overflow_error with the value of current stack pointer
|
|
@ -1,10 +1,10 @@
|
|||
LIB2ADD += \
|
||||
$(srcdir)/config/microblaze/divsi3.asm \
|
||||
$(srcdir)/config/microblaze/moddi3.asm \
|
||||
$(srcdir)/config/microblaze/modsi3.asm \
|
||||
$(srcdir)/config/microblaze/muldi3_hard.asm \
|
||||
$(srcdir)/config/microblaze/mulsi3.asm \
|
||||
$(srcdir)/config/microblaze/stack_overflow_exit.asm \
|
||||
$(srcdir)/config/microblaze/udivsi3.asm \
|
||||
$(srcdir)/config/microblaze/umodsi3.asm \
|
||||
$(srcdir)/config/microblaze/divsi3.S \
|
||||
$(srcdir)/config/microblaze/moddi3.S \
|
||||
$(srcdir)/config/microblaze/modsi3.S \
|
||||
$(srcdir)/config/microblaze/muldi3_hard.S \
|
||||
$(srcdir)/config/microblaze/mulsi3.S \
|
||||
$(srcdir)/config/microblaze/stack_overflow_exit.S \
|
||||
$(srcdir)/config/microblaze/udivsi3.S \
|
||||
$(srcdir)/config/microblaze/umodsi3.S \
|
||||
$(srcdir)/config/microblaze/divsi3_table.c
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
###################################-
|
||||
#
|
||||
# Copyright 2009, 2010 Free Software Foundation, Inc.
|
||||
# Copyright 2009, 2010, 2011 Free Software Foundation, Inc.
|
||||
#
|
||||
# Contributed by Michael Eager <eager@eagercon.com>.
|
||||
#
|
||||
|
@ -23,7 +23,7 @@
|
|||
# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# udivsi3.asm
|
||||
# udivsi3.S
|
||||
#
|
||||
# Unsigned divide operation.
|
||||
# Input : Divisor in Reg r5
|
|
@ -1,6 +1,6 @@
|
|||
###################################
|
||||
#
|
||||
# Copyright 2009, 2010 Free Software Foundation, Inc.
|
||||
# Copyright 2009, 2010, 2011 Free Software Foundation, Inc.
|
||||
#
|
||||
# Contributed by Michael Eager <eager@eagercon.com>.
|
||||
#
|
||||
|
@ -23,7 +23,7 @@
|
|||
# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# umodsi3.asm
|
||||
# umodsi3.S
|
||||
#
|
||||
# Unsigned modulo operation for 32 bit integers.
|
||||
# Input : op1 in Reg r5
|
3
libgcc/config/mips/t-elf
Normal file
3
libgcc/config/mips/t-elf
Normal file
|
@ -0,0 +1,3 @@
|
|||
# We must build libgcc2.a with -G 0, in case the user wants to link
|
||||
# without the $gp register.
|
||||
HOST_LIBGCC2_CFLAGS = -G 0
|
|
@ -1,3 +1,5 @@
|
|||
LIB2_SIDITI_CONV_FUNCS = yes
|
||||
|
||||
FPBIT = true
|
||||
FPBIT_CFLAGS = -DQUIET_NAN_NEGATED
|
||||
DPBIT = true
|
||||
|
|
2
libgcc/config/mips/t-vr
Normal file
2
libgcc/config/mips/t-vr
Normal file
|
@ -0,0 +1,2 @@
|
|||
LIB2ADD_ST = $(srcdir)/config/mips/mips16.S \
|
||||
$(srcdir)/config/mips/vr4120-div.S
|
74
libgcc/config/mips/vr4120-div.S
Normal file
74
libgcc/config/mips/vr4120-div.S
Normal file
|
@ -0,0 +1,74 @@
|
|||
/* Support file for -mfix-vr4120.
|
||||
Copyright (C) 2002, 2004, 2007 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* This file contains functions which implement divsi3 and modsi3 for
|
||||
-mfix-vr4120. div and ddiv do not give the correct result when one
|
||||
of the operands is negative. */
|
||||
|
||||
.set nomips16
|
||||
|
||||
#define DIV \
|
||||
xor $3,$4,$5 /* t = x ^ y */ ; \
|
||||
li $2,0x80000000; \
|
||||
.set noreorder; \
|
||||
bgez $4,1f /* x >= 0 */; \
|
||||
and $3,$3,$2 /* t = (x ^ y) & 0x80000000 in delay slot */ ;\
|
||||
.set reorder; \
|
||||
subu $4,$0,$4 /* x = -x */ ; \
|
||||
1:; \
|
||||
.set noreorder; \
|
||||
bgez $5,2f /* y >= 0 */ ; \
|
||||
nop; \
|
||||
subu $5,$0,$5 /* y = -y */ ; \
|
||||
.set reorder; \
|
||||
2:; \
|
||||
divu $0,$4,$5; /* we use divu because of INT_MIN */ \
|
||||
.set noreorder; \
|
||||
bne $5,$0,3f; \
|
||||
nop; \
|
||||
break 7 /* division on zero y */ ; \
|
||||
3:; \
|
||||
.set reorder; \
|
||||
mflo $2 /* r = x / y */ ; \
|
||||
.set noreorder; \
|
||||
beq $3,$0,4f /* t == 0 */ ; \
|
||||
nop; \
|
||||
subu $2,$0,$2 /* r = -r */ ; \
|
||||
.set reorder; \
|
||||
4:
|
||||
|
||||
.globl __vr4120_divsi3
|
||||
.ent __vr4120_divsi3
|
||||
__vr4120_divsi3:
|
||||
DIV
|
||||
j $31
|
||||
.end __vr4120_divsi3
|
||||
|
||||
.globl __vr4120_modsi3
|
||||
.ent __vr4120_modsi3
|
||||
__vr4120_modsi3:
|
||||
move $6,$4 # x1 = x
|
||||
move $7,$5 # y1 = y
|
||||
DIV
|
||||
mult $2,$7 # r = r * y1
|
||||
mflo $2
|
||||
.set noreorder
|
||||
j $31
|
||||
subu $2,$6,$2 # r = x1 - r in delay slot
|
||||
.end __vr4120_modsi3
|
|
@ -1,3 +1,5 @@
|
|||
HOST_LIBGCC2_CFLAGS = -mlibfuncs -O2
|
||||
|
||||
# We need to turn off some assumptions on normality for code in crtstuff.c
|
||||
# and crt{i,n}.S, specifically about execution not continuing past the
|
||||
# end of the section in the file being compiled. Thus we must stop the
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue