aboutsummaryrefslogtreecommitdiff
path: root/gcc/libgcc2.c
AgeCommit message (Collapse)AuthorFilesLines
2007-07-06libgcc2.h (word_type): Type definition removed.Andreas Krebbel1-11/+11
2007-07-06 Andreas Krebbel <krebbel1@de.ibm.com> * libgcc2.h (word_type): Type definition removed. (cmp_return_type, shift_count_type): Type definitions added. (__lshrdi3, __ashldi3, __ashrdi3): word_type of second parameter replaced with shift_count_type. (__cmpdi2, __ucmpdi2): word_type of return type replaced with cmp_return_type. * libgcc2.c (__udivmoddi4, __moddi3): Type of local variable c changed from word_type to Wtype. (__lshrdi3, __ashldi3, __ashrdi3): word_type of second parameter replaced with shift_count_type. (__cmpdi2, __ucmpdi2): word_type of return type replaced with cmp_return_type. * c-common.c (handle_mode_attribute): Handling for libgcc_cmp_return and libgcc_shift_count attribute added. * target-def.h (TARGET_LIBGCC_CMP_RETURN_MODE, TARGET_LIBGCC_SHIFT_COUNT_MODE): New target hooks defined. (TARGET_INITIALIZER): New target hooks added. * targhooks.c (default_libgcc_cmp_return_mode, default_libgcc_shift_count_mode): Default implementations for the new target hooks added. * targhooks.h (default_libgcc_cmp_return_mode, default_libgcc_shift_count_mode): Function prototypes added. * target.h (struct gcc_target): Fields for the new target hooks added. * optabs.c (expand_binop): Use shift_count_mode when expanding shift as library call. (prepare_cmp_insn): Use cmp_return_mode when expanding comparison as library call. * doc/tm.texi (TARGET_LIBGCC_CMP_RETURN_MODE, TARGET_LIBGCC_SHIFT_COUNT_MODE): Documentation added. * config/s390/s390.c (s390_libgcc_cmp_return_mode, s390_libgcc_shift_count_mode): Functions added. (TARGET_LIBGCC_CMP_RETURN_MODE, TARGET_LIBGCC_SHIFT_COUNT_MODE): Target hooks defined. From-SVN: r126410
2007-06-15libgcc2.c (CEXT): When compiling L_multc3 and L_divtc3...Uros Bizjak1-2/+6
* libgcc2.c (CEXT): When compiling L_multc3 and L_divtc3, define to "l" if LIBGCC_LONG_DOUBLE_SIZE == 128, otherwise define to LIBGCC2_TF_CEXT. * config/i386/linux64.h (LIBGCC2_HAS_TF_MODE): New define. (LIBGCC_TF_CEXT): Ditto. (TF_SIZE): Ditto. From-SVN: r125737
2007-04-24libgcc2.h (AVOID_FP_TYPE_CONVERSION): Rename from IS_IBM_EXTENDED.Richard Henderson1-18/+26
* libgcc2.h (AVOID_FP_TYPE_CONVERSION): Rename from IS_IBM_EXTENDED. Also define in terms of WIDEST_HARDWARE_FP_SIZE. * libgcc2.c (__floatdisf): Avoid double-word arithmetic when looking for non-zero bits shifted out. Avoid a recursive call when constructing the scalar. (__floatundisf): Likewise. From-SVN: r124106
2007-01-05re PR c/30360 (Complex divide bug)Jakub Jelinek1-1/+1
PR c/30360 * libgcc2.c (__divdc3): Compare c and d against 0.0 instead of denom against 0.0. * gcc.dg/pr30360.c: New test. From-SVN: r120486
2007-01-04libgcc2.c (__bswapsi2): Use SItype.Eric Christopher1-4/+4
2007-01-04 Eric Christopher <echristo@apple.com> * libgcc2.c (__bswapsi2): Use SItype. (__bswapdi2): Use DItype. * libgcc2.h: Update for above. From-SVN: r120454
2006-11-08libgcc2.c (__bswapdi2): Rename from bswapDI2.Eric Christopher1-3/+3
2006-11-07 Eric Christopher <echristo@apple.com> * libgcc2.c (__bswapdi2): Rename from bswapDI2. (__bswapsi2): Ditto. * libgcc2.h: Remove transformation of bswap routines. * config/i386/i386.md (bswapsi2): New. (bswapdi2): Ditto. 2006-11-07 Eric Christopher <echristo@apple.com> * gcc.target/i386/builtin-bswap-1.c: Rewrite for 64-bit. Test using scan-assembler-not. From-SVN: r118576
2006-11-01extend.texi (__builtin_bswap32): Document.Eric Christopher1-0/+24
2006-09-07 Eric Christopher <echristo@apple.com> Falk Hueffner <falk@debian.org> * doc/extend.texi (__builtin_bswap32): Document. (__builtin_bswap64): Ditto. * doc/libgcc.texi (bswapsi2): Document. (bswapdi2): Ditto. * doc/rtl.texi (bswap): Document. * optabs.c (expand_unop): Don't widen a bswap. (init_optabs): Init bswap. Set libfuncs explicitly for bswapsi2 and bswapdi2. * optabs.h (OTI_bswap): New. (bswap_optab): Ditto. * genopinit.c (optabs): Handle bswap_optab. * tree.h (tree_index): Add TI_UINT32_TYPE and TI_UINT64_TYPE. (uint32_type_node): New. (uint64_type_node): Ditto. * tree.c (build_common_tree_nodes_2): Initialize uint32_type_node and uint64_type_node. * builtins.c (expand_builtin_bswap): New. (expand_builtin): Call. (fold_builtin_bswap): New. (fold_builtin_1): Call. * fold-const.c (tree_expr_nonnegative_p): Return true for bswap. * builtin-types.def (BT_UINT32): New. (BT_UINT64): Ditto. (BT_FN_UINT32_UINT32): Ditto. (BT_FN_UINT64_UINT64): Ditto. * builtins.def (BUILT_IN_BSWAP32): New. (BUILT_IN_BSWAP64): Ditto. * rtl.def (BSWAP): New. * genattrtab.c (check_attr_value): New. * libgcc2.c (__bswapSI2): New. (__bswapDI2): Ditto. * libgcc2.h (__bswapSI2): Declare. (__bswapDI2): Ditto. * mklibgcc.in (lib2funcs): Add _bswapsi2 and _bswapdi2. * simplify-rtx.c (simplify_const_unary_operation): Return 0 for BSWAP. * libgcc-std.ver (__bwapsi2): Add. (__bswapdi2): Ditto. * reload1.c (eliminate_regs_1): Add bswap. (elimination_effects): Ditto. * config/i386/i386.h (x86_bswap): New. (TARGET_BSWAP): Use. * config/i386/i386.c (x86_bswap): Set. Co-Authored-By: Falk Hueffner <falk@debian.org> From-SVN: r118361
2006-05-23libgcc2.c (LIBGCC2_MAX_UNITS_PER_WORD): New macro.Richard Sandiford1-9/+14
* libgcc2.c (LIBGCC2_MAX_UNITS_PER_WORD): New macro. (LIBGCC2_UNITS_PER_WORD): Use LIBGCC2_MAX_UNITS_PER_WORD rather than MIN_UNITS_PER_WORD to set the default. Also use it in the guard. From-SVN: r114022
2006-05-19re PR target/22209 (libgfortran unresolvable symbols on irix6.5)Richard Sandiford1-0/+18
* libgcc2.c (MIN_UNITS_PER_WORD): Move default definition from libgcc2.h. (LIBGCC2_UNITS_PER_WORD): Provide default definition, using old MIN_UNITS_PER_WORD logic from libgcc2.h. Do nothing if LIBGCC2_UNITS_PER_WORD > MIN_UNITS_PER_WORD. * libgcc2.h (MIN_UNITS_PER_WORD): Remove definition from here. Use LIBGCC2_UNITS_PER_WORD rather than MIN_UNITS_PER_WORD to determine the size of Wtype, etc. * mklibgcc.in (LIB2_SIDITI_CONV_FUNCS): New argument. (swfloatfuncs): New variable. (dwfloatfuncs): Likewise. (lib2funcs): Remove floating-point conversion functions from initial assignment. Use LIB2_SIDITI_CONV_FUNCS to determine the set of conversion routines needed. Allow entries to specify an object name, filename and word size. Update users accordingly. * Makefile.in (libgcc.mk): Pass LIB2_SIDITI_CONV_FUNCS. * config/mips/t-mips (LIB2_SIDITI_CONV_FUNCS): Define. Revert: 2006-02-08 Roger Sayle <roger@eyesopen.com> PR target/22209 * config/fixtfdi.c: New libgcc source file. * config/fixunstfdi.c: New source file. * config/floatditf.c: New source file. * config/floatunditf.c: New souce file. * config/mips/t-iris6 (LIB2FUNCS_EXTRA): Include the new source files above instead of config/mips/_tilib.c. * config/mips/t-linux64 (LIB2FUNCS_EXTRA): Likewise. From-SVN: r113903
2006-01-20libgcc2.c (__floatdisf, [...]): Don't use IBM Extended Double TFmode.Alan Modra1-2/+16
* libgcc2.c (__floatdisf, __floatdidf): Don't use IBM Extended Double TFmode. (__floatundisf, __floatundidf): Likewise. * libgcc2.h (IS_IBM_EXTENDED): Define. From-SVN: r110004
2005-12-15re PR other/25028 (TImode-to-floating conversions broken)Joseph Myers1-93/+117
PR other/25028 * libgcc2.h (SF_SIZE, DF_SIZE, XF_SIZE, TF_SIZE): Define. * libgcc2.c (__floatdixf, __floatundixf, __floatditf, __floatunditf): Use #error if type sizes don't match requirements of implementation. (__floatdisf, __floatdidf): Unify. Possibly use XFmode or TFmode as wider floating-point type. Use #error if type sizes don't match requirements of implementation. Avoid overflow in computing Wtype_MAXp1_F * Wtype_MAXp1_F. When special casing conversion, shift one more bit. Cast 1 to DWtype or UDWtype for shifting. (__floatundisf, __floatundidf): Likewise. * config/ia64/hpux.h (XF_SIZE, TF_SIZE): Define. * config/ia64/ia64.c (ia64_init_libfuncs): Use _U_Qfcnvfxt_quad_to_quad and _U_Qfcnvxf_quad_to_quad for TFmode-TImode conversions. * doc/tm.texi (SF_SIZE, DF_SIZE, XF_SIZE, TF_SIZE): Document. testsuite: * gcc.dg/torture/fp-int-convert-timode.c: Only XFAIL for LP64 IA64 HP-UX. From-SVN: r108598
2005-12-05libgcc2.c (__popcountSI2): Don't use wide type for iterator and result.Jan Beulich1-2/+2
2005-12-05 Jan Beulich <jbeulich@novell.com> * libgcc2.c (__popcountSI2): Don't use wide type for iterator and result. (__popcountDI2): Likewise. From-SVN: r108046
2005-11-22fp-bit.c (clzusi): New function.Joseph Myers1-0/+114
* config/fp-bit.c (clzusi): New function. (si_to_float, usi_to_float): Use it to compute proper shift. (usi_to_float): Preserve guard bits when shifting right. * libgcc-std.ver (GCC_4.2.0): New version. * libgcc2.c (__floatundixf, __floatunditf, __floatundidf, __floatundisf): New functions. * libgcc2.h (__floatundixf, __floatunditf, __floatundidf, __floatundisf): Declare. * mklibgcc.in (lib2funcs): Add _floatundidf, _floatundisf, _floatundixf, and _floatunditf. * optabs.c (expand_float): If target does not define a pattern for signed or unsigned conversion, use an unsigned libcall instead of a signed one. (init_optabs): Initialize ufloat_optab. testsuite: * gcc.c-torture/execute/floatunsisf-1.c: New test. From-SVN: r107345
2005-09-27* libgcc2.c (__popcount_tab): Remove redundant prototype.Nick Clifton1-5/+0
From-SVN: r104702
2005-09-09Makefile.in (LIBGCC_DEPS): Add libgcc2.h.Nick Clifton1-4/+4
* Makefile.in (LIBGCC_DEPS): Add libgcc2.h. * libgcc2.c (__clz_tab[], __popcount_tab[]): Set the fixed dimension of these arrays. * libgcc2.h (__clz_tab[], __popcount_tab[]): Add exports of these arrays. * longlong.h: Only provide a prototype for the __clz_tab[] array if this header has not been included from libgcc2.h. * config/stormy16/stormy16-lib2.c: Include libgcc2.h rather than defining own types. Provide prototypes for exported functions. Use the __clz_tab[] and __popcount_tab[] arrays provided by libgcc2.c. From-SVN: r104081
2005-07-02Makefile.def (target_modules): Add libssp.Jakub Jelinek1-138/+0
* Makefile.def (target_modules): Add libssp. * configure.in (target_libraries): Add target-libssp. * configure: Rebuilt. * Makefile.in: Rebuilt. gcc/ * gcc.c (LINK_SSP_SPEC): Define. (link_ssp_spec): New variable. (LINK_COMMAND_SPEC): Add %(link_ssp). (static_specs): Add link_ssp_spec. * configure.ac (TARGET_LIBC_PROVIDES_SSP): New test. * configure: Rebuilt. * config.in: Rebuilt. * config/rs6000/linux.h (TARGET_THREAD_SSP_OFFSET): Define. * config/rs6000/linux64.h (TARGET_THREAD_SSP_OFFSET): Likewise. * config/i386/linux.h (TARGET_THREAD_SSP_OFFSET): Likewise. * config/i386/linux64.h (TARGET_THREAD_SSP_OFFSET): Likewise. * config/rs6000/rs6000.md (stack_protect_set, stack_protect_test): If TARGET_THREAD_SSP_OFFSET is defined, use -0x7010(13) resp. -0x7008(2) instead of reading __stack_chk_guard variable. * config/i386/i386.md (UNSPEC_SP_SET, UNSPEC_SP_TEST): Change number. (UNSPEC_SP_TLS_SET, UNSPEC_SP_TLS_TEST): New constants. (stack_protect_set, stack_protect_test): Use *_tls* patterns if TARGET_THREAD_SSP_OFFSET is defined. (stack_tls_protect_set_si, stack_tls_protect_set_di, stack_tls_protect_test_si, stack_tls_protect_test_di): New insns. Revert: 2005-06-27 Richard Henderson <rth@redhat.com> * libgcc-std.ver (GCC_4.1.0): New. * libgcc.h (__stack_chk_guard): Declare. (__stack_chk_fail, __stack_chk_fail_local): Declare. * libgcc2.c (L_stack_chk, L_stack_chk_local): New. * mklibgcc.in (lib2funcs): Add them. From-SVN: r101531
2005-06-27c-cppbuiltin.c (c_cpp_builtins): Add __SSP_ALL__ and __SSP__.Richard Henderson1-0/+138
* c-cppbuiltin.c (c_cpp_builtins): Add __SSP_ALL__ and __SSP__. * cfgexpand.c: Include params.h. (has_protected_decls, has_short_buffer): New. (expand_stack_vars): Take a predicate to determine what to expand. (defer_stack_allocation): True when flag_stack_protect on. (SPCT_HAS_LARGE_CHAR_ARRAY, SPCT_HAS_SMALL_CHAR_ARRAY): New. (SPCT_HAS_ARRAY, SPCT_HAS_AGGREGATE): New. (stack_protect_classify_type, stack_protect_decl_phase): New. (stack_protect_decl_phase_1, stack_protect_decl_phase_2): New. (add_stack_protection_conflicts, create_stack_guard): New. (expand_used_vars): Add stack protection logic. (tree_expand_cfg): Likewise. * common.opt (Wstack-protector): New. (fstack-protector, fstack-protector-all): New. * function.c: Include predict.h. (assign_parm_adjust_stack_rtl): Zap stack_parm when stack protect wants to copy the parameter into the stack frame. (stack_protect_prologue, stack_protect_epilogue): New. (expand_function_end): Call stack_protect_epilogue. Do sjlj_emit_function_exit_after after naked_return_label. * function.h (struct function): Add stack_protect_guard. * params.def (PARAM_SSP_BUFFER_SIZE): New. * toplev.c (process_options): Disable flag_stack_protect and/or warn_stack_protect based on FRAME_GROWS_DOWNWARD. * tree.h (stack_protect_prologue): Declare. * target-def.h (TARGET_STACK_PROTECT_GUARD): New. (TARGET_STACK_PROTECT_FAIL): New. (TARGET_INITIALIZER): Add them. * target.h (struct gcc_target): Add stack_protect_guard and stack_protect_fail. * targhooks.c: Include ggc.h, gty header. (stack_chk_guard_decl, default_stack_protect_guard): New. (stack_chk_fail_decl, default_external_stack_protect_fail): New. (default_hidden_stack_protect_fail): New. * targhooks.h (default_stack_protect_guard): Declare. (default_external_stack_protect_fail): Declare. (default_hidden_stack_protect_fail): Declare. * config/i386/i386.c (TARGET_STACK_PROTECT_FAIL): New. * config/i386/i386.md (UNSPEC_SP_SET, UNSPEC_SP_TEST): New. (trap): Use ud2. (conditional_trap, conditional_trap_1): Remove. (stack_protect_set, stack_protect_set_si, stack_protect_set_di): New. (stack_protect_test, stack_protect_test_si, stack_protect_test_di): New. * doc/md.texi (stack_protect_set, stack_protect_test): New. * doc/tm.texi (TARGET_STACK_PROTECT_GUARD): New. (TARGET_STACK_PROTECT_FAIL): New. * libgcc-std.ver (GCC_4.1.0): New. * libgcc.h (__stack_chk_guard): Declare. (__stack_chk_fail, __stack_chk_fail_local): Declare. * libgcc2.c (L_stack_chk, L_stack_chk_local): New. * mklibgcc.in (lib2funcs): Add them. From-SVN: r101348
2005-06-25Update FSF address.Kelley Cook1-2/+2
From-SVN: r101317
2005-05-08Makefile.in (cs-tconfig.h): Pass USED_FOR_TARGET to mkconfig.shNathan Sidwell1-13/+0
* Makefile.in (cs-tconfig.h): Pass USED_FOR_TARGET to mkconfig.sh * aclocal.m4 (GCC_TARGET_TEMPLATE, AH_TEMPLATE): New. * configure.ac (enable_checking): Fix typos in runtime_checking. (ENABLE_RUNTIME_CHECKING): Mark as target template. (xm_file): Prepend auto-host.h (HAVE_GAS_HIDDEN, HAVE_LD_EH_FRAME_HDR): Mark as target template. * mkconfig.sh: Do not automatically define USED_FOR_TARGET in tconfig.h. * crtstuff.c: Do not include auto-host.h. (IN_LIBGCC2): Do not define. * gcov-io.h: Include tconfig.h, not auto-host.h. * libgcc2.c: Do not include auto-host.h. (abort): Do not undefine. * libgcov.c: Remove unneeded comment about config.h. * unwind-dw2-fde-glibc.c: Do not inlude auto-host.h. * config.in, configure: Regenerated. Co-Authored-By: Paolo Bonzini <bonzini@gnu.org> From-SVN: r99386
2005-04-29crtstuff.c: Handle targets that use .init_array.Julian Brown1-1/+2
* crtstuff.c: Handle targets that use .init_array. * function.c (HAS_INIT_SECTION): Do not define. Instead, make sure that INVOKE__main is set correctly. (expand_main_function): Test INVOKE__main. * libgcc2.c: Do not define __main when using .init_array. * config/arm/arm.c (arm_elf_asm_constructor): New function. * config/arm/arm.h (CTORS_SECTION_ASM_OP): Define, with specialized libgcc version. (DTORS_SECTION_ASM_OP): Likewise. (CTOR_LIST_BEGIN): Define specially when in libgcc. (CTOR_LIST_END): Likewise. (DTOR_LIST_BEGIN): Likewise. (DTOR_LIST_END): Likewise. * config/arm/bpapi.h (INIT_SECTION_ASM_OP): Do not define it. (FINI_SECTION_ASM_OP): Likewise. (INIT_ARRAY_SECTION_ASM_OP): Define. (FINI_ARRAY_SECTION_ASM_OP): Likewise. * config/arm/elf.h (TARGET_ASM_CONSTRUCTOR): Define. (SUPPORTS_INIT_PRIORITY): Evaluate to false for EABI based targets. * doc/tm.texi (INIT_ARRAY_SECTION_ASM_OP): Document. (FINI_ARRAY_SECTION_ASM_OP): Likewise. Co-Authored-By: Mark Mitchell <mark@codesourcery.com> Co-Authored-By: Paul Brook <paul@codesourcery.com> From-SVN: r98986
2005-03-30Fix problem with calling powi* builtins.Fariborz Jahanian1-2/+4
OKed by Richard Henderson. From-SVN: r97278
2005-03-21libgcc2.h (LIBGCC2_HAS_SF_MODE): New macro.Richard Sandiford1-6/+6
* libgcc2.h (LIBGCC2_HAS_SF_MODE): New macro. (LIBGCC2_HAS_DF_MODE, LIBGCC2_HAS_TF_MODE, LIBGCC2_HAS_XF_MODE): Make the defaults false if BITS_PER_UNIT != 8. (SFtype, SCtype, __fixsfdi, __floatdisf, __fixunssfSI, __fixunssfDI) (__powisf2, __divsc3, __mulsc3): Guard with LIBGCC2_HAS_SF_MODE rather than BITS_PER_UNIT != 8. (L_fixdfdi, L_fixsfdi, L_fixtfdi, L_fixunsdfdi, L_fixunsdfsi) (L_fixunssfdi, L_fixunssfsi, L_fixunstfdi, L_fixunsxfdi, L_fixunsxfsi) (L_fixxfdi, L_floatdidf, L_floatdisf, L_floatditf, L_floatdixf): Remove #undefs. * libgcc2.c (__fixunssfDI, __fixsfdi, __floatdisf, __fixunssfSI) (__powisf2, __divsc3, __mulsc3): Guard with LIBGCC2_HAS_SF_MODE. From-SVN: r96778
2005-02-25re PR target/19930 (gcc.dg/pr19402-2.c fails on ia64-hpux)Steve Ellcey1-19/+19
PR target/19930 * doc/tm.texi (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Document. (LIBGCC2_HAS_DF_MODE): New. (LIBGCC2_HAS_XF_MODE): New. (LIBGCC2_HAS_TF_MODE): New. * libgcc2.h (LIBGCC2_HAS_XF_MODE): New name for HAVE_XFMODE. (LIBGCC2_HAS_TF_MODE): New name for HAVE_TFMODE. * libgcc2.c (LIBGCC2_HAS_XF_MODE): New name for HAVE_XFMODE. (LIBGCC2_HAS_TF_MODE): New name for HAVE_TFMODE. (LIBGCC2_HAS_DF_MODE): New name for HAVE_DFMODE. * config/ia64/t-ia64 (LIB1ASMFUNCS): Remove __compat and add _fixtfdi, _fixunstfdi, _floatditf * lib1funcs.asm: Remove L__compat. Add L_fixtfdi, L_fixunstfdi, L_floatditf. * config/ia64/hpux.h (LIBGCC2_HAS_XF_MODE): Define. (LIBGCC2_HAS_TF_MODE): Define. From-SVN: r95548
2005-02-17* libgcc2.c, tree-vect-analyze.c: Fix comment typos.Kazu Hirata1-1/+1
From-SVN: r95196
2005-02-16re PR middle-end/19920 (build broken on several targets due to recent 'DC' ↵Richard Henderson1-97/+148
type update to libgcc2) PR 19920 * libgcc2.c (WORD_SIZE): Remove all definitions; replace uses with W_TYPE_SIZE. (HIGH_WORD_COEFF, HIGH_HALFWORD_COEFF): Remove all definitions; replace uses with Wtype_MAXp1_F. (L_fixunstfdi, L_fixtfdi, L_floatditf, L_fixunsxfdi, L_fixxfdi, L_floatdixf, L_fixunsxfsi, L_fixunsdfdi, L_floatdidf, L_fixunsdfsi, L_powidf2, L_powixf2, L_powitf2, L_muldc3, L_divdc3, L_mulxc3, L_divxc3, L_multc3, L_divtc3): Protect with HAVE_DFMODE, HAVE_XFMODE, and HAVE_TFMODE as appropriate. (__fixunssfDI): Provide an implementation that doesn't need DFmode. (__floatdisf): Likewise. * libgcc2.h (LIBGCC2_DOUBLE_TYPE_SIZE): New. (HAVE_DFMODE, HAVE_XFMODE, HAVE_TFMODE): New. (Wtype_MAXp1_F): New. (DFtype, DCtype, __fixdfdi, __floatdidf, __fixunsdfSI, __fixunsdfDI, __powidf2, __divdc3, __muldc3): Protect with HAVE_DFMODE. From-SVN: r95121
2005-02-12c-tree.h, [...]: Fix comment typos.Kazu Hirata1-3/+3
* c-tree.h, combine.c, expmed.c, flow.c, libgcc2.c, simplify-rtx.c, tree-ssa-live.h: Fix comment typos. Follow spelling conventions. From-SVN: r94939
2005-02-11tree-complex.c (expand_complex_libcall): New.Richard Henderson1-1/+202
* tree-complex.c (expand_complex_libcall): New. (expand_complex_multiplication): Use it for c99 compliance. (expand_complex_division): Likewise. * fold-const.c (fold_complex_add, fold_complex_mult): New. (fold): Call them. * builtins.c (built_in_names): Remove const. * tree.c (build_common_builtin_nodes): Build complex arithmetic builtins. * tree.h (BUILT_IN_COMPLEX_MUL_MIN, BUILT_IN_COMPLEX_MUL_MAX): New. (BUILT_IN_COMPLEX_DIV_MIN, BUILT_IN_COMPLEX_DIV_MAX): New. (built_in_names): Remove const. * c-common.c (c_common_type_for_mode): Handle complex modes. * flags.h, toplev.c (flag_complex_method): Rename from flag_complex_divide_method. * libgcc2.c (__divsc3, __divdc3, __divxc3, __divtc3, __mulsc3, __muldc3, __mulxc3, __multc3): New. * libgcc2.h: Declare them. * libgcc-std.ver: Export them. * mklibgcc.in (lib2funcs): Build them. From-SVN: r94909
2005-02-10builtins.def, [...]: Update copyright.Kazu Hirata1-1/+1
* builtins.def, haifa-sched.c, libgcc2.c, libgcc2.h, tree-ssa-loop-ivcanon.c, tree-ssa-loop-niter.c, config/cris/cris-protos.h, config/cris/cris.c: Update copyright. From-SVN: r94840
2005-02-09re PR middle-end/19402 (__builtin_powi? still missing)Richard Guenther1-0/+36
2005-02-09 Richard Guenther <rguenth@gcc.gnu.org> PR middle-end/19402 * builtins.def: New __builtin_powi[lf]. * builtins.c (mathfn_built_in): Handle BUILT_IN_POWI. (expand_builtin_powi): New function. (expand_builtin): Dispatch to expand_builtin_powi. * libgcc2.h: Add prototypes for __builtin_powi[lf]. * libgcc2.c: Add __builtin_powi[lf] implementation. * mklibgcc.in: Add __builtin_powi[lf] to lib2funcs. * optabs.h: Add powi_optab. * optabs.c (init_optabs): Initialize powi_optab. * doc/extend.texi: Document __builtin_powi[lf]. * gcc.dg/pr19402-1.c: New testcase. * gcc.dg/pr19402-2.c: likewise. From-SVN: r94774
2004-12-15re PR other/18665 (-ftrapv borks up simple integer arithmetic)Eric Botcazou1-12/+81
PR other/18665 * libgcc-std.ver (GCC_3.4.4): Inherit from GCC_3.4.2. Export __absvti2, __addvti3, __mulvti3, __negvti2 and __subvti3. * libgcc2.c (__addvsi3): Rename to __addvSI3. New version if COMPAT_SIMODE_TRAPPING_ARITHMETIC. (__addvdi3): Rename to __addvDI3. (__subvsi3): Rename to __subvSI3. Use word type for the result. New version if COMPAT_SIMODE_TRAPPING_ARITHMETIC. (__subvdi3): Rename to __subvDI3. (_mulvsi3): Rename to _mulvSI3. New version if COMPAT_SIMODE_TRAPPING_ARITHMETIC. (_mulvdi3): Rename to _mulvDI3. (__negvsi2): Rename to __negvSI2. New version if COMPAT_SIMODE_TRAPPING_ARITHMETIC. (__negvdi2): Rename to __negvDI2. (__absvsi2): Rename to __absvSI2. New version if COMPAT_SIMODE_TRAPPING_ARITHMETIC. (__absvdi2): Rename to __absvDI2. * libgcc2.h (64-bit targets): Define COMPAT_SIMODE_TRAPPING_ARITHMETIC. (__absvSI2, __addvSI3, __subvSI3, __mulvSI3, __negvSI2, __absvDI2, __addvDI3, __subvDI3, __mulvDI3, __negvDI2): Define to the appropriate symbol and declare. (__absvsi2, __addvsi3, __subvsi3, __mulvsi3, __negvsi2): Declare if COMPAT_SIMODE_TRAPPING_ARITHMETIC. From-SVN: r92187
2004-10-15bitmap.c, [...]: Update copyright.Kazu Hirata1-1/+1
* bitmap.c, bitmap.h, builtin-attrs.def, cfglayout.h, collect2.h, conflict.c, coretypes.h, coverage.h, errors.h, gcc.h, gcov-dump.c, gen-protos.c, gencheck.c, gencodes.c, genconstants.c, gengenrtl.c, genmodes.c, genpeep.c, gensupport.h, graph.h, gthr-gnat.c, gthr-gnat.h, gthr-posix.c, gthr-posix.h, hard-reg-set.h, hwint.h, integrate.h, libgcc2.c, lists.c, machmode.def, mips-tdump.c, opts.h, params.c, predict.def, predict.h, protoize.c, reload.h, resource.h, rtl-error.c, sbitmap.c, sbitmap.h, sreal.c, tlink.c, tree-dump.h, tree-inline.h, unwind-dw2-fde.c, unwind-dw2.c, unwind-sjlj.c, value-prof.h: Update copyright. From-SVN: r89097
2004-10-07libgcc2.c (__moddi3): Cast &w to UDWtype*.Andrew Pinski1-1/+1
2004-10-07 Andrew Pinski <pinskia@physics.uc.edu> * libgcc2.c (__moddi3): Cast &w to UDWtype*. From-SVN: r88734
2004-09-27libgcc2.c (getpagesize): Change type of return value to int.Aaron W. LaFramboise1-1/+1
2004-09-27 Aaron W. LaFramboise <aaronraolete36@aaronwl.com> * libgcc2.c (getpagesize): Change type of return value to int. From-SVN: r88165
2004-09-25c-typeck.c, [...]: Fix comment formatting.Kazu Hirata1-4/+4
* c-typeck.c, defaults.h, dwarf.h, dwarf2out.c, fold-const.c, gthr-dce.h, gthr-posix.h, gthr-solaris.h, gthr-win32.h, lambda-code.c, lambda-mat.c, libgcc2.c, stmt.c, tree-ssa-pre.c, tree-vn.c, tree.h: Fix comment formatting. From-SVN: r88102
2004-08-03gthr-gnat.c: Add visibility #pragmas.Mark Mitchell1-10/+0
* gthr-gnat.c: Add visibility #pragmas. * gthr-gnat.h : Likewise. * gthr.h: Likewise. * libgcc2.c (__ffsSI2): Move prototype to libgcc2.h. (__ffsDI2): Likewise. (__clzSI2): Likewise. (__ctzSI2): Likewise. (__ctzDI2): Likewise. (__popcountSI2): Likewise. (__popcountDI2): Likewise. (__paritySI2): Likewise. (__parityDI2): Likewise. * libgcc2.h: Add visibility #pragmas. (__clzDI2): Add prototype. (__clzSI2): Likewise. (__ctzSI2): Likewise. (__ffsDI2): Likewise. (__ffsSI2): Likewise. (__ctzDI2): Likewise. (__popcountSI2): Likewise. (__popcountDI2): Likewise. (__paritySI2): Likewise. (__parityDI2): Likewise. * unwind-dw2-fde.h: Add visibility #pragmas. * unwind.h: Likewise. From-SVN: r85489
2004-07-27libgcc2.c: Change all conditionals testing LIBGCC2_LONG_DOUBLE_TYPE_SIZE == ↵Zack Weinberg1-4/+4
96 to == 80. * libgcc2.c: Change all conditionals testing LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 96 to == 80. * libgcc2.h: Likewise. * config/i386/i386.c (ix86_init_mmx_sse_builtins): Set TYPE_PRECISION of float80_type to 80. * config/ia64/ia64.c (ia64_init_builtins): Set TYPE_PRECISION of fpreg_type and float80_type to 80. * config/i386/i386.h, config/ia64/ia64.h, config/m68k/m68k.h * config/m68k/netbsd-elf.h: Change LONG_DOUBLE_TYPE_SIZE and possibly LIBGCC2_LONG_DOUBLE_TYPE_SIZE to evaluate to 80 whenever they would formerly have evaluated to 96. * config/i386/sco5.h: Remove unnecessary redefinition of LONG_DOUBLE_TYPE_SIZE. * doc/rtl.texi: Clarify uses of XFmode and TFmode. * config/i386/i386-modes.def: Use FRACTIONAL_FLOAT_MODE for XFmode, with a bitsize of 80. Update commentary. * config/ia64/ia64-modes.def: Likewise. * config/m68k/m68k-modes.def: Likewise. From-SVN: r85232
2004-07-17libgcc2.c (__enable_execute_stack): New symbol.Eric Botcazou1-0/+13
* libgcc2.c (__enable_execute_stack): New symbol. * libgcc-std.ver (GCC_3.4.2): New version. Inherit from GCC_3.4 and declare __enable_execute_stack. * mklibgcc.in (lib2funcs): Add _enable_execute_stack. * config/netbsd.h (NETBSD_ENABLE_EXECUTE_STACK): ANSIfy. * config/sol2.h (TRANSFER_FROM_TRAMPOLINE): Rename into ENABLE_EXECUTE_STACK. * config/alpha/alpha.c (alpha_initialize_trampoline): Conditionalize on ENABLE_EXECUTE_STACK instead of TRANSFER_FROM_TRAMPOLINE. * config/alpha/netbsd.h (TRANSFER_FROM_TRAMPOLINE): Rename into ENABLE_EXECUTE_STACK. * config/alpha/osf.h (TRANSFER_FROM_TRAMPOLINE): Likewise. * config/i386/i386.c (x86_initialize_trampoline): Conditionalize on ENABLE_EXECUTE_STACK instead of TRANSFER_FROM_TRAMPOLINE. * config/i386/netbsd-elf.h (TRANSFER_FROM_TRAMPOLINE): Rename into ENABLE_EXECUTE_STACK. * config/i386/netbsd.h (TRANSFER_FROM_TRAMPOLINE): Likewise. * config/i386/netbsd64.h (TRANSFER_FROM_TRAMPOLINE): Likewise. * config/sparc/freebsd.h (TRANSFER_FROM_TRAMPOLINE): Likewise. * config/sparc/netbsd-elf.h (TRANSFER_FROM_TRAMPOLINE): Likewise. * config/sparc/sparc.c (sparc_initialize_trampoline): Conditionalize on ENABLE_EXECUTE_STACK instead of TRANSFER_FROM_TRAMPOLINE. (sparc64_initialize_trampoline): Likewise. * doc/tm.texi (trampolines): Add ENABLE_EXECUTE_STACK macro. From-SVN: r84880
2004-05-20re PR other/15526 (-ftrapv aborts on 0 * (-1))Falk Hueffner1-3/+1
PR other/15526 * libgcc2.c (__mulvsi3): Fix overflow test. * gcc.dg/ftrapv-1.c: New test case. From-SVN: r82042
2003-11-14libgcc2.c (__negdi2, [...]): Const-ify and/or initialize automatic variables ↵Kaveh R. Ghazi1-144/+76
at declaration. * libgcc2.c (__negdi2, __addvsi3, __addvdi3, __subvsi3, __subvdi3, __mulvsi3, __negvsi2, __negvdi2, __mulvdi3, __lshrdi3, __ashldi3, __ashrdi3, __ffsDI2, __muldi3, __clzDI2, __ctzDI2, __parityDI2, __udivmoddi4, __divdi3, __moddi3, __cmpdi2, __ucmpdi2, __fixunstfDI, __fixunsxfDI, __fixunsdfDI, __fixunssfDI, __floatdixf, __floatditf, __floatdidf, __floatdisf, __gcc_bcmp): Const-ify and/or initialize automatic variables at declaration. From-SVN: r73573
2003-11-02* libgcc2.c (SYMBOL__MAIN): Provide C90 declaration.John David Anglin1-1/+2
From-SVN: r73191
2003-07-01re PR middle-end/6578 (-ftrapv doesn't catch multiplication overflow)Bruno Haible1-17/+127
2003-06-30 Bruno Haible <bruno@clisp.org> PR middle-end/6578 * libgcc2.c (__subvsi3): Remove simplification that would not work when subtracting -0x80000000. (__subvdi3): Remove simplification that would return a wrong result. (__mulvsi3): Fix overflow check. (__absvdi2): Fix simplification that would return a wrong result. (__mulvdi3): Fix overflow check. From-SVN: r68758
2003-06-15libgcc2.c: Delete sysV68 L_trampoline section.Kaveh R. Ghazi1-45/+0
* libgcc2.c: Delete sysV68 L_trampoline section. * config/m68k/mot3300-crt0.S: Delete file. * config/m68k/mot3300Mcrt0.S: Likewise. From-SVN: r67965
2003-06-07mklibgcc.in (lib2funcs): Remove _exit.Andreas Jaeger1-75/+0
* mklibgcc.in (lib2funcs): Remove _exit. * libgcc2.c: Remove L_exit. * gbl-ctors.h: Remove declarations dependend on NEED_ATEXIT. * system.h: Poison NEED_ATEXIT, ON_EXIT, EXIT_BODY. * doc/tm.texi (Misc): Remove NEED_ATEXIT, ON_EXIT, EXIT_BODY. From-SVN: r67599
2003-06-04uwin.h: Remove SUBTARGET_PROLOGUE.Andreas Jaeger1-102/+1
* config/i386/uwin.h: Remove SUBTARGET_PROLOGUE. * config/i386/i386.c (ix86_expand_prologue): Do not use SUBTARGET_PROLOGUE. * system.h: Poision SUBTARGET_PROLOGUE. * config/arm/arm-protos.h: Remove unused rdate_section prototype. * output.h: Remove TDESC_SECTION_ASM_OP and RDATA_SECTION_ASM_OP dependend code. * system.h: Poison TDESC_SECTION_ASM_OP and RDATA_SECTION_ASM_OP. * system.h: Poison INSN_CACHE_DEPTH, INSN_CACHE_SIZE and INSN_CACHE_LINE_WIDTH. * libgcc2.c (INSN_CACHE_PLANE_SIZE): Removed. (__clear_cache): Remove code dependend on INSN_CACHE_DEPTH, INSN_CACHE_SIZE and INSN_CACHE_LINE_WIDTH. * doc/tm.texi (Trampolines): Remove INSN_CACHE_DEPTH, INSN_CACHE_SIZE and INSN_CACHE_LINE_WIDTH. * dbxout.c (dbxout_type): Remove usage of DBX_OUTPUT_ENUM. (dbxout_symbol): Remove usage of DBX_OUTPUT_CONSTANT_SYMBOL. (dbxout_block): Remove usage of DBX_OUTPUT_CATCH. (dbxout_block): Remove usage of DBX_LBRAC_FIRST. (dbxout_source_file): Remove usage of DBX_OUTPUT_SOURCE_FILENAME. (dbxout_init): Remove test for DBX_WORKING_DIRECTORY. * doc/tm.texi (DBX Options): Do not document DBX_LBRAC_FIRST, DBX_OUTPUT_SOURCE_FILENAME and DBX_OUTPUT_ENUM and DBX_WORKING_DIRECTORY. * system.h: Poison DBX_LBRAC_FIRST, DBX_OUTPUT_ENUM, DBX_OUTPUT_SOURCE_FILENAME and DBX_WORKING_DIRECTORY. * config/frv/frv-protos.h: Remove unused const_section declaration. * config/vax/vax-protos.h: Likewise. * output.h: Remove CONST_SECTION_ASM_OP usage. * system.h: Poison CONST_SECTION_ASM_OP. * crtstuff.c (__do_global_dtors_aux): Remove usage of CRT_GET_RFIB_TEXT (frame_dummy): Likewise. * unwind-dw2-fde-glibc.c (_Unwind_IteratePhdrCallback): Likewise. * system.h: Poison CRT_GET_RFIB_TEXT. From-SVN: r67423
2003-02-09libgcc-std.ver (__clztf2): New.Richard Henderson1-60/+66
* libgcc-std.ver (__clztf2): New. (__ctztf2, __popcounttf2, __paritytf2): New. * libgcc2.c (__clzSI2, __clzDI2, __ctzSI2, __ctzDI2, __popcountSI2, __popcountDI2, __paritySI2, __parityDI2): Use UWmode and UDWmode; adjust code to match the different type sizes. * libgcc2.h (__clzSI2, __ctzSI2, __popcountSI2, __paritySI2, __clzDI2, __ctzDI2, __popcountDI2, __parityDI2): New macros. * optabs.c (init_integral_libfuncs): Don't hard-code SImode and TImode; select word_mode and twice that. (init_floating_libfuncs): Don't hard-code SFmode and TFmode; select the modes from float, double, and long double. (init_optabs): Remove duplicate initializations. From-SVN: r62606
2003-02-04libgcc2.h, libgcc2.c (__ffsSI2): New.Richard Henderson1-2/+18
* libgcc2.h, libgcc2.c (__ffsSI2): New. (__ffsDI2): Rename from __ffsdi2. * mklibgcc.in (lib2funcs): Add _ffssi2. From-SVN: r62422
2003-02-04libgcc2.c (__paritysi2, [...]): Replace last two reduction rounds with a ↵Richard Henderson1-6/+4
"bit table" lookup. * libgcc2.c (__paritysi2, __paritydi2): Replace last two reduction rounds with a "bit table" lookup. From-SVN: r62421
2003-02-04* libgcc2.c (__subvdi3): Fix typo.Falk Hueffner1-1/+1
From-SVN: r62406
2003-02-03libgcc2.c (__ffsdi2, [...]): Change return type to "int".Richard Henderson1-9/+27
* libgcc2.c (__ffsdi2, __clzsi2, __clzdi2, __ctzsi2, __ctzdi2, __popcountsi2, __popcountdi2, __paritysi2, __paritydi2): Change return type to "int". Shuffle declarations and undef int trap. * libgcc2.h: Remove their declarations. * optabs.c (expand_unop): Force outmode to int for bitops. From-SVN: r62353
2003-02-01libgcc2.c: Include auto-host.h.Richard Henderson1-58/+67
* libgcc2.c: Include auto-host.h. (ATTRIBUTE_HIDDEN): New. (__clz_tab): Don't declare here for clz and ctz. (__clzsi2, __clzdi2): Use count_leading_zeros. (__ctzsi2, __ctzdi2): Use count_trailing_zeros. (__popcount_tab): Mark ATTRIBUTE_HIDDEN. (__paritysi2, __paritydi2): Use shifts instead of __popcount_tab. * longlong.h (__clz_tab): Mark ATTRIBUTE_HIDDEN. From-SVN: r62256