From ef5eb79dfd52ab58c3188eb5ca2ba0ad42328570 Mon Sep 17 00:00:00 2001 From: Iain Sandoe Date: Sun, 12 May 2019 19:26:16 +0000 Subject: darwin, powerpc - set .machine in an asm file. The asm file fails to build if we use a modern assembler which checks that the machine is consistent with the filetype. Fixed by adjusting in a similar manner to other assembler. libgcc/ 2019-05-12 Iain Sandoe * config/rs6000/darwin-vecsave.S: Set .machine appropriately. From-SVN: r271111 --- libgcc/ChangeLog | 4 ++++ libgcc/config/rs6000/darwin-vecsave.S | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index c3c7a16..cf04573 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,7 @@ +2019-05-12 Iain Sandoe + + * config/rs6000/darwin-vecsave.S: Set .machine appropriately. + 2019-05-07 Hongtao Liu * config/i386/cpuinfo.c (get_available_features): Detect BF16. diff --git a/libgcc/config/rs6000/darwin-vecsave.S b/libgcc/config/rs6000/darwin-vecsave.S index 7a4f509..df10b6f 100644 --- a/libgcc/config/rs6000/darwin-vecsave.S +++ b/libgcc/config/rs6000/darwin-vecsave.S @@ -31,8 +31,14 @@ (4 bytes) to do the operation; for Vector regs, 2 instructions are required (8 bytes.). */ +/* With some assemblers, we need the correct machine directive to get the + right CPU type / subtype in the file header. */ +#if __ppc64__ + .machine ppc64 +#else .machine ppc7400 -.text +#endif + .text .align 2 .private_extern saveVEC -- cgit v1.1 From ccd1242eecec3939e165ee5876bd8e4961654dae Mon Sep 17 00:00:00 2001 From: Rainer Orth Date: Tue, 14 May 2019 17:17:23 +0000 Subject: Remove obsolete Solaris 10 support libstdc++-v3: * config/os/solaris/solaris2.10: Move to ... * config/os/solaris: ... this. * configure.host (os_include_dir): Adapt. (abi_baseline_pair): Remove Solaris 10 handling. * config/abi/post/i386-solaris2.10: Remove. * config/abi/post/sparc-solaris2.10: Remove. * config/abi/post/i386-solaris2.11: Rename to ... * config/abi/post/i386-solaris: ... this. * config/abi/post/sparc-solaris2.11: Rename to ... * config/abi/post/sparc-solaris: ... this. * libsupc++/new_opa.cc [_GLIBCXX_HAVE_MEMALIGN] [__sun]: Remove workaround. * testsuite/ext/enc_filebuf/char/13598.cc: Remove *-*-solaris2.10 xfail. libsanitizer: * configure.ac (have_dl_iterate_phdr): Remove *-*-solaris2.10* handling. * configure: Regenerate. libgcc: * config.host: Simplify various *-*-solaris2.1[0-9]* to *-*-solaris2*. * configure.ac: Likewise. * configure: Regenerate. * config/i386/sol2-unwind.h (x86_fallback_frame_state): Remove Solaris 10 and Solaris 11 < snv_125 handling. libbacktrace: * configure.ac (have_dl_iterate_phdr): Remove *-*-solaris2.10* handling. * configure: Regenerate. gcc/testsuite: * gcc.dg/atomic/c11-atomic-exec-4.c: Simplify triplet to *-*-solaris2*. * gcc.dg/atomic/c11-atomic-exec-5.c: Likewise. * gcc.dg/c99-math-double-1.c: Likewise. * gcc.dg/c99-math-float-1.c: Likewise. * gcc.dg/c99-math-long-double-1.c: Likewise. * gcc.misc-tests/linkage.exp: Simplify triplet to x86_64-*-solaris2*. * gcc.target/i386/mcount_pic.c: Remove *-*-solaris2.10* && !gld xfail. * gcc.target/i386/pr63620.c: Likewise. * lib/target-supports.exp (check_sse_os_support_available): Remove Solaris 9/x86 workaround. gcc: * config.gcc: Move *-*-solaris2.10* from obsolete configurations to unsupported ones. Simplify x86_64-*-solaris2.1[0-9]* to x86_64-*-solaris2*. * config.host: Likewise. * config/i386/sol2.h (ASM_COMMENT_START): Remove. * config/sparc/driver-sparc.c (host_detect_local_cpu) [__sun__ && __svr4__]: Remove "brand" fallback. [!KSTAT_DATA_STRING]: Remove. * configure.ac (gcc_cv_ld_hidden): Simplify *-*-solaris2.1[0-9]* to *-*-solaris2*. (comdat_group): Likewise. (set_have_as_tls): Likewise. (gcc_cv_target_dl_iterate_phdr): Likewise. (gcc_cv_as_shf_merge): Remove Solaris 10/x86 workaround. (gcc_cv_ld_aligned_shf_merge): Remove Solaris 10/SPARC workaround. * configure: Regenerate. * doc/install.texi: Simplify Solaris target triplets. (Specific, i?86-*-solaris2*): Remove Solaris 10 references. (Specific, *-*-solaris2*): Document Solaris 10 removal. Remove Solaris 10 references. Remove obsolete Solaris bug reference. (Specific, sparc-sun-solaris2.10): Remove. From-SVN: r271183 --- libgcc/ChangeLog | 10 ++++++++++ libgcc/config.host | 6 +++--- libgcc/config/i386/sol2-unwind.h | 36 +----------------------------------- libgcc/configure | 2 +- libgcc/configure.ac | 2 +- 5 files changed, 16 insertions(+), 40 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index cf04573..5b465e6 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,13 @@ +2019-05-14 Rainer Orth + + * config.host: Simplify various *-*-solaris2.1[0-9]* to + *-*-solaris2*. + * configure.ac: Likewise. + * configure: Regenerate. + + * config/i386/sol2-unwind.h (x86_fallback_frame_state): Remove + Solaris 10 and Solaris 11 < snv_125 handling. + 2019-05-12 Iain Sandoe * config/rs6000/darwin-vecsave.S: Set .machine appropriately. diff --git a/libgcc/config.host b/libgcc/config.host index 91abc84..91fed5f 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -294,11 +294,11 @@ case ${host} in extra_parts="$extra_parts crtbeginS.o crtendS.o" else case ${host} in - i?86-*-solaris2.1[0-9]* | x86_64-*-solaris2.1[0-9]*) + i?86-*-solaris2* | x86_64-*-solaris2*) # Solaris 10+/x86 provides crt1.o, crti.o, crtn.o, and gcrt1.o as # part of the base system. ;; - sparc*-*-solaris2.1[0-9]*) + sparc*-*-solaris2*) # Solaris 10+/SPARC lacks crt1.o and gcrt1.o. extra_parts="$extra_parts crt1.o gcrt1.o" ;; @@ -703,7 +703,7 @@ i[34567]86-*-rtems*) tmake_file="$tmake_file i386/t-crtstuff t-softfp-sfdftf i386/32/t-softfp i386/t-softfp t-softfp" extra_parts="$extra_parts crti.o crtn.o" ;; -i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*) +i[34567]86-*-solaris2* | x86_64-*-solaris2*) tmake_file="$tmake_file i386/t-crtpc t-crtfm i386/t-msabi" extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o" tm_file="${tm_file} i386/elf-lib.h" diff --git a/libgcc/config/i386/sol2-unwind.h b/libgcc/config/i386/sol2-unwind.h index db5dd05..4880b38 100644 --- a/libgcc/config/i386/sol2-unwind.h +++ b/libgcc/config/i386/sol2-unwind.h @@ -144,41 +144,7 @@ x86_fallback_frame_state (struct _Unwind_Context *context, mcontext_t *mctx; long new_cfa; - if (/* Solaris 10 - ----------- - <__sighndlr+0>: push %ebp - <__sighndlr+1>: mov %esp,%ebp - <__sighndlr+3>: pushl 0x10(%ebp) - <__sighndlr+6>: pushl 0xc(%ebp) - <__sighndlr+9>: pushl 0x8(%ebp) - <__sighndlr+12>: call *0x14(%ebp) - <__sighndlr+15>: add $0xc,%esp <--- PC - <__sighndlr+18>: leave - <__sighndlr+19>: ret */ - (*(unsigned long *)(pc - 15) == 0xffec8b55 - && *(unsigned long *)(pc - 11) == 0x75ff1075 - && *(unsigned long *)(pc - 7) == 0x0875ff0c - && *(unsigned long *)(pc - 3) == 0x831455ff - && *(unsigned long *)(pc + 1) == 0xc3c90cc4) - - || /* Solaris 11 before snv_125 - -------------------------- - <__sighndlr+0> push %ebp - <__sighndlr+1> mov %esp,%ebp - <__sighndlr+4> pushl 0x10(%ebp) - <__sighndlr+6> pushl 0xc(%ebp) - <__sighndlr+9> pushl 0x8(%ebp) - <__sighndlr+12> call *0x14(%ebp) - <__sighndlr+15> add $0xc,%esp - <__sighndlr+18> leave <--- PC - <__sighndlr+19> ret */ - (*(unsigned long *)(pc - 18) == 0xffec8b55 - && *(unsigned long *)(pc - 14) == 0x7fff107f - && *(unsigned long *)(pc - 10) == 0x0875ff0c - && *(unsigned long *)(pc - 6) == 0x83145fff - && *(unsigned long *)(pc - 1) == 0xc3c90cc4) - - || /* Solaris 11 since snv_125 + if (/* Solaris 11 since snv_125 ------------------------- <__sighndlr+0> push %ebp <__sighndlr+1> mov %esp,%ebp diff --git a/libgcc/configure b/libgcc/configure index 36dbbc1..b2914de 100644 --- a/libgcc/configure +++ b/libgcc/configure @@ -5225,7 +5225,7 @@ fi # Link with -nostartfiles -nodefaultlibs since neither are present while # building libgcc. case ${host} in -i?86-*-solaris2* | x86_64-*-solaris2.1[0-9]*) +i?86-*-solaris2* | x86_64-*-solaris2*) cat > conftest.s < conftest.s < Date: Fri, 17 May 2019 14:37:39 +0000 Subject: soft-fp: Update soft-fp from glibc This patch is updating all soft-fp from glibc, most changes are copyright years update, and changes other than years update are * soft-fp/extenddftf2.c: Use "_FP_W_TYPE_SIZE < 64" to check if 4_FP_W_TYPEs are used for IEEE quad precision. * soft-fp/extendhftf2.c: Likewise. * soft-fp/extendsftf2.c: Likewise. * soft-fp/extendxftf2.c: Likewise. * soft-fp/trunctfdf2.c: Likewise. * soft-fp/trunctfhf2.c: Likewise. * soft-fp/trunctfsf2.c: Likewise. * soft-fp/trunctfxf2.c: Likewise. * config/rs6000/ibm-ldouble.c: Likewise. From-SVN: r271327 --- libgcc/ChangeLog | 13 +++++++++++++ libgcc/config/rs6000/ibm-ldouble.c | 4 ++-- libgcc/soft-fp/adddf3.c | 2 +- libgcc/soft-fp/addsf3.c | 2 +- libgcc/soft-fp/addtf3.c | 2 +- libgcc/soft-fp/divdf3.c | 2 +- libgcc/soft-fp/divsf3.c | 2 +- libgcc/soft-fp/divtf3.c | 2 +- libgcc/soft-fp/double.h | 2 +- libgcc/soft-fp/eqdf2.c | 2 +- libgcc/soft-fp/eqsf2.c | 2 +- libgcc/soft-fp/eqtf2.c | 2 +- libgcc/soft-fp/extenddftf2.c | 4 ++-- libgcc/soft-fp/extended.h | 2 +- libgcc/soft-fp/extendhftf2.c | 4 ++-- libgcc/soft-fp/extendsfdf2.c | 2 +- libgcc/soft-fp/extendsftf2.c | 4 ++-- libgcc/soft-fp/extendxftf2.c | 4 ++-- libgcc/soft-fp/fixdfdi.c | 2 +- libgcc/soft-fp/fixdfsi.c | 2 +- libgcc/soft-fp/fixdfti.c | 2 +- libgcc/soft-fp/fixhfti.c | 2 +- libgcc/soft-fp/fixsfdi.c | 2 +- libgcc/soft-fp/fixsfsi.c | 2 +- libgcc/soft-fp/fixsfti.c | 2 +- libgcc/soft-fp/fixtfdi.c | 2 +- libgcc/soft-fp/fixtfsi.c | 2 +- libgcc/soft-fp/fixtfti.c | 2 +- libgcc/soft-fp/fixunsdfdi.c | 2 +- libgcc/soft-fp/fixunsdfsi.c | 2 +- libgcc/soft-fp/fixunsdfti.c | 2 +- libgcc/soft-fp/fixunshfti.c | 2 +- libgcc/soft-fp/fixunssfdi.c | 2 +- libgcc/soft-fp/fixunssfsi.c | 2 +- libgcc/soft-fp/fixunssfti.c | 2 +- libgcc/soft-fp/fixunstfdi.c | 2 +- libgcc/soft-fp/fixunstfsi.c | 2 +- libgcc/soft-fp/fixunstfti.c | 2 +- libgcc/soft-fp/floatdidf.c | 2 +- libgcc/soft-fp/floatdisf.c | 2 +- libgcc/soft-fp/floatditf.c | 2 +- libgcc/soft-fp/floatsidf.c | 2 +- libgcc/soft-fp/floatsisf.c | 2 +- libgcc/soft-fp/floatsitf.c | 2 +- libgcc/soft-fp/floattidf.c | 2 +- libgcc/soft-fp/floattihf.c | 2 +- libgcc/soft-fp/floattisf.c | 2 +- libgcc/soft-fp/floattitf.c | 2 +- libgcc/soft-fp/floatundidf.c | 2 +- libgcc/soft-fp/floatundisf.c | 2 +- libgcc/soft-fp/floatunditf.c | 2 +- libgcc/soft-fp/floatunsidf.c | 2 +- libgcc/soft-fp/floatunsisf.c | 2 +- libgcc/soft-fp/floatunsitf.c | 2 +- libgcc/soft-fp/floatuntidf.c | 2 +- libgcc/soft-fp/floatuntihf.c | 2 +- libgcc/soft-fp/floatuntisf.c | 2 +- libgcc/soft-fp/floatuntitf.c | 2 +- libgcc/soft-fp/gedf2.c | 2 +- libgcc/soft-fp/gesf2.c | 2 +- libgcc/soft-fp/getf2.c | 2 +- libgcc/soft-fp/half.h | 2 +- libgcc/soft-fp/ledf2.c | 2 +- libgcc/soft-fp/lesf2.c | 2 +- libgcc/soft-fp/letf2.c | 2 +- libgcc/soft-fp/muldf3.c | 2 +- libgcc/soft-fp/mulsf3.c | 2 +- libgcc/soft-fp/multf3.c | 2 +- libgcc/soft-fp/negdf2.c | 2 +- libgcc/soft-fp/negsf2.c | 2 +- libgcc/soft-fp/negtf2.c | 2 +- libgcc/soft-fp/op-1.h | 2 +- libgcc/soft-fp/op-2.h | 2 +- libgcc/soft-fp/op-4.h | 2 +- libgcc/soft-fp/op-8.h | 2 +- libgcc/soft-fp/op-common.h | 2 +- libgcc/soft-fp/quad.h | 2 +- libgcc/soft-fp/single.h | 2 +- libgcc/soft-fp/soft-fp.h | 2 +- libgcc/soft-fp/subdf3.c | 2 +- libgcc/soft-fp/subsf3.c | 2 +- libgcc/soft-fp/subtf3.c | 2 +- libgcc/soft-fp/truncdfsf2.c | 2 +- libgcc/soft-fp/trunctfdf2.c | 4 ++-- libgcc/soft-fp/trunctfhf2.c | 4 ++-- libgcc/soft-fp/trunctfsf2.c | 4 ++-- libgcc/soft-fp/trunctfxf2.c | 4 ++-- libgcc/soft-fp/unorddf2.c | 2 +- libgcc/soft-fp/unordsf2.c | 2 +- libgcc/soft-fp/unordtf2.c | 2 +- 90 files changed, 111 insertions(+), 98 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 5b465e6..9dbba18 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,16 @@ +2019-05-17 H.J. Lu + + * soft-fp/extenddftf2.c: Use "_FP_W_TYPE_SIZE < 64" to check if + 4_FP_W_TYPEs are used for IEEE quad precision. + * soft-fp/extendhftf2.c: Likewise. + * soft-fp/extendsftf2.c: Likewise. + * soft-fp/extendxftf2.c: Likewise. + * soft-fp/trunctfdf2.c: Likewise. + * soft-fp/trunctfhf2.c: Likewise. + * soft-fp/trunctfsf2.c: Likewise. + * soft-fp/trunctfxf2.c: Likewise. + * config/rs6000/ibm-ldouble.c: Likewise. + 2019-05-14 Rainer Orth * config.host: Simplify various *-*-solaris2.1[0-9]* to diff --git a/libgcc/config/rs6000/ibm-ldouble.c b/libgcc/config/rs6000/ibm-ldouble.c index f9118d8..0e1c443 100644 --- a/libgcc/config/rs6000/ibm-ldouble.c +++ b/libgcc/config/rs6000/ibm-ldouble.c @@ -407,7 +407,7 @@ fmsub (double a, double b, double c) FP_UNPACK_RAW_D (C, c); /* Extend double to quad. */ -#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q +#if _FP_W_TYPE_SIZE < 64 FP_EXTEND(Q,D,4,2,X,A); FP_EXTEND(Q,D,4,2,Y,B); FP_EXTEND(Q,D,4,2,Z,C); @@ -436,7 +436,7 @@ fmsub (double a, double b, double c) FP_SUB_Q(V,U,Z); /* Truncate quad to double. */ -#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q +#if _FP_W_TYPE_SIZE < 64 V_f[3] &= 0x0007ffff; FP_TRUNC(D,Q,2,4,R,V); #else diff --git a/libgcc/soft-fp/adddf3.c b/libgcc/soft-fp/adddf3.c index 993790f..4d60ffa 100644 --- a/libgcc/soft-fp/adddf3.c +++ b/libgcc/soft-fp/adddf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a + b - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/addsf3.c b/libgcc/soft-fp/addsf3.c index ae16ae2..bf9cd84 100644 --- a/libgcc/soft-fp/addsf3.c +++ b/libgcc/soft-fp/addsf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a + b - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/addtf3.c b/libgcc/soft-fp/addtf3.c index 905f913..482c2cb 100644 --- a/libgcc/soft-fp/addtf3.c +++ b/libgcc/soft-fp/addtf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a + b - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/divdf3.c b/libgcc/soft-fp/divdf3.c index 703e141..46bbb88 100644 --- a/libgcc/soft-fp/divdf3.c +++ b/libgcc/soft-fp/divdf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a / b - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/divsf3.c b/libgcc/soft-fp/divsf3.c index 282cbf1..dbafb38 100644 --- a/libgcc/soft-fp/divsf3.c +++ b/libgcc/soft-fp/divsf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a / b - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/divtf3.c b/libgcc/soft-fp/divtf3.c index 885c70e..3f23ce7 100644 --- a/libgcc/soft-fp/divtf3.c +++ b/libgcc/soft-fp/divtf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a / b - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/double.h b/libgcc/soft-fp/double.h index 23d11cc..7f897ec 100644 --- a/libgcc/soft-fp/double.h +++ b/libgcc/soft-fp/double.h @@ -1,6 +1,6 @@ /* Software floating-point emulation. Definitions for IEEE Double Precision - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com), Jakub Jelinek (jj@ultra.linux.cz), diff --git a/libgcc/soft-fp/eqdf2.c b/libgcc/soft-fp/eqdf2.c index 5bc9b52..2a44ee3 100644 --- a/libgcc/soft-fp/eqdf2.c +++ b/libgcc/soft-fp/eqdf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 0 iff a == b, 1 otherwise - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/eqsf2.c b/libgcc/soft-fp/eqsf2.c index 0d87f95..c515044 100644 --- a/libgcc/soft-fp/eqsf2.c +++ b/libgcc/soft-fp/eqsf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 0 iff a == b, 1 otherwise - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/eqtf2.c b/libgcc/soft-fp/eqtf2.c index 5766685..5feac41 100644 --- a/libgcc/soft-fp/eqtf2.c +++ b/libgcc/soft-fp/eqtf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 0 iff a == b, 1 otherwise - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/extenddftf2.c b/libgcc/soft-fp/extenddftf2.c index 31c7263..0568ddf 100644 --- a/libgcc/soft-fp/extenddftf2.c +++ b/libgcc/soft-fp/extenddftf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a converted to IEEE quad - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -43,7 +43,7 @@ __extenddftf2 (DFtype a) FP_INIT_EXCEPTIONS; FP_UNPACK_RAW_D (A, a); -#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q +#if _FP_W_TYPE_SIZE < 64 FP_EXTEND (Q, D, 4, 2, R, A); #else FP_EXTEND (Q, D, 2, 1, R, A); diff --git a/libgcc/soft-fp/extended.h b/libgcc/soft-fp/extended.h index d279432..435be3d 100644 --- a/libgcc/soft-fp/extended.h +++ b/libgcc/soft-fp/extended.h @@ -1,6 +1,6 @@ /* Software floating-point emulation. Definitions for IEEE Extended Precision. - Copyright (C) 1999-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/extendhftf2.c b/libgcc/soft-fp/extendhftf2.c index 7f1f89e..c71ab53 100644 --- a/libgcc/soft-fp/extendhftf2.c +++ b/libgcc/soft-fp/extendhftf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return an IEEE half converted to IEEE quad - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -41,7 +41,7 @@ __extendhftf2 (HFtype a) FP_INIT_EXCEPTIONS; FP_UNPACK_RAW_H (A, a); -#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q +#if _FP_W_TYPE_SIZE < 64 FP_EXTEND (Q, H, 4, 1, R, A); #else FP_EXTEND (Q, H, 2, 1, R, A); diff --git a/libgcc/soft-fp/extendsfdf2.c b/libgcc/soft-fp/extendsfdf2.c index 6baab11..1e3ce92 100644 --- a/libgcc/soft-fp/extendsfdf2.c +++ b/libgcc/soft-fp/extendsfdf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a converted to IEEE double - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/extendsftf2.c b/libgcc/soft-fp/extendsftf2.c index e3f2e95..82b5d62 100644 --- a/libgcc/soft-fp/extendsftf2.c +++ b/libgcc/soft-fp/extendsftf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a converted to IEEE quad - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -43,7 +43,7 @@ __extendsftf2 (SFtype a) FP_INIT_EXCEPTIONS; FP_UNPACK_RAW_S (A, a); -#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q +#if _FP_W_TYPE_SIZE < 64 FP_EXTEND (Q, S, 4, 1, R, A); #else FP_EXTEND (Q, S, 2, 1, R, A); diff --git a/libgcc/soft-fp/extendxftf2.c b/libgcc/soft-fp/extendxftf2.c index 2d12da1..d9885e5 100644 --- a/libgcc/soft-fp/extendxftf2.c +++ b/libgcc/soft-fp/extendxftf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a converted to IEEE quad - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Uros Bizjak (ubizjak@gmail.com). @@ -41,7 +41,7 @@ __extendxftf2 (XFtype a) FP_INIT_TRAPPING_EXCEPTIONS; FP_UNPACK_RAW_E (A, a); -#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q +#if _FP_W_TYPE_SIZE < 64 FP_EXTEND (Q, E, 4, 4, R, A); #else FP_EXTEND (Q, E, 2, 2, R, A); diff --git a/libgcc/soft-fp/fixdfdi.c b/libgcc/soft-fp/fixdfdi.c index e29139d..a96d10d 100644 --- a/libgcc/soft-fp/fixdfdi.c +++ b/libgcc/soft-fp/fixdfdi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 64bit signed integer - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/fixdfsi.c b/libgcc/soft-fp/fixdfsi.c index 9bce678..5ccab27 100644 --- a/libgcc/soft-fp/fixdfsi.c +++ b/libgcc/soft-fp/fixdfsi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 32bit signed integer - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/fixdfti.c b/libgcc/soft-fp/fixdfti.c index ef31b16..7a09e79 100644 --- a/libgcc/soft-fp/fixdfti.c +++ b/libgcc/soft-fp/fixdfti.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert IEEE double to 128bit signed integer - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Uros Bizjak (ubizjak@gmail.com). diff --git a/libgcc/soft-fp/fixhfti.c b/libgcc/soft-fp/fixhfti.c index 76e5166..f953856 100644 --- a/libgcc/soft-fp/fixhfti.c +++ b/libgcc/soft-fp/fixhfti.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert IEEE half to 128bit signed integer - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/libgcc/soft-fp/fixsfdi.c b/libgcc/soft-fp/fixsfdi.c index d90ec6e..4da18b9 100644 --- a/libgcc/soft-fp/fixsfdi.c +++ b/libgcc/soft-fp/fixsfdi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 64bit signed integer - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/fixsfsi.c b/libgcc/soft-fp/fixsfsi.c index 367f68b..3705b9a 100644 --- a/libgcc/soft-fp/fixsfsi.c +++ b/libgcc/soft-fp/fixsfsi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 32bit signed integer - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/fixsfti.c b/libgcc/soft-fp/fixsfti.c index bfe861a..d6905fb 100644 --- a/libgcc/soft-fp/fixsfti.c +++ b/libgcc/soft-fp/fixsfti.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert IEEE single to 128bit signed integer - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Uros Bizjak (ubizjak@gmail.com). diff --git a/libgcc/soft-fp/fixtfdi.c b/libgcc/soft-fp/fixtfdi.c index 7ea934d..44f48f5 100644 --- a/libgcc/soft-fp/fixtfdi.c +++ b/libgcc/soft-fp/fixtfdi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 64bit signed integer - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/fixtfsi.c b/libgcc/soft-fp/fixtfsi.c index f71f1d5..842df9a 100644 --- a/libgcc/soft-fp/fixtfsi.c +++ b/libgcc/soft-fp/fixtfsi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 32bit signed integer - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/fixtfti.c b/libgcc/soft-fp/fixtfti.c index 7dd97b4..bddc7f8 100644 --- a/libgcc/soft-fp/fixtfti.c +++ b/libgcc/soft-fp/fixtfti.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert IEEE quad to 128bit signed integer - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Uros Bizjak (ubizjak@gmail.com). diff --git a/libgcc/soft-fp/fixunsdfdi.c b/libgcc/soft-fp/fixunsdfdi.c index d66df51..58a90e4 100644 --- a/libgcc/soft-fp/fixunsdfdi.c +++ b/libgcc/soft-fp/fixunsdfdi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 64bit unsigned integer - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/fixunsdfsi.c b/libgcc/soft-fp/fixunsdfsi.c index 0367fe1..8ed28b0 100644 --- a/libgcc/soft-fp/fixunsdfsi.c +++ b/libgcc/soft-fp/fixunsdfsi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 32bit unsigned integer - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/fixunsdfti.c b/libgcc/soft-fp/fixunsdfti.c index ffa7c20..61b5f71 100644 --- a/libgcc/soft-fp/fixunsdfti.c +++ b/libgcc/soft-fp/fixunsdfti.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert IEEE double to 128bit unsigned integer - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Uros Bizjak (ubizjak@gmail.com). diff --git a/libgcc/soft-fp/fixunshfti.c b/libgcc/soft-fp/fixunshfti.c index 81aee89..2191e4b 100644 --- a/libgcc/soft-fp/fixunshfti.c +++ b/libgcc/soft-fp/fixunshfti.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert IEEE half to 128bit unsigned integer - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/libgcc/soft-fp/fixunssfdi.c b/libgcc/soft-fp/fixunssfdi.c index 9e6851f..18ca264 100644 --- a/libgcc/soft-fp/fixunssfdi.c +++ b/libgcc/soft-fp/fixunssfdi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 64bit unsigned integer - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/fixunssfsi.c b/libgcc/soft-fp/fixunssfsi.c index c1940e8..080d53b 100644 --- a/libgcc/soft-fp/fixunssfsi.c +++ b/libgcc/soft-fp/fixunssfsi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 32bit unsigned integer - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/fixunssfti.c b/libgcc/soft-fp/fixunssfti.c index 22b0705..0f6bc24 100644 --- a/libgcc/soft-fp/fixunssfti.c +++ b/libgcc/soft-fp/fixunssfti.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert IEEE single to 128bit unsigned integer - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Uros Bizjak (ubizjak@gmail.com). diff --git a/libgcc/soft-fp/fixunstfdi.c b/libgcc/soft-fp/fixunstfdi.c index 453fa3d..de6faa4 100644 --- a/libgcc/soft-fp/fixunstfdi.c +++ b/libgcc/soft-fp/fixunstfdi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 64bit unsigned integer - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/fixunstfsi.c b/libgcc/soft-fp/fixunstfsi.c index b808146..6b45fe1 100644 --- a/libgcc/soft-fp/fixunstfsi.c +++ b/libgcc/soft-fp/fixunstfsi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 32bit unsigned integer - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/fixunstfti.c b/libgcc/soft-fp/fixunstfti.c index 13653b0..6e65ab1 100644 --- a/libgcc/soft-fp/fixunstfti.c +++ b/libgcc/soft-fp/fixunstfti.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert IEEE quad to 128bit unsigned integer - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Uros Bizjak (ubizjak@gmail.com). diff --git a/libgcc/soft-fp/floatdidf.c b/libgcc/soft-fp/floatdidf.c index a8601f3..6ecf95f 100644 --- a/libgcc/soft-fp/floatdidf.c +++ b/libgcc/soft-fp/floatdidf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 64bit signed integer to IEEE double - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/floatdisf.c b/libgcc/soft-fp/floatdisf.c index efc2bda..34f9c0a 100644 --- a/libgcc/soft-fp/floatdisf.c +++ b/libgcc/soft-fp/floatdisf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 64bit signed integer to IEEE single - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/floatditf.c b/libgcc/soft-fp/floatditf.c index e98b3fe..709a665 100644 --- a/libgcc/soft-fp/floatditf.c +++ b/libgcc/soft-fp/floatditf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 64bit signed integer to IEEE quad - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/floatsidf.c b/libgcc/soft-fp/floatsidf.c index d37f680..eabc989 100644 --- a/libgcc/soft-fp/floatsidf.c +++ b/libgcc/soft-fp/floatsidf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 32bit signed integer to IEEE double - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/floatsisf.c b/libgcc/soft-fp/floatsisf.c index f9b5975..7c302e2 100644 --- a/libgcc/soft-fp/floatsisf.c +++ b/libgcc/soft-fp/floatsisf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 32bit signed integer to IEEE single - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/floatsitf.c b/libgcc/soft-fp/floatsitf.c index 07ea026..e44889a 100644 --- a/libgcc/soft-fp/floatsitf.c +++ b/libgcc/soft-fp/floatsitf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 32bit signed integer to IEEE quad - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/floattidf.c b/libgcc/soft-fp/floattidf.c index b5d0396..889e6ae 100644 --- a/libgcc/soft-fp/floattidf.c +++ b/libgcc/soft-fp/floattidf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 128bit signed integer to IEEE double - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Uros Bizjak (ubizjak@gmail.com). diff --git a/libgcc/soft-fp/floattihf.c b/libgcc/soft-fp/floattihf.c index fdc4e84..2dc3834 100644 --- a/libgcc/soft-fp/floattihf.c +++ b/libgcc/soft-fp/floattihf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 128bit signed integer to IEEE half - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/libgcc/soft-fp/floattisf.c b/libgcc/soft-fp/floattisf.c index 619e6f9..6ea6b27 100644 --- a/libgcc/soft-fp/floattisf.c +++ b/libgcc/soft-fp/floattisf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 128bit signed integer to IEEE single - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Uros Bizjak (ubizjak@gmail.com). diff --git a/libgcc/soft-fp/floattitf.c b/libgcc/soft-fp/floattitf.c index 78319a2..1c3e891 100644 --- a/libgcc/soft-fp/floattitf.c +++ b/libgcc/soft-fp/floattitf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 128bit signed integer to IEEE quad - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Uros Bizjak (ubizjak@gmail.com). diff --git a/libgcc/soft-fp/floatundidf.c b/libgcc/soft-fp/floatundidf.c index 85b6fc7..38c8638 100644 --- a/libgcc/soft-fp/floatundidf.c +++ b/libgcc/soft-fp/floatundidf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 64bit unsigned integer to IEEE double - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/floatundisf.c b/libgcc/soft-fp/floatundisf.c index 8896ebc..0e83569 100644 --- a/libgcc/soft-fp/floatundisf.c +++ b/libgcc/soft-fp/floatundisf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 64bit unsigned integer to IEEE single - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/floatunditf.c b/libgcc/soft-fp/floatunditf.c index d1c1ca9..ba5b5c5 100644 --- a/libgcc/soft-fp/floatunditf.c +++ b/libgcc/soft-fp/floatunditf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 64bit unsigned integer to IEEE quad - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/floatunsidf.c b/libgcc/soft-fp/floatunsidf.c index a28f298..d338fb9 100644 --- a/libgcc/soft-fp/floatunsidf.c +++ b/libgcc/soft-fp/floatunsidf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 32bit unsigned integer to IEEE double - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/floatunsisf.c b/libgcc/soft-fp/floatunsisf.c index 8cede27..a44c0a8 100644 --- a/libgcc/soft-fp/floatunsisf.c +++ b/libgcc/soft-fp/floatunsisf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 32bit unsigned integer to IEEE single - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/floatunsitf.c b/libgcc/soft-fp/floatunsitf.c index 671755f..e972561 100644 --- a/libgcc/soft-fp/floatunsitf.c +++ b/libgcc/soft-fp/floatunsitf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 32bit unsigned integer to IEEE quad - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/floatuntidf.c b/libgcc/soft-fp/floatuntidf.c index 8b1eff7..ca311aa 100644 --- a/libgcc/soft-fp/floatuntidf.c +++ b/libgcc/soft-fp/floatuntidf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 128bit unsigned integer to IEEE double - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Uros Bizjak (ubizjak@gmail.com). diff --git a/libgcc/soft-fp/floatuntihf.c b/libgcc/soft-fp/floatuntihf.c index 34700d9..37423b77 100644 --- a/libgcc/soft-fp/floatuntihf.c +++ b/libgcc/soft-fp/floatuntihf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 128bit unsigned integer to IEEE half. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/libgcc/soft-fp/floatuntisf.c b/libgcc/soft-fp/floatuntisf.c index 4b61820..5cf0331 100644 --- a/libgcc/soft-fp/floatuntisf.c +++ b/libgcc/soft-fp/floatuntisf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 128bit unsigned integer to IEEE single - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Uros Bizjak (ubizjak@gmail.com). diff --git a/libgcc/soft-fp/floatuntitf.c b/libgcc/soft-fp/floatuntitf.c index 13cd873..78e7176 100644 --- a/libgcc/soft-fp/floatuntitf.c +++ b/libgcc/soft-fp/floatuntitf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 128bit unsigned integer to IEEE quad - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Uros Bizjak (ubizjak@gmail.com). diff --git a/libgcc/soft-fp/gedf2.c b/libgcc/soft-fp/gedf2.c index 840c9fb..bcefb61 100644 --- a/libgcc/soft-fp/gedf2.c +++ b/libgcc/soft-fp/gedf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 0 iff a == b, 1 iff a > b, -2 iff a ? b, -1 iff a < b - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/gesf2.c b/libgcc/soft-fp/gesf2.c index 7a3ae25..22f0b6a 100644 --- a/libgcc/soft-fp/gesf2.c +++ b/libgcc/soft-fp/gesf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 0 iff a == b, 1 iff a > b, -2 iff a ? b, -1 iff a < b - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/getf2.c b/libgcc/soft-fp/getf2.c index f418de2..6c7e38f 100644 --- a/libgcc/soft-fp/getf2.c +++ b/libgcc/soft-fp/getf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 0 iff a == b, 1 iff a > b, -2 iff a ? b, -1 iff a < b - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/half.h b/libgcc/soft-fp/half.h index a1fea7b..c7823ac 100644 --- a/libgcc/soft-fp/half.h +++ b/libgcc/soft-fp/half.h @@ -1,6 +1,6 @@ /* Software floating-point emulation. Definitions for IEEE Half Precision. - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/libgcc/soft-fp/ledf2.c b/libgcc/soft-fp/ledf2.c index b323b8e..c36148e 100644 --- a/libgcc/soft-fp/ledf2.c +++ b/libgcc/soft-fp/ledf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 0 iff a == b, 1 iff a > b, 2 iff a ? b, -1 iff a < b - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/lesf2.c b/libgcc/soft-fp/lesf2.c index 2c96c23..e323353 100644 --- a/libgcc/soft-fp/lesf2.c +++ b/libgcc/soft-fp/lesf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 0 iff a == b, 1 iff a > b, 2 iff a ? b, -1 iff a < b - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/letf2.c b/libgcc/soft-fp/letf2.c index 7e7b244..43d9f77 100644 --- a/libgcc/soft-fp/letf2.c +++ b/libgcc/soft-fp/letf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 0 iff a == b, 1 iff a > b, 2 iff a ? b, -1 iff a < b - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/muldf3.c b/libgcc/soft-fp/muldf3.c index b2df20c..71a80e2 100644 --- a/libgcc/soft-fp/muldf3.c +++ b/libgcc/soft-fp/muldf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a * b - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/mulsf3.c b/libgcc/soft-fp/mulsf3.c index 6c5c44e..582e00a 100644 --- a/libgcc/soft-fp/mulsf3.c +++ b/libgcc/soft-fp/mulsf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a * b - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/multf3.c b/libgcc/soft-fp/multf3.c index 75971c6..377abef 100644 --- a/libgcc/soft-fp/multf3.c +++ b/libgcc/soft-fp/multf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a * b - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/negdf2.c b/libgcc/soft-fp/negdf2.c index f6fe2727..1c6a22f 100644 --- a/libgcc/soft-fp/negdf2.c +++ b/libgcc/soft-fp/negdf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return -a - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/negsf2.c b/libgcc/soft-fp/negsf2.c index 1ce0090..2f589c9 100644 --- a/libgcc/soft-fp/negsf2.c +++ b/libgcc/soft-fp/negsf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return -a - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/negtf2.c b/libgcc/soft-fp/negtf2.c index 3b7f27c..77c0393 100644 --- a/libgcc/soft-fp/negtf2.c +++ b/libgcc/soft-fp/negtf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return -a - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/op-1.h b/libgcc/soft-fp/op-1.h index bafa7f4..4509fdc 100644 --- a/libgcc/soft-fp/op-1.h +++ b/libgcc/soft-fp/op-1.h @@ -1,6 +1,6 @@ /* Software floating-point emulation. Basic one-word fraction declaration and manipulation. - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com), Jakub Jelinek (jj@ultra.linux.cz), diff --git a/libgcc/soft-fp/op-2.h b/libgcc/soft-fp/op-2.h index 6020d66..96bdc41 100644 --- a/libgcc/soft-fp/op-2.h +++ b/libgcc/soft-fp/op-2.h @@ -1,6 +1,6 @@ /* Software floating-point emulation. Basic two-word fraction declaration and manipulation. - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com), Jakub Jelinek (jj@ultra.linux.cz), diff --git a/libgcc/soft-fp/op-4.h b/libgcc/soft-fp/op-4.h index b429801..65a0644 100644 --- a/libgcc/soft-fp/op-4.h +++ b/libgcc/soft-fp/op-4.h @@ -1,6 +1,6 @@ /* Software floating-point emulation. Basic four-word fraction declaration and manipulation. - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com), Jakub Jelinek (jj@ultra.linux.cz), diff --git a/libgcc/soft-fp/op-8.h b/libgcc/soft-fp/op-8.h index 4871c49..2014a8e 100644 --- a/libgcc/soft-fp/op-8.h +++ b/libgcc/soft-fp/op-8.h @@ -1,6 +1,6 @@ /* Software floating-point emulation. Basic eight-word fraction declaration and manipulation. - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com), Jakub Jelinek (jj@ultra.linux.cz) and diff --git a/libgcc/soft-fp/op-common.h b/libgcc/soft-fp/op-common.h index d6f32ae..a640679 100644 --- a/libgcc/soft-fp/op-common.h +++ b/libgcc/soft-fp/op-common.h @@ -1,5 +1,5 @@ /* Software floating-point emulation. Common operations. - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com), Jakub Jelinek (jj@ultra.linux.cz), diff --git a/libgcc/soft-fp/quad.h b/libgcc/soft-fp/quad.h index 9a9e4e7..ef860b4 100644 --- a/libgcc/soft-fp/quad.h +++ b/libgcc/soft-fp/quad.h @@ -1,6 +1,6 @@ /* Software floating-point emulation. Definitions for IEEE Quad Precision. - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com), Jakub Jelinek (jj@ultra.linux.cz), diff --git a/libgcc/soft-fp/single.h b/libgcc/soft-fp/single.h index d5c4a6d..8c71fc7 100644 --- a/libgcc/soft-fp/single.h +++ b/libgcc/soft-fp/single.h @@ -1,6 +1,6 @@ /* Software floating-point emulation. Definitions for IEEE Single Precision. - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com), Jakub Jelinek (jj@ultra.linux.cz), diff --git a/libgcc/soft-fp/soft-fp.h b/libgcc/soft-fp/soft-fp.h index a7a0133..aee8e5d 100644 --- a/libgcc/soft-fp/soft-fp.h +++ b/libgcc/soft-fp/soft-fp.h @@ -1,5 +1,5 @@ /* Software floating-point emulation. - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com), Jakub Jelinek (jj@ultra.linux.cz), diff --git a/libgcc/soft-fp/subdf3.c b/libgcc/soft-fp/subdf3.c index 10035f4..69ecf76 100644 --- a/libgcc/soft-fp/subdf3.c +++ b/libgcc/soft-fp/subdf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a - b - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/subsf3.c b/libgcc/soft-fp/subsf3.c index b0ecd7c..3d22128 100644 --- a/libgcc/soft-fp/subsf3.c +++ b/libgcc/soft-fp/subsf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a - b - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/subtf3.c b/libgcc/soft-fp/subtf3.c index 090f4af..09df5fe 100644 --- a/libgcc/soft-fp/subtf3.c +++ b/libgcc/soft-fp/subtf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a - b - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/truncdfsf2.c b/libgcc/soft-fp/truncdfsf2.c index 4db07c5..56a7593 100644 --- a/libgcc/soft-fp/truncdfsf2.c +++ b/libgcc/soft-fp/truncdfsf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Truncate IEEE double into IEEE single - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/trunctfdf2.c b/libgcc/soft-fp/trunctfdf2.c index c0d1d34..f62d541 100644 --- a/libgcc/soft-fp/trunctfdf2.c +++ b/libgcc/soft-fp/trunctfdf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Truncate IEEE quad into IEEE double - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -42,7 +42,7 @@ __trunctfdf2 (TFtype a) FP_INIT_ROUNDMODE; FP_UNPACK_SEMIRAW_Q (A, a); -#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q +#if _FP_W_TYPE_SIZE < 64 FP_TRUNC (D, Q, 2, 4, R, A); #else FP_TRUNC (D, Q, 1, 2, R, A); diff --git a/libgcc/soft-fp/trunctfhf2.c b/libgcc/soft-fp/trunctfhf2.c index 8eddd14..61d08f8 100644 --- a/libgcc/soft-fp/trunctfhf2.c +++ b/libgcc/soft-fp/trunctfhf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Truncate IEEE quad into IEEE half. - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -40,7 +40,7 @@ __trunctfhf2 (TFtype a) FP_INIT_ROUNDMODE; FP_UNPACK_SEMIRAW_Q (A, a); -#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q +#if _FP_W_TYPE_SIZE < 64 FP_TRUNC (H, Q, 1, 4, R, A); #else FP_TRUNC (H, Q, 1, 2, R, A); diff --git a/libgcc/soft-fp/trunctfsf2.c b/libgcc/soft-fp/trunctfsf2.c index 4b04d69..965e1c4 100644 --- a/libgcc/soft-fp/trunctfsf2.c +++ b/libgcc/soft-fp/trunctfsf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Truncate IEEE quad into IEEE single - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). @@ -42,7 +42,7 @@ __trunctfsf2 (TFtype a) FP_INIT_ROUNDMODE; FP_UNPACK_SEMIRAW_Q (A, a); -#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q +#if _FP_W_TYPE_SIZE < 64 FP_TRUNC (S, Q, 1, 4, R, A); #else FP_TRUNC (S, Q, 1, 2, R, A); diff --git a/libgcc/soft-fp/trunctfxf2.c b/libgcc/soft-fp/trunctfxf2.c index 391de24..0d828fa 100644 --- a/libgcc/soft-fp/trunctfxf2.c +++ b/libgcc/soft-fp/trunctfxf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Truncate IEEE quad into IEEE extended - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Uros Bizjak (ubizjak@gmail.com). @@ -41,7 +41,7 @@ __trunctfxf2 (TFtype a) FP_INIT_ROUNDMODE; FP_UNPACK_SEMIRAW_Q (A, a); -#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q +#if _FP_W_TYPE_SIZE < 64 FP_TRUNC (E, Q, 4, 4, R, A); #else FP_TRUNC (E, Q, 2, 2, R, A); diff --git a/libgcc/soft-fp/unorddf2.c b/libgcc/soft-fp/unorddf2.c index c11066a..5075207 100644 --- a/libgcc/soft-fp/unorddf2.c +++ b/libgcc/soft-fp/unorddf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 1 iff a or b is a NaN, 0 otherwise. - Copyright (C) 2006-2018 Free Software Foundation, Inc. + Copyright (C) 2006-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Joseph Myers (joseph@codesourcery.com). diff --git a/libgcc/soft-fp/unordsf2.c b/libgcc/soft-fp/unordsf2.c index b262e18..5b8fa10 100644 --- a/libgcc/soft-fp/unordsf2.c +++ b/libgcc/soft-fp/unordsf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 1 iff a or b is a NaN, 0 otherwise. - Copyright (C) 2006-2018 Free Software Foundation, Inc. + Copyright (C) 2006-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Joseph Myers (joseph@codesourcery.com). diff --git a/libgcc/soft-fp/unordtf2.c b/libgcc/soft-fp/unordtf2.c index 3d0abe5..b92e012 100644 --- a/libgcc/soft-fp/unordtf2.c +++ b/libgcc/soft-fp/unordtf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 1 iff a or b is a NaN, 0 otherwise. - Copyright (C) 2006-2018 Free Software Foundation, Inc. + Copyright (C) 2006-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Joseph Myers (joseph@codesourcery.com). -- cgit v1.1 From a9c697b88395a0f2b175ac30c59bd8c0c22d0db1 Mon Sep 17 00:00:00 2001 From: Martin Sebor Date: Fri, 17 May 2019 17:55:43 +0000 Subject: trans.c (check_inlining_for_nested_subprog): Quote reserved names. gcc/ada/ChangeLog: * gcc-interface/trans.c (check_inlining_for_nested_subprog): Quote reserved names. gcc/brig/ChangeLog: * brigfrontend/brig-control-handler.cc (brig_directive_control_handler::operator): Remove trailing newline from a diagnostic. * brigfrontend/brig-module-handler.cc (brig_directive_module_handler::operator): Remove a duplicated space from a diagnostic. gcc/c/ChangeLog: * c-decl.c (start_decl): Quote keywords, operators, and types in diagnostics. (finish_decl): Same. * c-parser.c (c_parser_asm_statement): Same. (c_parser_conditional_expression): Same. (c_parser_transaction_cancel): Same. * c-typeck.c (c_common_type): Same. (build_conditional_expr): Same. (digest_init): Same. (process_init_element): Same. (build_binary_op): Same. gcc/c-family/ChangeLog: * c-attribs.c (handle_no_sanitize_attribute): Quote identifiers, keywords, operators, and types in diagnostics. (handle_scalar_storage_order_attribute): Same. (handle_mode_attribute): Same. (handle_visibility_attribute): Same. (handle_assume_aligned_attribute): Same. (handle_no_split_stack_attribute): Same. * c-common.c (shorten_compare): Same. (c_common_truthvalue_conversion): Same. (cb_get_source_date_epoch): Same. * c-lex.c (cb_def_pragma): Quote keywords, operators, and types in diagnostics. (interpret_float): Same. * c-omp.c (c_finish_omp_for): Same. * c-opts.c (c_common_post_options): Same. * c-pch.c (c_common_pch_pragma): Same. * c-pragma.c (pop_alignment): Same. (handle_pragma_pack): Same. (apply_pragma_weak): Same. (handle_pragma_weak): Same. (handle_pragma_scalar_storage_order): Same. (handle_pragma_redefine_extname): Same. (add_to_renaming_pragma_list): Same. (maybe_apply_renaming_pragma): Same. (push_visibility): Same. (handle_pragma_visibility): Same. (handle_pragma_optimize): Same. (handle_pragma_message): Same. * c-warn.c (warn_for_omitted_condop): Same. (lvalue_error): Same. gcc/cp/ChangeLog: * call.c (print_z_candidate): Wrap diagnostic text in a gettext macro. Adjust. (print_z_candidates): Same. (build_conditional_expr_1): Quote keywords, operators, and types in diagnostics. (build_op_delete_call): Same. (maybe_print_user_conv_context): Wrap diagnostic text in a gettext macro. (convert_like_real): Same. (convert_arg_to_ellipsis): Quote keywords, operators, and types in diagnostics. (build_over_call): Same. (joust): Break up an overlong line. Wrap diagnostic text in a gettext macro. * constexpr.c (cxx_eval_check_shift_p): Spell out >= in English. (cxx_eval_constant_expression): Quote keywords, operators, and types in diagnostics. (potential_constant_expression_1): Same. * cp-gimplify.c (cp_genericize_r): Same. * cvt.c (maybe_warn_nodiscard): Quote keywords, operators, and types in diagnostics. (type_promotes_to): Same. * decl.c (check_previous_goto_1): Same. (check_goto): Same. (start_decl): Same. (cp_finish_decl): Avoid parenthesizing a sentence for consistency. (grok_op_properties): Quote keywords, operators, and types in diagnostics. * decl2.c (grokfield): Same. (coerce_delete_type): Same. * except.c (is_admissible_throw_operand_or_catch_parameter): Same. * friend.c (do_friend): Quote C++ tokens. * init.c (build_new_1): Quote keywords, operators, and types in diagnostics. (build_vec_delete_1): Same. (build_delete): Same. * lex.c (parse_strconst_pragma): Same. (handle_pragma_implementation): Same. (unqualified_fn_lookup_error): Same. * mangle.c (write_type): Same. * method.c (defaulted_late_check): Avoid two consecutive punctuators. * name-lookup.c (cp_binding_level_debug): Remove a trailing newline. (pop_everything): Same. * parser.c (cp_lexer_start_debugging): Quote a macro name. in a diagnostic (cp_lexer_stop_debugging): Same. (cp_parser_userdef_numeric_literal): Quote a C++ header name in a diagnostic. (cp_parser_nested_name_specifier_opt): Quote keywords, operators, and types in diagnostics. (cp_parser_question_colon_clause): Same. (cp_parser_asm_definition): Same. (cp_parser_init_declarator): Same. (cp_parser_template_declaration_after_parameters): Avoid capitalizing a sentence in a diagnostic. (cp_parser_omp_declare_reduction): Quote keywords, operators, and types in diagnostics. (cp_parser_transaction): Same. * pt.c (maybe_process_partial_specialization): Replace second call to permerror with inform for consistency with other uses. (expand_integer_pack): Quote keywords, operators, and types in diagnostics. * rtti.c (get_typeid): Quote keywords, operators, and types in diagnostics. (build_dynamic_cast_1): Same. * semantics.c (finish_asm_stmt): Same. (finish_label_decl): Same. (finish_bases): Same. (finish_offsetof): Same. (cp_check_omp_declare_reduction): Same. (finish_decltype_type): Same. * tree.c (handle_init_priority_attribute): Same. Add detail to diagnostics. (maybe_warn_zero_as_null_pointer_constant): Same. * typeck.c (cp_build_binary_op): Quote keywords, operators, and types in diagnostics. (cp_build_unary_op): Same. (check_for_casting_away_constness): Same. (build_static_cast): Same. (build_const_cast_1): Same. (maybe_warn_about_returning_address_of_local): Same. (check_return_expr): Same. * typeck2.c (abstract_virtuals_error_sfinae): Same. (digest_init_r): Replace a tab with spaces in a diagnostic. (build_functional_cast): Quote keywords, operators, and types in diagnostics. gcc/d/ChangeLog: * d-builtins.cc (d_init_builtins): Quote keywords, operators, and types in diagnostics. * d-codegen.cc (get_array_length): Same. Replace can't with cannot. * d-convert.cc (convert_expr): Same. * d-frontend.cc (getTypeInfoType): Quote an option name in a diagnostic. * d-lang.cc (d_handle_option): Same. (d_parse_file): Same. * decl.cc: Remove a trailing period from a diagnostic. * expr.cc: Use a directive for an apostrophe. * toir.cc: Quote keywords, operators, and types in diagnostics. * typeinfo.cc (build_typeinfo): Quote an option name in a diagnostic. gcc/fortran/ChangeLog: * gfortranspec.c (append_arg): Spell out the word "argument." gcc/ChangeLog: * config/i386/i386-expand.c (get_element_number): Quote keywords and other internal names in diagnostics. Adjust other diagnostic formatting issues noted by -Wformat-diag. * config/i386/i386-features.c (ix86_mangle_function_version_assembler_name): Same. * config/i386/i386-options.c (ix86_handle_abi_attribute): Same. * config/i386/i386.c (ix86_function_type_abi): Same. (ix86_function_ms_hook_prologue): Same. (classify_argument): Same. (ix86_expand_prologue): Same. (ix86_md_asm_adjust): Same. (ix86_memmodel_check): Same. gcc/ChangeLog: * builtins.c (expand_builtin_atomic_always_lock_free): Quote identifiers, keywords, operators, and types in diagnostics. Correct quoting, spelling, and sentence capitalization issues. (expand_builtin_atomic_is_lock_free): Same. (fold_builtin_next_arg): Same. * cfgexpand.c (expand_one_var): Same. (tree_conflicts_with_clobbers_p): Same. (expand_asm_stmt): Same. (verify_loop_structure): Same. * cgraphunit.c (process_function_and_variable_attributes): Same. * collect-utils.c (collect_execute): Same. * collect2.c (maybe_run_lto_and_relink): Same. (is_lto_object_file): Same. (scan_prog_file): Same. * convert.c (convert_to_real_1): Same. * dwarf2out.c (dwarf2out_begin_prologue): Same. * except.c (verify_eh_tree): Same. * gcc.c (execute): Same. (eval_spec_function): Same. (run_attempt): Same. (driver::set_up_specs): Same. (compare_debug_auxbase_opt_spec_function): Same. * gcov-tool.c (unlink_gcda_file): Same. (do_merge): Same. (do_rewrite): Same. * gcse.c (gcse_or_cprop_is_too_expensive): Same. * gimplify.c (gimplify_asm_expr): Same. (gimplify_adjust_omp_clauses): Same. * hsa-gen.c (gen_hsa_addr_insns): Same. (gen_hsa_insns_for_load): Same. (gen_hsa_cmp_insn_from_gimple): Same. (gen_hsa_insns_for_operation_assignment): Same. (gen_get_level): Same. (gen_hsa_alloca): Same. (omp_simple_builtin::generate): Same. (gen_hsa_atomic_for_builtin): Same. (gen_hsa_insns_for_call): Same. * input.c (dump_location_info): Same. * ipa-devirt.c (compare_virtual_tables): Same. * ira.c (ira_setup_eliminable_regset): Same. * lra-assigns.c (lra_assign): Same. * lra-constraints.c (lra_constraints): Same. * lto-streamer-in.c (lto_input_mode_table): Same. * lto-wrapper.c (get_options_from_collect_gcc_options): Same. (merge_and_complain): Same. (compile_offload_image): Same. (compile_images_for_offload_targets): Same. (debug_objcopy): Same. (run_gcc): Same. (main): Same. * opts.c (print_specific_help): Same. (parse_no_sanitize_attribute): Same. (print_help): Same. (handle_param): Same. * plugin.c (add_new_plugin): Same. (parse_plugin_arg_opt): Same. (try_init_one_plugin): Same. * print-rtl.c (debug_bb_n_slim): Quote identifiers, keywords, operators, and types in diagnostics. Correct quoting and spelling issues. * read-rtl-function.c (parse_edge_flag_token): Same. (function_reader::parse_enum_value): Same. * reg-stack.c (check_asm_stack_operands): Same. * regcprop.c (validate_value_data): Same. * sched-rgn.c (make_pass_sched_fusion): Same. * stmt.c (check_unique_operand_names): Same. * targhooks.c (default_target_option_pragma_parse): Same. * tlink.c (recompile_files): Same. * toplev.c (process_options): Same. (do_compile): Same. * trans-mem.c (diagnose_tm_1): Same. (ipa_tm_scan_irr_block): Same. (ipa_tm_diagnose_transaction): Same. * tree-cfg.c (verify_address): Same. Use get_tree_code_name to format a tree code name in a diagnostic. (verify_types_in_gimple_min_lval): Same. (verify_types_in_gimple_reference): Same. (verify_gimple_call): Same. (verify_gimple_assign_unary): Same. (verify_gimple_assign_binary): Same. (verify_gimple_assign_ternary): Same. (verify_gimple_assign_single): Same. (verify_gimple_switch): Same. (verify_gimple_label): Same. (verify_gimple_phi): Same. (verify_gimple_in_seq): Same. (verify_eh_throw_stmt_node): Same. (collect_subblocks): Same. (gimple_verify_flow_info): Same. (do_warn_unused_result): Same. * tree-inline.c (expand_call_inline): Same. * tree-into-ssa.c (update_ssa): Same. * tree.c (tree_int_cst_elt_check_failed): Same. (tree_vec_elt_check_failed): Same. (omp_clause_operand_check_failed): Same. (verify_type_variant): Same. (verify_type): Same. * value-prof.c (verify_histograms): Same. * varasm.c (assemble_start_function): Same. gcc/lto/ChangeLog: * lto-dump.c (lto_main): Same. * lto.c (stream_out): Same. gcc/objc/ChangeLog: * objc-act.c (objc_begin_catch_clause): Quote keywords and options in diagnostics. (objc_build_throw_stmt): Same. (objc_finish_message_expr): Same. (get_super_receiver): Same. * objc-next-runtime-abi-01.c (objc_next_runtime_abi_01_init): Spell out "less than" in English./ * objc-next-runtime-abi-02.c (objc_next_runtime_abi_02_init): Spell out "greater" in English. gcc/testsuite/ChangeLog: * c-c++-common/Wbool-operation-1.c: Adjust text of expected diagnostics. * c-c++-common/Wvarargs-2.c: Same. * c-c++-common/Wvarargs.c: Same. * c-c++-common/pr51768.c: Same. * c-c++-common/tm/inline-asm.c: Same. * c-c++-common/tm/safe-1.c: Same. * g++.dg/asm-qual-1.C: Same. * g++.dg/asm-qual-3.C: Same. * g++.dg/conversion/dynamic1.C: Same. * g++.dg/cpp0x/constexpr-89599.C: Same. * g++.dg/cpp0x/constexpr-cast.C: Same. * g++.dg/cpp0x/constexpr-shift1.C: Same. * g++.dg/cpp0x/lambda/lambda-conv11.C: Same. * g++.dg/cpp0x/nullptr04.C: Same. * g++.dg/cpp0x/static_assert12.C: Same. * g++.dg/cpp0x/static_assert8.C: Same. * g++.dg/cpp1y/lambda-conv1.C: Same. * g++.dg/cpp1y/pr79393-3.C: Same. * g++.dg/cpp1y/static_assert1.C: Same. * g++.dg/cpp1z/constexpr-if4.C: Same. * g++.dg/cpp1z/constexpr-if5.C: Same. * g++.dg/cpp1z/constexpr-if9.C: Same. * g++.dg/eh/goto2.C: Same. * g++.dg/eh/goto3.C: Same. * g++.dg/expr/static_cast8.C: Same. * g++.dg/ext/flexary5.C: Same. * g++.dg/ext/utf-array-short-wchar.C: Same. * g++.dg/ext/utf-array.C: Same. * g++.dg/ext/utf8-2.C: Same. * g++.dg/gomp/loop-4.C: Same. * g++.dg/gomp/macro-4.C: Same. * g++.dg/gomp/udr-1.C: Same. * g++.dg/init/initializer-string-too-long.C: Same. * g++.dg/other/offsetof9.C: Same. * g++.dg/ubsan/pr63956.C: Same. * g++.dg/warn/Wbool-operation-1.C: Same. * g++.dg/warn/Wtype-limits-Wextra.C: Same. * g++.dg/warn/Wtype-limits.C: Same. * g++.dg/wrappers/pr88680.C: Same. * g++.old-deja/g++.mike/eh55.C: Same. * gcc.dg/Wsign-compare-1.c: Same. * gcc.dg/Wtype-limits-Wextra.c: Same. * gcc.dg/Wtype-limits.c: Same. * gcc.dg/Wunknownprag.c: Same. * gcc.dg/Wunsuffixed-float-constants-1.c: Same. * gcc.dg/asm-6.c: Same. * gcc.dg/asm-qual-1.c: Same. * gcc.dg/cast-1.c: Same. * gcc.dg/cast-2.c: Same. * gcc.dg/cast-3.c: Same. * gcc.dg/cpp/source_date_epoch-2.c: Same. * gcc.dg/debug/pr85252.c: Same. * gcc.dg/dfp/cast-bad.c: Same. * gcc.dg/format/gcc_diag-1.c: Same. * gcc.dg/format/gcc_diag-11.c: Same.New test. * gcc.dg/gcc_diag-11.c: Same.New test. * gcc.dg/gnu-cond-expr-2.c: Same. * gcc.dg/gnu-cond-expr-3.c: Same. * gcc.dg/gomp/macro-4.c: Same. * gcc.dg/init-bad-1.c: Same. * gcc.dg/init-bad-2.c: Same. * gcc.dg/init-bad-3.c: Same. * gcc.dg/pr27528.c: Same. * gcc.dg/pr48552-1.c: Same. * gcc.dg/pr48552-2.c: Same. * gcc.dg/pr59846.c: Same. * gcc.dg/pr61096-1.c: Same. * gcc.dg/pr8788-1.c: Same. * gcc.dg/pr90082.c: Same. * gcc.dg/simd-2.c: Same. * gcc.dg/spellcheck-params-2.c: Same. * gcc.dg/spellcheck-params.c: Same. * gcc.dg/strlenopt-49.c: Same. * gcc.dg/tm/pr52141.c: Same. * gcc.dg/torture/pr51106-1.c: Same. * gcc.dg/torture/pr51106-2.c: Same. * gcc.dg/utf-array-short-wchar.c: Same. * gcc.dg/utf-array.c: Same. * gcc.dg/utf8-2.c: Same. * gcc.dg/warn-sprintf-no-nul.c: Same. * gcc.target/i386/asm-flag-0.c: Same. * gcc.target/i386/inline_error.c: Same. * gcc.target/i386/pr30848.c: Same. * gcc.target/i386/pr39082-1.c: Same. * gcc.target/i386/pr39678.c: Same. * gcc.target/i386/pr57756.c: Same. * gcc.target/i386/pr68843-1.c: Same. * gcc.target/i386/pr79804.c: Same. * gcc.target/i386/pr82673.c: Same. * obj-c++.dg/class-protocol-1.mm: Same. * obj-c++.dg/exceptions-3.mm: Same. * obj-c++.dg/exceptions-4.mm: Same. * obj-c++.dg/exceptions-5.mm: Same. * obj-c++.dg/exceptions-6.mm: Same. * obj-c++.dg/method-12.mm: Same. * obj-c++.dg/method-13.mm: Same. * obj-c++.dg/method-6.mm: Same. * obj-c++.dg/method-7.mm: Same. * obj-c++.dg/method-9.mm: Same. * obj-c++.dg/method-lookup-1.mm: Same. * obj-c++.dg/proto-lossage-4.mm: Same. * obj-c++.dg/protocol-qualifier-2.mm: Same. * objc.dg/call-super-2.m: Same. * objc.dg/class-protocol-1.m: Same. * objc.dg/desig-init-1.m: Same. * objc.dg/exceptions-3.m: Same. * objc.dg/exceptions-4.m: Same. * objc.dg/exceptions-5.m: Same. * objc.dg/exceptions-6.m: Same. * objc.dg/method-19.m: Same. * objc.dg/method-2.m: Same. * objc.dg/method-5.m: Same. * objc.dg/method-6.m: Same. * objc.dg/method-7.m: Same. * objc.dg/method-lookup-1.m: Same. * objc.dg/proto-hier-1.m: Same. * objc.dg/proto-lossage-4.m: Same. From-SVN: r271338 --- libgcc/libgcov-util.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'libgcc') diff --git a/libgcc/libgcov-util.c b/libgcc/libgcov-util.c index ae0dd01..6be229b 100644 --- a/libgcc/libgcov-util.c +++ b/libgcc/libgcov-util.c @@ -332,7 +332,7 @@ read_gcda_file (const char *filename) { if (((mask & 0xff) != 0xff)) { - warning (0, "%s:tag `%x' is invalid\n", filename, tag); + warning (0, "%s:tag %qx is invalid", filename, tag); break; } tag_depth--; @@ -347,7 +347,7 @@ read_gcda_file (const char *filename) if (depth && depth < tag_depth) { if (!GCOV_TAG_IS_SUBTAG (tags[depth - 1], tag)) - warning (0, "%s:tag `%x' is incorrectly nested\n", + warning (0, "%s:tag %qx is incorrectly nested", filename, tag); } depth = tag_depth; @@ -362,18 +362,18 @@ read_gcda_file (const char *filename) actual_length = gcov_position () - base; if (actual_length > length) - warning (0, "%s:record size mismatch %lu bytes overread\n", + warning (0, "%s:record size mismatch %lu bytes overread", filename, actual_length - length); else if (length > actual_length) - warning (0, "%s:record size mismatch %lu bytes unread\n", + warning (0, "%s:record size mismatch %lu bytes unread", filename, length - actual_length); } gcov_sync (base, length); if ((error = gcov_is_error ())) { - warning (0, error < 0 ? "%s:counter overflow at %lu\n" : - "%s:read error at %lu\n", filename, + warning (0, error < 0 ? "%s:counter overflow at %lu" : + "%s:read error at %lu", filename, (long unsigned) gcov_position ()); break; } -- cgit v1.1 From 7039cebfa8da3e6309bf1792ca063497257edcd8 Mon Sep 17 00:00:00 2001 From: Kwok Cheung Yeung Date: Wed, 22 May 2019 22:14:08 +0000 Subject: Add support for constructors and destuctors on GCN 2019-05-22 Kwok Cheung Yeung Andrew Stubbs gcc/ * config.gcc (gcc_cv_initfini_array): Set for AMD GCN. * config/gcn/gcn-run.c (init_array_kernel, fini_array_kernel): New. (kernel): Rename to... (main_kernel): ... this. (load_image): Load _init_array and _fini_array kernels. (run): Add argument for kernel to run. (main): Run init_array_kernel before main_kernel, and fini_array_kernel after. * config/gcn/gcn.c (gcn_handle_amdgpu_hsa_kernel_attribute): Allow amdgpu_hsa_kernel attribute on functions. (gcn_disable_constructors): Delete. (TARGET_ASM_CONSTRUCTOR, TARGET_ASM_DESTRUCTOR): Delete. * config/gcn/crt0.c (size_t): Define. (_init_array, _fini_array): New. (__preinit_array_start, __preinit_array_end, __init_array_start, __init_array_end, __fini_array_start, __fini_array_end): Declare weak references. Co-Authored-By: Andrew Stubbs From-SVN: r271526 --- libgcc/config/gcn/crt0.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) (limited to 'libgcc') diff --git a/libgcc/config/gcn/crt0.c b/libgcc/config/gcn/crt0.c index c0b9353..9b58029 100644 --- a/libgcc/config/gcn/crt0.c +++ b/libgcc/config/gcn/crt0.c @@ -19,5 +19,61 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ +typedef long long size_t; + /* Provide an entry point symbol to silence a linker warning. */ void _start() {} + +#ifdef USE_NEWLIB_INITFINI + +extern void __libc_init_array (void) __attribute__((weak)); +extern void __libc_fini_array (void) __attribute__((weak)); + +__attribute__((amdgpu_hsa_kernel ())) +void _init_array() +{ + __libc_init_array (); +} + +__attribute__((amdgpu_hsa_kernel ())) +void _fini_array() +{ + __libc_fini_array (); +} + +#endif + +/* These magic symbols are provided by the linker. */ +extern void (*__preinit_array_start []) (void) __attribute__((weak)); +extern void (*__preinit_array_end []) (void) __attribute__((weak)); +extern void (*__init_array_start []) (void) __attribute__((weak)); +extern void (*__init_array_end []) (void) __attribute__((weak)); +extern void (*__fini_array_start []) (void) __attribute__((weak)); +extern void (*__fini_array_end []) (void) __attribute__((weak)); + +__attribute__((amdgpu_hsa_kernel ())) +void _init_array() +{ + /* Iterate over all the init routines. */ + size_t count; + size_t i; + + count = __preinit_array_end - __preinit_array_start; + for (i = 0; i < count; i++) + __preinit_array_start[i] (); + + count = __init_array_end - __init_array_start; + for (i = 0; i < count; i++) + __init_array_start[i] (); +} + +__attribute__((amdgpu_hsa_kernel ())) +void _fini_array() +{ + size_t count; + size_t i; + + count = __fini_array_end - __fini_array_start; + for (i = count; i > 0; i--) + __fini_array_start[i-1] (); +} -- cgit v1.1 From abbb83070a7a0fb605fb215c69bdca4962f28ed1 Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Sun, 26 May 2019 15:16:50 +0000 Subject: linux-unwind.h (pa32_fallback_frame_state): Add cast. * config/pa/linux-unwind.h (pa32_fallback_frame_state): Add cast. From-SVN: r271631 --- libgcc/ChangeLog | 4 ++++ libgcc/config/pa/linux-unwind.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 9dbba18..a8cf706 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,7 @@ +2019-05-26 John David Anglin + + * config/pa/linux-unwind.h (pa32_fallback_frame_state): Add cast. + 2019-05-17 H.J. Lu * soft-fp/extenddftf2.c: Use "_FP_W_TYPE_SIZE < 64" to check if diff --git a/libgcc/config/pa/linux-unwind.h b/libgcc/config/pa/linux-unwind.h index f8a2b91..4f62ad0 100644 --- a/libgcc/config/pa/linux-unwind.h +++ b/libgcc/config/pa/linux-unwind.h @@ -130,7 +130,7 @@ pa32_fallback_frame_state (struct _Unwind_Context *context, return _URC_END_OF_STACK; frame = (struct rt_sigframe *)(sp + off); - sc = &frame->uc.uc_mcontext; + sc = (struct sigcontext *)&frame->uc.uc_mcontext; new_cfa = sc->sc_gr[30]; fs->regs.cfa_how = CFA_REG_OFFSET; -- cgit v1.1 From e54b1a92ac4c2b5f14c7fa9746dd4ee23e522542 Mon Sep 17 00:00:00 2001 From: Rainer Orth Date: Tue, 28 May 2019 17:27:51 +0000 Subject: Remove pre-Solaris 11/SPARC unwinding support * config/sparc/sol2-unwind.h [__arch64__] (sparc64_is_sighandler): Remove Solaris 9 and 10 support. (sparc_is_sighandler): Likewise. From-SVN: r271715 --- libgcc/ChangeLog | 6 +++ libgcc/config/sparc/sol2-unwind.h | 92 +-------------------------------------- 2 files changed, 8 insertions(+), 90 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index a8cf706..316c203 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,9 @@ +2019-05-28 Rainer Orth + + * config/sparc/sol2-unwind.h [__arch64__] (sparc64_is_sighandler): + Remove Solaris 9 and 10 support. + (sparc_is_sighandler): Likewise. + 2019-05-26 John David Anglin * config/pa/linux-unwind.h (pa32_fallback_frame_state): Add cast. diff --git a/libgcc/config/sparc/sol2-unwind.h b/libgcc/config/sparc/sol2-unwind.h index 8f2309e..f32cc55 100644 --- a/libgcc/config/sparc/sol2-unwind.h +++ b/libgcc/config/sparc/sol2-unwind.h @@ -67,51 +67,7 @@ sparc64_is_sighandler (unsigned int *pc, void *cfa, int *nframes) libc.so.1: : mov %i1, %o1 - : call __sighndlr - - This is the same setup as for Solaris 10, see below. */ - *nframes = 3; - - else if (cuh_pattern == 0xd25fa7ef) - { - /* This matches the call_user_handler pattern in Solaris 10 - libc.so.1: - - : ldx [ %fp + 0x7ef ], %o1 - : call __sighndlr - - There are 2 cases so we look for the return address of the - caller's caller frame in order to do more pattern matching. */ - unsigned long sah_address = *(unsigned long *)(cfa + 176 + 15*8); - - if (sah_address && *(unsigned int *)(sah_address - 4) == 0x92100019) - /* We need to move up three frames: - - <-- context->cfa - __sighndlr - call_user_handler - sigacthandler - */ - *nframes = 3; - else - /* The sigacthandler frame isn't present in the chain. - We need to move up two frames: - - <-- context->cfa - __sighndlr - call_user_handler - */ - *nframes = 2; - } - - else if (cuh_pattern == 0x9410001a || cuh_pattern == 0x9410001b) - /* This matches the call_user_handler pattern in Solaris 9 - libthread.so.1: - - : mov %i2, %o2 - : call __sighndlr - - This is the same setup as for Solaris 10, see above. */ + : call __sighndlr */ *nframes = 3; return 1; @@ -184,51 +140,7 @@ sparc_is_sighandler (unsigned int *pc, void *cfa, int *nframes) libc.so.1: : mov %i1, %o1 - : call __sighndlr - - This is the same setup as for Solaris 10, see below. */ - *nframes = 3; - - else if (cuh_pattern == 0xd407a04c) - { - /* This matches the call_user_handler pattern in Solaris 10 - libc.so.1: - - : ld [ %fp + 0x4c ], %o2 - : call __sighndlr - - There are 2 cases so we look for the return address of the - caller's caller frame in order to do more pattern matching. */ - unsigned int sah_address = *(unsigned int *)(cfa + 96 + 15*4); - - if (sah_address && *(unsigned int *)(sah_address - 4) == 0x92100019) - /* We need to move up three frames: - - <-- context->cfa - __sighndlr - call_user_handler - sigacthandler - */ - *nframes = 3; - else - /* The sigacthandler frame isn't present in the chain. - We need to move up two frames: - - <-- context->cfa - __sighndlr - call_user_handler - */ - *nframes = 2; - } - - else if (cuh_pattern == 0x9410001a || cuh_pattern == 0x9410001b) - /* This matches the call_user_handler pattern in Solaris 9 - libthread.so.1: - - : mov %i2, %o2 - : call __sighndlr - - This is the same setup as for Solaris 10, see above. */ + : call __sighndlr */ *nframes = 3; return 1; -- cgit v1.1 From 8fc16d725206f2c40bae423d7d0d93bd1baf6da2 Mon Sep 17 00:00:00 2001 From: Sam Tebbs Date: Wed, 29 May 2019 09:22:17 +0000 Subject: [PATCH 3/3][GCC][AARCH64] Add support for pointer authentication B key gcc/ 2019-05-29 Sam Tebbs * config/aarch64/aarch64-builtins.c (aarch64_builtins): Add AARCH64_PAUTH_BUILTIN_AUTIB1716 and AARCH64_PAUTH_BUILTIN_PACIB1716. * config/aarch64/aarch64-builtins.c (aarch64_init_pauth_hint_builtins): Add autib1716 and pacib1716 initialisation. * config/aarch64/aarch64-builtins.c (aarch64_expand_builtin): Add checks for autib1716 and pacib1716. * config/aarch64/aarch64-protos.h (aarch64_key_type, aarch64_post_cfi_startproc): Define. * config/aarch64/aarch64-protos.h (aarch64_ra_sign_key): Define extern. * config/aarch64/aarch64.c (aarch64_handle_standard_branch_protection, aarch64_handle_pac_ret_protection): Set default sign key to A. * config/aarch64/aarch64.c (aarch64_expand_epilogue, aarch64_expand_prologue): Add check for b-key. * config/aarch64/aarch64.c (aarch64_ra_sign_key, aarch64_post_cfi_startproc, aarch64_handle_pac_ret_b_key): Define. * config/aarch64/aarch64.h (TARGET_ASM_POST_CFI_STARTPROC): Define. * config/aarch64/aarch64.c (aarch64_pac_ret_subtypes): Add "b-key". * config/aarch64/aarch64.md (unspec): Add UNSPEC_AUTIA1716, UNSPEC_AUTIB1716, UNSPEC_AUTIASP, UNSPEC_AUTIBSP, UNSPEC_PACIA1716, UNSPEC_PACIB1716, UNSPEC_PACIASP, UNSPEC_PACIBSP. * config/aarch64/aarch64.md (do_return): Add check for b-key. * config/aarch64/aarch64.md (sp): Replace pauth_hint_num_a with pauth_hint_num. * config/aarch64/aarch64.md (1716): Replace pauth_hint_num_a with pauth_hint_num. * config/aarch64/aarch64.opt (msign-return-address=): Deprecate. * config/aarch64/iterators.md (PAUTH_LR_SP): Add UNSPEC_AUTIASP, UNSPEC_AUTIBSP, UNSPEC_PACIASP, UNSPEC_PACIBSP. * config/aarch64/iterators.md (PAUTH_17_16): Add UNSPEC_AUTIA1716, UNSPEC_AUTIB1716, UNSPEC_PACIA1716, UNSPEC_PACIB1716. * config/aarch64/iterators.md (pauth_mnem_prefix): Add UNSPEC_AUTIA1716, UNSPEC_AUTIB1716, UNSPEC_PACIA1716, UNSPEC_PACIB1716, UNSPEC_AUTIASP, UNSPEC_AUTIBSP, UNSPEC_PACIASP, UNSPEC_PACIBSP. * config/aarch64/iterators.md (pauth_hint_num_a): Replace UNSPEC_PACI1716 and UNSPEC_AUTI1716 with UNSPEC_PACIA1716 and UNSPEC_AUTIA1716 respectively. * config/aarch64/iterators.md (pauth_hint_num_a): Rename to pauth_hint_num and add UNSPEC_PACIBSP, UNSPEC_AUTIBSP, UNSPEC_PACIB1716, UNSPEC_AUTIB1716. * doc/invoke.texi (-mbranch-protection): Add b-key type. * config/aarch64/aarch64-bti-insert.c (aarch64_pac_insn_p): Rename UNSPEC_PACISP to UNSPEC_PACIASP and UNSPEC_PACIBSP. gcc/testsuite 2019-05-29 Sam Tebbs * gcc.target/aarch64/return_address_sign_b_1.c: New file. * gcc.target/aarch64/return_address_sign_b_2.c: New file. * gcc.target/aarch64/return_address_sign_b_3.c: New file. * gcc.target/aarch64/return_address_sign_b_exception.c: New file. * gcc.target/aarch64/return_address_sign_ab_exception.c: New file. * gcc.target/aarch64/return_address_sign_builtin.c: New file libgcc/ 2019-05-29 Sam Tebbs * config/aarch64/aarch64-unwind.h (aarch64_cie_signed_with_b_key): New function. * config/aarch64/aarch64-unwind.h (aarch64_post_extract_frame_addr, aarch64_post_frob_eh_handler_addr): Add check for b-key. * config/aarch64/aarch64-unwind-h (aarch64_post_extract_frame_addr, aarch64_post_frob_eh_handler_addr, aarch64_post_frob_update_context): Rename RA_A_SIGNED_BIT to RA_SIGNED_BIT. * unwind-dw2-fde.c (get_cie_encoding): Add check for 'B' in augmentation string. * unwind-dw2.c (extract_cie_info): Add check for 'B' in augmentation string. (RA_A_SIGNED_BIT): Rename to RA_SIGNED_BIT. From-SVN: r271735 --- libgcc/ChangeLog | 15 +++++++++++++++ libgcc/config/aarch64/aarch64-unwind.h | 32 ++++++++++++++++++++++++++++---- libgcc/unwind-dw2-fde.c | 3 +++ libgcc/unwind-dw2.c | 10 ++++++++-- 4 files changed, 54 insertions(+), 6 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 316c203..c86decf 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,18 @@ +2019-05-29 Sam Tebbs + + * config/aarch64/aarch64-unwind.h (aarch64_cie_signed_with_b_key): New + function. + * config/aarch64/aarch64-unwind.h (aarch64_post_extract_frame_addr, + aarch64_post_frob_eh_handler_addr): Add check for b-key. + * config/aarch64/aarch64-unwind-h (aarch64_post_extract_frame_addr, + aarch64_post_frob_eh_handler_addr, aarch64_post_frob_update_context): + Rename RA_A_SIGNED_BIT to RA_SIGNED_BIT. + * unwind-dw2-fde.c (get_cie_encoding): Add check for 'B' in augmentation + string. + * unwind-dw2.c (extract_cie_info): Add check for 'B' in augmentation + string. + (RA_A_SIGNED_BIT): Rename to RA_SIGNED_BIT. + 2019-05-28 Rainer Orth * config/sparc/sol2-unwind.h [__arch64__] (sparc64_is_sighandler): diff --git a/libgcc/config/aarch64/aarch64-unwind.h b/libgcc/config/aarch64/aarch64-unwind.h index 223ac91..13e6e4a 100644 --- a/libgcc/config/aarch64/aarch64-unwind.h +++ b/libgcc/config/aarch64/aarch64-unwind.h @@ -35,6 +35,23 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define MD_FROB_UPDATE_CONTEXT(context, fs) \ aarch64_frob_update_context (context, fs) +static inline int +aarch64_cie_signed_with_b_key (struct _Unwind_Context *context) +{ + const struct dwarf_fde *fde = _Unwind_Find_FDE (context->bases.func, + &context->bases); + if (fde != NULL) + { + const struct dwarf_cie *cie = get_cie (fde); + if (cie != NULL) + { + char *aug_str = cie->augmentation; + return strchr (aug_str, 'B') == NULL ? 0 : 1; + } + } + return 0; +} + /* Do AArch64 private extraction on ADDR based on context info CONTEXT and unwind frame info FS. If ADDR is signed, we do address authentication on it using CFA of current frame. */ @@ -43,9 +60,11 @@ static inline void * aarch64_post_extract_frame_addr (struct _Unwind_Context *context, _Unwind_FrameState *fs, void *addr) { - if (fs->regs.reg[DWARF_REGNUM_AARCH64_RA_STATE].loc.offset & 0x1) + if (context->flags & RA_SIGNED_BIT) { _Unwind_Word salt = (_Unwind_Word) context->cfa; + if (aarch64_cie_signed_with_b_key (context) != 0) + return __builtin_aarch64_autib1716 (addr, salt); return __builtin_aarch64_autia1716 (addr, salt); } else @@ -62,9 +81,14 @@ aarch64_post_frob_eh_handler_addr (struct _Unwind_Context *current, ATTRIBUTE_UNUSED, void *handler_addr) { - if (current->flags & RA_A_SIGNED_BIT) - return __builtin_aarch64_pacia1716 (handler_addr, + if (current->flags & RA_SIGNED_BIT) + { + if (aarch64_cie_signed_with_b_key (current)) + return __builtin_aarch64_pacib1716 (handler_addr, + (_Unwind_Word) current->cfa); + return __builtin_aarch64_pacia1716 (handler_addr, (_Unwind_Word) current->cfa); + } else return handler_addr; } @@ -79,7 +103,7 @@ aarch64_frob_update_context (struct _Unwind_Context *context, { if (fs->regs.reg[DWARF_REGNUM_AARCH64_RA_STATE].loc.offset & 0x1) /* The flag is used for re-authenticating EH handler's address. */ - context->flags |= RA_A_SIGNED_BIT; + context->flags |= RA_SIGNED_BIT; return; } diff --git a/libgcc/unwind-dw2-fde.c b/libgcc/unwind-dw2-fde.c index 24b4ece..40ebf85 100644 --- a/libgcc/unwind-dw2-fde.c +++ b/libgcc/unwind-dw2-fde.c @@ -334,6 +334,9 @@ get_cie_encoding (const struct dwarf_cie *cie) /* LSDA encoding. */ else if (*aug == 'L') p++; + /* aarch64 b-key pointer authentication. */ + else if (*aug == 'B') + p++; /* Otherwise end of string, or unknown augmentation. */ else return DW_EH_PE_absptr; diff --git a/libgcc/unwind-dw2.c b/libgcc/unwind-dw2.c index e6130af..e76a1cb 100644 --- a/libgcc/unwind-dw2.c +++ b/libgcc/unwind-dw2.c @@ -136,8 +136,9 @@ struct _Unwind_Context #define SIGNAL_FRAME_BIT ((~(_Unwind_Word) 0 >> 1) + 1) /* Context which has version/args_size/by_value fields. */ #define EXTENDED_CONTEXT_BIT ((~(_Unwind_Word) 0 >> 2) + 1) - /* Bit reserved on AArch64, return address has been signed with A key. */ -#define RA_A_SIGNED_BIT ((~(_Unwind_Word) 0 >> 3) + 1) + /* Bit reserved on AArch64, return address has been signed with A or B + key. */ +#define RA_SIGNED_BIT ((~(_Unwind_Word) 0 >> 3) + 1) _Unwind_Word flags; /* 0 for now, can be increased when further fields are added to struct _Unwind_Context. */ @@ -502,6 +503,11 @@ extract_cie_info (const struct dwarf_cie *cie, struct _Unwind_Context *context, fs->signal_frame = 1; aug += 1; } + /* aarch64 B-key pointer authentication. */ + else if (aug[0] == 'B') + { + aug += 1; + } /* Otherwise we have an unknown augmentation string. Bail unless we saw a 'z' prefix. */ -- cgit v1.1 From 76aaa9cdb1cc5cecc7dd87594aaaff6f67c362d2 Mon Sep 17 00:00:00 2001 From: Yoshinori Sato Date: Thu, 30 May 2019 03:36:06 +0900 Subject: config.gcc (rx-*-linux*): New target. * config.gcc (rx-*-linux*): New target. * config/rx/elf.opt: New file. * config/rx/linux.h: Likewise. * config/rx/t-linux: Likewise. * config/rx/rx.c (TARGET_SAVE_ACC_REGISTER): If not defined, make it zero. * config/rx/rx.h (ASM_APP_ON): Allow to be overridden. (ASM_APP_OFF): Likewise. * config/rx/rx.opt: Drop -msim and -mas100-syntax, they were moved elsewhere. * config.host (rx-*-linux*): Add new case. * config/rx/t-rx (HOST_LIBGCC2_CFLAGS): Force DFmode to SFmode. From-SVN: r271748 --- libgcc/ChangeLog | 5 +++++ libgcc/config.host | 3 +++ libgcc/config/rx/t-rx | 1 + 3 files changed, 9 insertions(+) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index c86decf..082fabc 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +2019-05-29 Yoshinori Sato + + * config.host (rx-*-linux*): Add new case. + * config/rx/t-rx (HOST_LIBGCC2_CFLAGS): Force DFmode to SFmode. + 2019-05-29 Sam Tebbs * config/aarch64/aarch64-unwind.h (aarch64_cie_signed_with_b_key): New diff --git a/libgcc/config.host b/libgcc/config.host index 91fed5f..ff2f0fa 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -1211,6 +1211,9 @@ rx-*-elf) tmake_file="rx/t-rx t-fdpbit" tm_file="$tm_file rx/rx-abi.h rx/rx-lib.h" ;; +rx-*-linux*) + tmake_file="rx/t-rx" + ;; s390-*-linux*) tmake_file="${tmake_file} s390/t-crtstuff s390/t-linux s390/32/t-floattodi t-stack s390/t-stack-s390" md_unwind_header=s390/linux-unwind.h diff --git a/libgcc/config/rx/t-rx b/libgcc/config/rx/t-rx index ace3b16..34cdc97 100644 --- a/libgcc/config/rx/t-rx +++ b/libgcc/config/rx/t-rx @@ -23,6 +23,7 @@ # the normal libgcc sources: LIB2ADD = $(srcdir)/config/rx/rx-abi-functions.c +HOST_LIBGCC2_CFLAGS += -DDF=SF # We need special handling of the floating point conversion -- cgit v1.1 From 781d39f26e0d5e9b8a0234525d8930e1d1f938bf Mon Sep 17 00:00:00 2001 From: David Edelsohn Date: Wed, 5 Jun 2019 16:45:57 +0000 Subject: aix-unwind.h (LR_REGNO): Rename to R_LR. * config/rs6000/aix-unwind.h (LR_REGNO): Rename to R_LR. (CR2_REGNO): Rename to R_CR2. (XER_REGNO): Rename to R_XER. (FIRST_ALTIVEC_REGNO): Rename to R_FIRST_ALTIVEC. (VRSAVE_REGNO): Rename to R_VRSAVE. (VSCR_REGNO): R_VSCR. From-SVN: r271967 --- libgcc/ChangeLog | 9 +++++++++ libgcc/config/rs6000/aix-unwind.h | 28 ++++++++++++++-------------- 2 files changed, 23 insertions(+), 14 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 082fabc..371876a 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,12 @@ +2019-06-05 David Edelsohn + + * config/rs6000/aix-unwind.h (LR_REGNO): Rename to R_LR. + (CR2_REGNO): Rename to R_CR2. + (XER_REGNO): Rename to R_XER. + (FIRST_ALTIVEC_REGNO): Rename to R_FIRST_ALTIVEC. + (VRSAVE_REGNO): Rename to R_VRSAVE. + (VSCR_REGNO): R_VSCR. + 2019-05-29 Yoshinori Sato * config.host (rx-*-linux*): Add new case. diff --git a/libgcc/config/rs6000/aix-unwind.h b/libgcc/config/rs6000/aix-unwind.h index ccd3615..a0e998c 100644 --- a/libgcc/config/rs6000/aix-unwind.h +++ b/libgcc/config/rs6000/aix-unwind.h @@ -24,12 +24,12 @@ /* Useful register numbers. */ -#define LR_REGNO 65 -#define CR2_REGNO 70 -#define XER_REGNO 76 -#define FIRST_ALTIVEC_REGNO 77 -#define VRSAVE_REGNO 109 -#define VSCR_REGNO 110 +#define R_LR 65 +#define R_CR2 70 +#define R_XER 76 +#define R_FIRST_ALTIVEC 77 +#define R_VRSAVE 109 +#define R_VSCR 110 /* If the current unwind info (FS) does not contain explicit info saving R2, then we have to do a minor amount of code reading to @@ -44,7 +44,7 @@ { \ unsigned int *insn \ = (unsigned int *) \ - _Unwind_GetGR ((CTX), LR_REGNO); \ + _Unwind_GetGR ((CTX), R_LR); \ if (*insn == 0xE8410028) \ _Unwind_SetGRPtr ((CTX), 2, (CTX)->cfa + 40); \ } \ @@ -56,7 +56,7 @@ { \ unsigned int *insn \ = (unsigned int *) \ - _Unwind_GetGR ((CTX), LR_REGNO); \ + _Unwind_GetGR ((CTX), R_LR); \ if (*insn == 0x80410014) \ _Unwind_SetGRPtr ((CTX), 2, (CTX)->cfa + 20); \ } \ @@ -241,9 +241,9 @@ ppc_aix_fallback_frame_state (struct _Unwind_Context *context, if (i != __LIBGCC_STACK_POINTER_REGNUM__) REGISTER_CFA_OFFSET_FOR (fs, i, &mctx->gpr[i], new_cfa); - REGISTER_CFA_OFFSET_FOR (fs, CR2_REGNO, &mctx->cr, new_cfa); - REGISTER_CFA_OFFSET_FOR (fs, XER_REGNO, &mctx->xer, new_cfa); - REGISTER_CFA_OFFSET_FOR (fs, LR_REGNO, &mctx->lr, new_cfa); + REGISTER_CFA_OFFSET_FOR (fs, R_CR2, &mctx->cr, new_cfa); + REGISTER_CFA_OFFSET_FOR (fs, R_XER, &mctx->xer, new_cfa); + REGISTER_CFA_OFFSET_FOR (fs, R_LR, &mctx->lr, new_cfa); fs->retaddr_column = RETURN_COLUMN; REGISTER_CFA_OFFSET_FOR (fs, RETURN_COLUMN, &mctx->iar, new_cfa); @@ -268,10 +268,10 @@ ppc_aix_fallback_frame_state (struct _Unwind_Context *context, for (i = 0; i < 32; i++) REGISTER_CFA_OFFSET_FOR - (fs, i+FIRST_ALTIVEC_REGNO, &vstate->regs[i], new_cfa); + (fs, i+R_FIRST_ALTIVEC, &vstate->regs[i], new_cfa); - REGISTER_CFA_OFFSET_FOR (fs, VSCR_REGNO, &vstate->vscr, new_cfa); - REGISTER_CFA_OFFSET_FOR (fs, VRSAVE_REGNO, &vstate->vrsave, new_cfa); + REGISTER_CFA_OFFSET_FOR (fs, R_VSCR, &vstate->vscr, new_cfa); + REGISTER_CFA_OFFSET_FOR (fs, R_VRSAVE, &vstate->vrsave, new_cfa); } } -- cgit v1.1 From b009eac1575fab705384306a5c877945184d7ffc Mon Sep 17 00:00:00 2001 From: James Clarke Date: Wed, 5 Jun 2019 22:27:37 +0000 Subject: crtbegin.S (__dso_handle): Put in .sdata/.sbss rather than .data/.bss so it can be accessed via... * config/ia64/crtbegin.S (__dso_handle): Put in .sdata/.sbss rather than .data/.bss so it can be accessed via gp-relative addressing. From-SVN: r271977 --- libgcc/ChangeLog | 6 ++++++ libgcc/config/ia64/crtbegin.S | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 371876a..82c124f 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,9 @@ +2019-06-05 James Clarke + + * config/ia64/crtbegin.S (__dso_handle): Put in .sdata/.sbss + rather than .data/.bss so it can be accessed via gp-relative + addressing. + 2019-06-05 David Edelsohn * config/rs6000/aix-unwind.h (LR_REGNO): Rename to R_LR. diff --git a/libgcc/config/ia64/crtbegin.S b/libgcc/config/ia64/crtbegin.S index 5b2f559..213ccd7 100644 --- a/libgcc/config/ia64/crtbegin.S +++ b/libgcc/config/ia64/crtbegin.S @@ -45,11 +45,11 @@ dtor_ptr: .type __dso_handle,@object .size __dso_handle,8 #ifdef SHARED - .section .data + .section .sdata __dso_handle: data8 __dso_handle #else - .section .bss + .section .sbss .align 8 __dso_handle: .skip 8 -- cgit v1.1 From e69a13d15dafb21eaa65ea02dbc80f5045699688 Mon Sep 17 00:00:00 2001 From: Yoshinori Sato Date: Thu, 6 Jun 2019 08:20:27 +0900 Subject: config.host (rx-*-linux*): Add t-fdpbit to tmake_file Add appropriate tm_file clause as well. * config.host (rx-*-linux*): Add t-fdpbit to tmake_file Add appropriate tm_file clause as well. * config/rx/t-rx (HOST_LIBGCC2_CFLAGS): Remove. From-SVN: r271978 --- libgcc/ChangeLog | 6 ++++++ libgcc/config.host | 3 ++- libgcc/config/rx/t-rx | 1 - 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 82c124f..93cdcda 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,9 @@ +2019-06-05 Yoshinori Sato + + * config.host (rx-*-linux*): Add t-fdpbit to tmake_file + Add appropriate tm_file clause as well. + * config/rx/t-rx (HOST_LIBGCC2_CFLAGS): Remove. + 2019-06-05 James Clarke * config/ia64/crtbegin.S (__dso_handle): Put in .sdata/.sbss diff --git a/libgcc/config.host b/libgcc/config.host index ff2f0fa..d75e2b5 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -1212,7 +1212,8 @@ rx-*-elf) tm_file="$tm_file rx/rx-abi.h rx/rx-lib.h" ;; rx-*-linux*) - tmake_file="rx/t-rx" + tmake_file="rx/t-rx t-fdpbit" + tm_file="$tm_file rx/rx-lib.h" ;; s390-*-linux*) tmake_file="${tmake_file} s390/t-crtstuff s390/t-linux s390/32/t-floattodi t-stack s390/t-stack-s390" diff --git a/libgcc/config/rx/t-rx b/libgcc/config/rx/t-rx index 34cdc97..ace3b16 100644 --- a/libgcc/config/rx/t-rx +++ b/libgcc/config/rx/t-rx @@ -23,7 +23,6 @@ # the normal libgcc sources: LIB2ADD = $(srcdir)/config/rx/rx-abi-functions.c -HOST_LIBGCC2_CFLAGS += -DDF=SF # We need special handling of the floating point conversion -- cgit v1.1 From d1b2f85f78589a2bece2f874a6021ed746209697 Mon Sep 17 00:00:00 2001 From: Jozef Lawrynowicz Date: Thu, 6 Jun 2019 09:07:36 +0000 Subject: MSP430: Put libgcc shift functions in their own section 2019-06-06 Jozef Lawrynowicz * config/msp430/slli.S (__mspabi_slli_n): Put function in its own section. (__mspabi_slli): Likewise. (__mspabi_slll_n): Likewise. (__mspabi_slll): Likewise. * config/msp430/srai.S (__mspabi_srai_n): Likewise. (__mspabi_srai): Likewise. (__mspabi_sral_n): Likewise. (__mspabi_sral): Likewise. * config/msp430/srli.S (__mspabi_srli_n): Likewise. (__mspabi_srli): Likewise. (__mspabi_srll_n): Likewise. (__mspabi_srll): Likewise. From-SVN: r271992 --- libgcc/ChangeLog | 16 ++++++++++++++++ libgcc/config/msp430/slli.S | 8 ++++++-- libgcc/config/msp430/srai.S | 8 ++++++-- libgcc/config/msp430/srli.S | 8 ++++++-- 4 files changed, 34 insertions(+), 6 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 93cdcda..2a35363 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,19 @@ +2019-06-06 Jozef Lawrynowicz + + * config/msp430/slli.S (__mspabi_slli_n): Put function in its own + section. + (__mspabi_slli): Likewise. + (__mspabi_slll_n): Likewise. + (__mspabi_slll): Likewise. + * config/msp430/srai.S (__mspabi_srai_n): Likewise. + (__mspabi_srai): Likewise. + (__mspabi_sral_n): Likewise. + (__mspabi_sral): Likewise. + * config/msp430/srli.S (__mspabi_srli_n): Likewise. + (__mspabi_srli): Likewise. + (__mspabi_srll_n): Likewise. + (__mspabi_srll): Likewise. + 2019-06-05 Yoshinori Sato * config.host (rx-*-linux*): Add t-fdpbit to tmake_file diff --git a/libgcc/config/msp430/slli.S b/libgcc/config/msp430/slli.S index 9d151a9..89ca35a 100644 --- a/libgcc/config/msp430/slli.S +++ b/libgcc/config/msp430/slli.S @@ -22,8 +22,9 @@ .text -/* Logical Left Shift - R12 -> R12 */ +/* Logical Left Shift - R12 -> R12. */ + .section .text.__mspabi_slli_n .macro _slli n .global __mspabi_slli_\n __mspabi_slli_\n: @@ -51,6 +52,7 @@ __mspabi_slli_\n: RET #endif + .section .text.__mspabi_slli 1: ADD.W #-1,R13 ADD.W R12,R12 .global __mspabi_slli @@ -63,8 +65,9 @@ __mspabi_slli: RET #endif -/* Logical Left Shift - R12:R13 -> R12:R13 */ +/* Logical Left Shift - R12:R13 -> R12:R13. */ + .section .text.__mspabi_slll_n .macro _slll n .global __mspabi_slll_\n __mspabi_slll_\n: @@ -93,6 +96,7 @@ __mspabi_slll_\n: RET #endif + .section .text.__mspabi_slll 1: ADD.W #-1,R14 ADD.W R12,R12 ADDC.W R13,R13 diff --git a/libgcc/config/msp430/srai.S b/libgcc/config/msp430/srai.S index 33c9b5e..564f798 100644 --- a/libgcc/config/msp430/srai.S +++ b/libgcc/config/msp430/srai.S @@ -22,13 +22,14 @@ .text + .section .text.__mspabi_srai_n .macro _srai n .global __mspabi_srai_\n __mspabi_srai_\n: RRA.W R12 .endm -/* Logical Right Shift - R12 -> R12 */ +/* Arithmetic Right Shift - R12 -> R12. */ _srai 15 _srai 14 _srai 13 @@ -50,6 +51,7 @@ __mspabi_srai_\n: RET #endif + .section .text.__mspabi_srai 1: ADD.W #-1,R13 RRA.W R12,R12 .global __mspabi_srai @@ -62,8 +64,9 @@ __mspabi_srai: RET #endif -/* Logical Right Shift - R12:R13 -> R12:R13 */ +/* Arithmetic Right Shift - R12:R13 -> R12:R13. */ + .section .text.__mspabi_sral_n .macro _sral n .global __mspabi_sral_\n __mspabi_sral_\n: @@ -92,6 +95,7 @@ __mspabi_sral_\n: RET #endif + .section .text.__mspabi_sral 1: ADD.W #-1,R14 RRA.W R13 RRC.W R12 diff --git a/libgcc/config/msp430/srli.S b/libgcc/config/msp430/srli.S index dbe37f6..4dd32ea 100644 --- a/libgcc/config/msp430/srli.S +++ b/libgcc/config/msp430/srli.S @@ -22,6 +22,7 @@ .text + .section .text.__mspabi_srli_n .macro _srli n .global __mspabi_srli_\n __mspabi_srli_\n: @@ -29,7 +30,7 @@ __mspabi_srli_\n: RRC.W R12 .endm -/* Logical Right Shift - R12 -> R12 */ +/* Logical Right Shift - R12 -> R12. */ _srli 15 _srli 14 _srli 13 @@ -51,6 +52,7 @@ __mspabi_srli_\n: RET #endif + .section .text.__mspabi_srli 1: ADD.W #-1,R13 CLRC RRC.W R12,R12 @@ -64,8 +66,9 @@ __mspabi_srli: RET #endif -/* Logical Right Shift - R12:R13 -> R12:R13 */ +/* Logical Right Shift - R12:R13 -> R12:R13. */ + .section .text.__mspabi_srll_n .macro _srll n .global __mspabi_srll_\n __mspabi_srll_\n: @@ -95,6 +98,7 @@ __mspabi_srll_\n: RET #endif + .section .text.__mspabi_srll 1: ADD.W #-1,R14 CLRC RRC.W R13 -- cgit v1.1 From 34a4a9c2b5d4feb349d19eb9453947bfbb8cc5f1 Mon Sep 17 00:00:00 2001 From: Iain Sandoe Date: Thu, 6 Jun 2019 19:02:54 +0000 Subject: Darwin, PowerPC, libgcc - Ensure unwinder is built with altivec enabled. When libgcc is built on Darwin, it is usually built for the earliest potential target (Darwin8, 10.4). Build for that revision default to assuming that the processor might be G3 (without vector ops) and there is an outlined function used for save/restore that checks whether the processor is G3 or G4+ at run- time. However, the unwinder itself needs to be built with the assumption of vector usage so that the relevant outlined functions are called. 2019-06-06 Iain Sandoe * config/rs6000/t-darwin: Ensure that the unwinder is built with altivec enabled. From-SVN: r272017 --- libgcc/ChangeLog | 5 +++++ libgcc/config/rs6000/t-darwin | 3 +++ 2 files changed, 8 insertions(+) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 2a35363..2eb3f27 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +2019-06-06 Iain Sandoe + + * config/rs6000/t-darwin: Ensure that the unwinder is built with + altivec enabled. + 2019-06-06 Jozef Lawrynowicz * config/msp430/slli.S (__mspabi_slli_n): Put function in its own diff --git a/libgcc/config/rs6000/t-darwin b/libgcc/config/rs6000/t-darwin index abb41fc..61da0bd 100644 --- a/libgcc/config/rs6000/t-darwin +++ b/libgcc/config/rs6000/t-darwin @@ -20,4 +20,7 @@ LIB2ADD_ST = \ # earlier OSX versions. HOST_LIBGCC2_CFLAGS += -Wa,-force_cpusubtype_ALL -mmacosx-version-min=10.4 +unwind-dw2_s.o: HOST_LIBGCC2_CFLAGS += -maltivec +unwind-dw2.o: HOST_LIBGCC2_CFLAGS += -maltivec + LIB2ADDEH += $(srcdir)/config/rs6000/darwin-fallback.c -- cgit v1.1 From e37333bad7b7df7fd9d2e5165f61c2a68b57a30d Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Fri, 7 Jun 2019 08:41:58 +0200 Subject: Remove indirect call top N counter type. 2019-06-07 Martin Liska * doc/invoke.texi: Remove param. * gcov-counter.def (GCOV_COUNTER_ICALL_TOPNV): Remove. * gcov-io.h (GCOV_ICALL_TOPN_VAL): Likewise. (GCOV_ICALL_TOPN_NCOUNTS): Likewise. * params.def (PARAM_INDIR_CALL_TOPN_PROFILE): Likewise. * profile.c (instrument_values): Remove HIST_TYPE_INDIR_CALL_TOPN. * tree-profile.c (init_ic_make_global_vars): Always build __gcov_indirect_call only. (gimple_init_gcov_profiler): Remove usage of PARAM_INDIR_CALL_TOPN_PROFILE. (gimple_gen_ic_profiler): Likewise. * value-prof.c (dump_histogram_value): Likewise. (stream_in_histogram_value): Likewise. (gimple_indirect_call_to_profile): Likewise. (gimple_find_values_to_profile): Likewise. * value-prof.h (enum hist_type): Likewise. 2019-06-07 Martin Liska * Makefile.in: Remove usage of _gcov_merge_icall_topn. * libgcov-driver.c (gcov_sort_n_vals): Remove. (gcov_sort_icall_topn_counter): Likewise. (gcov_sort_topn_counter_arrays): Likewise. (dump_one_gcov): Remove call to gcov_sort_topn_counter_arrays. * libgcov-merge.c (__gcov_merge_icall_topn): Remove. * libgcov-profiler.c (__gcov_topn_value_profiler_body): Likewise. (GCOV_ICALL_COUNTER_CLEAR_THRESHOLD): Remove. (struct indirect_call_tuple): Remove. (__gcov_indirect_call_topn_profiler): Remove. * libgcov-util.c (__gcov_icall_topn_counter_op): Remove. * libgcov.h (gcov_sort_n_vals): Remove. (L_gcov_merge_icall_topn): Likewise. (__gcov_merge_icall_topn): Likewise. (__gcov_indirect_call_topn_profiler): Likewise. From-SVN: r272030 --- libgcc/ChangeLog | 20 +++++++ libgcc/Makefile.in | 5 +- libgcc/libgcov-driver.c | 80 ---------------------------- libgcc/libgcov-merge.c | 62 --------------------- libgcc/libgcov-profiler.c | 133 ---------------------------------------------- libgcc/libgcov-util.c | 19 ------- libgcc/libgcov.h | 7 --- 7 files changed, 22 insertions(+), 304 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 2eb3f27..7ef347a 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,23 @@ +2019-06-07 Martin Liska + + * Makefile.in: Remove usage of + _gcov_merge_icall_topn. + * libgcov-driver.c (gcov_sort_n_vals): Remove. + (gcov_sort_icall_topn_counter): Likewise. + (gcov_sort_topn_counter_arrays): Likewise. + (dump_one_gcov): Remove call to gcov_sort_topn_counter_arrays. + * libgcov-merge.c (__gcov_merge_icall_topn): Remove. + * libgcov-profiler.c (__gcov_topn_value_profiler_body): + Likewise. + (GCOV_ICALL_COUNTER_CLEAR_THRESHOLD): Remove. + (struct indirect_call_tuple): Remove. + (__gcov_indirect_call_topn_profiler): Remove. + * libgcov-util.c (__gcov_icall_topn_counter_op): Remove. + * libgcov.h (gcov_sort_n_vals): Remove. + (L_gcov_merge_icall_topn): Likewise. + (__gcov_merge_icall_topn): Likewise. + (__gcov_indirect_call_topn_profiler): Likewise. + 2019-06-06 Iain Sandoe * config/rs6000/t-darwin: Ensure that the unwinder is built with diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in index ea390a5..fb77881 100644 --- a/libgcc/Makefile.in +++ b/libgcc/Makefile.in @@ -888,7 +888,7 @@ include $(iterator) # Build libgcov components. LIBGCOV_MERGE = _gcov_merge_add _gcov_merge_single \ - _gcov_merge_ior _gcov_merge_time_profile _gcov_merge_icall_topn + _gcov_merge_ior _gcov_merge_time_profile LIBGCOV_PROFILER = _gcov_interval_profiler \ _gcov_interval_profiler_atomic \ _gcov_pow2_profiler \ @@ -900,8 +900,7 @@ LIBGCOV_PROFILER = _gcov_interval_profiler \ _gcov_ior_profiler \ _gcov_ior_profiler_atomic \ _gcov_indirect_call_profiler_v3 \ - _gcov_time_profiler \ - _gcov_indirect_call_topn_profiler + _gcov_time_profiler LIBGCOV_INTERFACE = _gcov_dump _gcov_flush _gcov_fork \ _gcov_execl _gcov_execlp \ _gcov_execle _gcov_execv _gcov_execvp _gcov_execve _gcov_reset diff --git a/libgcc/libgcov-driver.c b/libgcc/libgcov-driver.c index 5dc51df..f03868e 100644 --- a/libgcc/libgcov-driver.c +++ b/libgcc/libgcov-driver.c @@ -415,84 +415,6 @@ merge_summary (int run_counted, struct gcov_summary *summary, } } -/* Sort N entries in VALUE_ARRAY in descending order. - Each entry in VALUE_ARRAY has two values. The sorting - is based on the second value. */ - -GCOV_LINKAGE void -gcov_sort_n_vals (gcov_type *value_array, int n) -{ - int j, k; - - for (j = 2; j < n; j += 2) - { - gcov_type cur_ent[2]; - - cur_ent[0] = value_array[j]; - cur_ent[1] = value_array[j + 1]; - k = j - 2; - while (k >= 0 && value_array[k + 1] < cur_ent[1]) - { - value_array[k + 2] = value_array[k]; - value_array[k + 3] = value_array[k+1]; - k -= 2; - } - value_array[k + 2] = cur_ent[0]; - value_array[k + 3] = cur_ent[1]; - } -} - -/* Sort the profile counters for all indirect call sites. Counters - for each call site are allocated in array COUNTERS. */ - -static void -gcov_sort_icall_topn_counter (const struct gcov_ctr_info *counters) -{ - int i; - gcov_type *values; - int n = counters->num; - - gcc_assert (!(n % GCOV_ICALL_TOPN_NCOUNTS)); - values = counters->values; - - for (i = 0; i < n; i += GCOV_ICALL_TOPN_NCOUNTS) - { - gcov_type *value_array = &values[i + 1]; - gcov_sort_n_vals (value_array, GCOV_ICALL_TOPN_NCOUNTS - 1); - } -} - -/* Sort topn indirect_call profile counters in GI_PTR. */ - -static void -gcov_sort_topn_counter_arrays (const struct gcov_info *gi_ptr) -{ - unsigned int i; - int f_ix; - const struct gcov_fn_info *gfi_ptr; - const struct gcov_ctr_info *ci_ptr; - - if (!gi_ptr->merge[GCOV_COUNTER_ICALL_TOPNV]) - return; - - for (f_ix = 0; (unsigned)f_ix != gi_ptr->n_functions; f_ix++) - { - gfi_ptr = gi_ptr->functions[f_ix]; - ci_ptr = gfi_ptr->ctrs; - for (i = 0; i < GCOV_COUNTERS; i++) - { - if (!gi_ptr->merge[i]) - continue; - if (i == GCOV_COUNTER_ICALL_TOPNV) - { - gcov_sort_icall_topn_counter (ci_ptr); - break; - } - ci_ptr++; - } - } -} - /* Dump the coverage counts for one gcov_info object. We merge with existing counts when possible, to avoid growing the .da files ad infinitum. We use this program's checksum to make sure we only accumulate whole program @@ -510,8 +432,6 @@ dump_one_gcov (struct gcov_info *gi_ptr, struct gcov_filename *gf, fn_buffer = 0; - gcov_sort_topn_counter_arrays (gi_ptr); - error = gcov_exit_open_gcda_file (gi_ptr, gf); if (error == -1) return; diff --git a/libgcc/libgcov-merge.c b/libgcc/libgcov-merge.c index 046ed57..702a69f 100644 --- a/libgcc/libgcov-merge.c +++ b/libgcc/libgcov-merge.c @@ -122,66 +122,4 @@ __gcov_merge_single (gcov_type *counters, unsigned n_counters) } #endif /* L_gcov_merge_single */ -#ifdef L_gcov_merge_icall_topn -/* The profile merging function used for merging indirect call counts - This function is given array COUNTERS of N_COUNTERS old counters and it - reads the same number of counters from the gcov file. */ - -void -__gcov_merge_icall_topn (gcov_type *counters, unsigned n_counters) -{ - unsigned i, j, k, m; - - gcc_assert (!(n_counters % GCOV_ICALL_TOPN_NCOUNTS)); - for (i = 0; i < n_counters; i += GCOV_ICALL_TOPN_NCOUNTS) - { - gcov_type *value_array = &counters[i + 1]; - unsigned tmp_size = 2 * (GCOV_ICALL_TOPN_NCOUNTS - 1); - gcov_type *tmp_array - = (gcov_type *) alloca (tmp_size * sizeof (gcov_type)); - - for (j = 0; j < tmp_size; j++) - tmp_array[j] = 0; - - for (j = 0; j < GCOV_ICALL_TOPN_NCOUNTS - 1; j += 2) - { - tmp_array[j] = value_array[j]; - tmp_array[j + 1] = value_array [j + 1]; - } - - /* Skip the number_of_eviction entry. */ - gcov_get_counter (); - for (k = 0; k < GCOV_ICALL_TOPN_NCOUNTS - 1; k += 2) - { - int found = 0; - gcov_type global_id = gcov_get_counter_target (); - gcov_type call_count = gcov_get_counter (); - for (m = 0; m < j; m += 2) - { - if (tmp_array[m] == global_id) - { - found = 1; - tmp_array[m + 1] += call_count; - break; - } - } - if (!found) - { - tmp_array[j] = global_id; - tmp_array[j + 1] = call_count; - j += 2; - } - } - /* Now sort the temp array */ - gcov_sort_n_vals (tmp_array, j); - - /* Now copy back the top half of the temp array */ - for (k = 0; k < GCOV_ICALL_TOPN_NCOUNTS - 1; k += 2) - { - value_array[k] = tmp_array[k]; - value_array[k + 1] = tmp_array[k + 1]; - } - } -} -#endif /* L_gcov_merge_icall_topn */ #endif /* inhibit_libc */ diff --git a/libgcc/libgcov-profiler.c b/libgcc/libgcov-profiler.c index 7116330..40f0858 100644 --- a/libgcc/libgcov-profiler.c +++ b/libgcc/libgcov-profiler.c @@ -163,139 +163,6 @@ __gcov_one_value_profiler_atomic (gcov_type *counters, gcov_type value) } #endif -#ifdef L_gcov_indirect_call_topn_profiler -/* Tries to keep track the most frequent N values in the counters where - N is specified by parameter TOPN_VAL. To track top N values, 2*N counter - entries are used. - counter[0] --- the accumative count of the number of times one entry in - in the counters gets evicted/replaced due to limited capacity. - When this value reaches a threshold, the bottom N values are - cleared. - counter[1] through counter[2*N] records the top 2*N values collected so far. - Each value is represented by two entries: count[2*i+1] is the ith value, and - count[2*i+2] is the number of times the value is seen. */ - -static void -__gcov_topn_value_profiler_body (gcov_type *counters, gcov_type value) -{ - unsigned i, found = 0, have_zero_count = 0; - gcov_type *entry; - gcov_type *lfu_entry = &counters[1]; - gcov_type *value_array = &counters[1]; - gcov_type *num_eviction = &counters[0]; - gcov_unsigned_t topn_val = GCOV_ICALL_TOPN_VAL; - - /* There are 2*topn_val values tracked, each value takes two slots in the - counter array. */ - for (i = 0; i < (topn_val << 2); i += 2) - { - entry = &value_array[i]; - if (entry[0] == value) - { - entry[1]++ ; - found = 1; - break; - } - else if (entry[1] == 0) - { - lfu_entry = entry; - have_zero_count = 1; - } - else if (entry[1] < lfu_entry[1]) - lfu_entry = entry; - } - - if (found) - return; - - /* lfu_entry is either an empty entry or an entry - with lowest count, which will be evicted. */ - lfu_entry[0] = value; - lfu_entry[1] = 1; - -#define GCOV_ICALL_COUNTER_CLEAR_THRESHOLD 3000 - - /* Too many evictions -- time to clear bottom entries to - avoid hot values bumping each other out. */ - if (!have_zero_count - && ++*num_eviction >= GCOV_ICALL_COUNTER_CLEAR_THRESHOLD) - { - unsigned i, j; - gcov_type *p, minv; - gcov_type* tmp_cnts - = (gcov_type *)alloca (topn_val * sizeof (gcov_type)); - - *num_eviction = 0; - - for (i = 0; i < topn_val; i++) - tmp_cnts[i] = 0; - - /* Find the largest topn_val values from the group of - 2*topn_val values and put them into tmp_cnts. */ - - for (i = 0; i < 2 * topn_val; i += 2) - { - p = 0; - for (j = 0; j < topn_val; j++) - { - if (!p || tmp_cnts[j] < *p) - p = &tmp_cnts[j]; - } - if (value_array[i + 1] > *p) - *p = value_array[i + 1]; - } - - minv = tmp_cnts[0]; - for (j = 1; j < topn_val; j++) - { - if (tmp_cnts[j] < minv) - minv = tmp_cnts[j]; - } - /* Zero out low value entries. */ - for (i = 0; i < 2 * topn_val; i += 2) - { - if (value_array[i + 1] < minv) - { - value_array[i] = 0; - value_array[i + 1] = 0; - } - } - } -} - -/* These two variables are used to actually track caller and callee. Keep - them in TLS memory so races are not common (they are written to often). - The variables are set directly by GCC instrumented code, so declaration - here must match one in tree-profile.c. */ - -#if defined(HAVE_CC_TLS) && !defined (USE_EMUTLS) -__thread -#endif -struct indirect_call_tuple __gcov_indirect_call_topn; - -#ifdef TARGET_VTABLE_USES_DESCRIPTORS -#define VTABLE_USES_DESCRIPTORS 1 -#else -#define VTABLE_USES_DESCRIPTORS 0 -#endif - -/* This fucntion is instrumented at function entry to track topn indirect - calls to CUR_FUNC. */ - -void -__gcov_indirect_call_topn_profiler (gcov_type value, void* cur_func) -{ - void *callee_func = __gcov_indirect_call_topn.callee; - /* If the C++ virtual tables contain function descriptors then one - function may have multiple descriptors and we need to dereference - the descriptors to see if they point to the same function. */ - if (cur_func == callee_func - || (VTABLE_USES_DESCRIPTORS && callee_func - && *(void **) cur_func == *(void **) callee_func)) - __gcov_topn_value_profiler_body (__gcov_indirect_call_topn.counters, value); -} -#endif - #ifdef L_gcov_indirect_call_profiler_v3 /* These two variables are used to actually track caller and callee. Keep diff --git a/libgcc/libgcov-util.c b/libgcc/libgcov-util.c index 6be229b..c794132 100644 --- a/libgcc/libgcov-util.c +++ b/libgcc/libgcov-util.c @@ -740,25 +740,6 @@ __gcov_single_counter_op (gcov_type *counters, unsigned n_counters, } } -/* Performing FN upon indirect-call profile counters. */ - -static void -__gcov_icall_topn_counter_op (gcov_type *counters, unsigned n_counters, - counter_op_fn fn, void *data1, void *data2) -{ - unsigned i; - - gcc_assert (!(n_counters % GCOV_ICALL_TOPN_NCOUNTS)); - for (i = 0; i < n_counters; i += GCOV_ICALL_TOPN_NCOUNTS) - { - unsigned j; - gcov_type *value_array = &counters[i + 1]; - - for (j = 0; j < GCOV_ICALL_TOPN_NCOUNTS - 1; j += 2) - value_array[j + 1] = fn (value_array[j + 1], data1, data2); - } -} - /* Scaling the counter value V by multiplying *(float*) DATA1. */ static gcov_type diff --git a/libgcc/libgcov.h b/libgcc/libgcov.h index 993db8f..b4f1ec5 100644 --- a/libgcc/libgcov.h +++ b/libgcc/libgcov.h @@ -102,7 +102,6 @@ typedef unsigned gcov_type_unsigned __attribute__ ((mode (QI))); #define gcov_read_unsigned __gcov_read_unsigned #define gcov_read_counter __gcov_read_counter #define gcov_read_summary __gcov_read_summary -#define gcov_sort_n_vals __gcov_sort_n_vals #else /* IN_GCOV_TOOL */ /* About the host. */ @@ -130,7 +129,6 @@ typedef unsigned gcov_position_t; #define L_gcov_merge_single 1 #define L_gcov_merge_ior 1 #define L_gcov_merge_time_profile 1 -#define L_gcov_merge_icall_topn 1 extern gcov_type gcov_read_counter_mem (); extern unsigned gcov_get_merge_weight (); @@ -267,9 +265,6 @@ extern void __gcov_merge_single (gcov_type *, unsigned) ATTRIBUTE_HIDDEN; /* The merge function that just ors the counters together. */ extern void __gcov_merge_ior (gcov_type *, unsigned) ATTRIBUTE_HIDDEN; -/* The merge function is used for topn indirect call counters. */ -extern void __gcov_merge_icall_topn (gcov_type *, unsigned) ATTRIBUTE_HIDDEN; - /* The profiler functions. */ extern void __gcov_interval_profiler (gcov_type *, gcov_type, int, unsigned); extern void __gcov_interval_profiler_atomic (gcov_type *, gcov_type, int, @@ -285,8 +280,6 @@ extern void __gcov_average_profiler (gcov_type *, gcov_type); extern void __gcov_average_profiler_atomic (gcov_type *, gcov_type); extern void __gcov_ior_profiler (gcov_type *, gcov_type); extern void __gcov_ior_profiler_atomic (gcov_type *, gcov_type); -extern void __gcov_indirect_call_topn_profiler (gcov_type, void *); -extern void gcov_sort_n_vals (gcov_type *, int); #ifndef inhibit_libc /* The wrappers around some library functions.. */ -- cgit v1.1 From 92d417175b9f7b41d5ebe3ceb723f808917ed964 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Mon, 10 Jun 2019 09:38:59 +0200 Subject: Implement N disk counters for single value and indirect call counters. 2019-06-10 Martin Liska * gcov-io.h (GCOV_DISK_SINGLE_VALUES): New. (GCOV_SINGLE_VALUE_COUNTERS): Likewise. * ipa-profile.c (ipa_profile_generate_summary): Use get_most_common_single_value. * tree-profile.c (gimple_init_gcov_profiler): Instrument with __gcov_one_value_profiler_v2 and __gcov_indirect_call_profiler_v4. * value-prof.c (dump_histogram_value): Print all values for HIST_TYPE_SINGLE_VALUE. (stream_out_histogram_value): Update assert for N values. (stream_in_histogram_value): Set number of counters for HIST_TYPE_SINGLE_VALUE. (get_most_common_single_value): New. (gimple_divmod_fixed_value_transform): Use get_most_common_single_value. (gimple_ic_transform): Likewise. (gimple_stringops_transform): Likewise. (gimple_find_values_to_profile): Set number of counters for HIST_TYPE_SINGLE_VALUE. * value-prof.h (get_most_common_single_value): New. 2019-06-10 Martin Liska * Makefile.in: Add __gcov_one_value_profiler_v2, __gcov_one_value_profiler_v2_atomic and __gcov_indirect_call_profiler_v4. * libgcov-merge.c (__gcov_merge_single): Change function signature. (merge_single_value_set): New. * libgcov-profiler.c (__gcov_one_value_profiler_body): Update functionality. (__gcov_one_value_profiler): Remove. (__gcov_one_value_profiler_v2): ... this. (__gcov_one_value_profiler_atomic): Rename to ... (__gcov_one_value_profiler_v2_atomic): this. (__gcov_indirect_call_profiler_v3): Rename to ... (__gcov_indirect_call_profiler_v4): ... this. * libgcov.h (__gcov_one_value_profiler): Remove. (__gcov_one_value_profiler_atomic): Remove. (__gcov_one_value_profiler_v2_atomic): New. (__gcov_indirect_call_profiler_v3): Remove. (__gcov_one_value_profiler_v2): New. (__gcov_indirect_call_profiler_v4): New. (gcov_get_counter_ignore_scaling): New function. From-SVN: r272106 --- libgcc/ChangeLog | 24 ++++++++++++++ libgcc/Makefile.in | 6 ++-- libgcc/libgcov-merge.c | 83 +++++++++++++++++++++++++++++++++-------------- libgcc/libgcov-profiler.c | 33 +++++++++---------- libgcc/libgcov.h | 29 +++++++++++++++-- 5 files changed, 126 insertions(+), 49 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 7ef347a..669041e 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,27 @@ +2019-06-10 Martin Liska + + * Makefile.in: Add __gcov_one_value_profiler_v2, + __gcov_one_value_profiler_v2_atomic and + __gcov_indirect_call_profiler_v4. + * libgcov-merge.c (__gcov_merge_single): Change + function signature. + (merge_single_value_set): New. + * libgcov-profiler.c (__gcov_one_value_profiler_body): + Update functionality. + (__gcov_one_value_profiler): Remove. + (__gcov_one_value_profiler_v2): ... this. + (__gcov_one_value_profiler_atomic): Rename to ... + (__gcov_one_value_profiler_v2_atomic): this. + (__gcov_indirect_call_profiler_v3): Rename to ... + (__gcov_indirect_call_profiler_v4): ... this. + * libgcov.h (__gcov_one_value_profiler): Remove. + (__gcov_one_value_profiler_atomic): Remove. + (__gcov_one_value_profiler_v2_atomic): New. + (__gcov_indirect_call_profiler_v3): Remove. + (__gcov_one_value_profiler_v2): New. + (__gcov_indirect_call_profiler_v4): New. + (gcov_get_counter_ignore_scaling): New function. + 2019-06-07 Martin Liska * Makefile.in: Remove usage of diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in index fb77881..33b8380 100644 --- a/libgcc/Makefile.in +++ b/libgcc/Makefile.in @@ -893,13 +893,13 @@ LIBGCOV_PROFILER = _gcov_interval_profiler \ _gcov_interval_profiler_atomic \ _gcov_pow2_profiler \ _gcov_pow2_profiler_atomic \ - _gcov_one_value_profiler \ - _gcov_one_value_profiler_atomic \ + _gcov_one_value_profiler_v2 \ + _gcov_one_value_profiler_v2_atomic \ _gcov_average_profiler \ _gcov_average_profiler_atomic \ _gcov_ior_profiler \ _gcov_ior_profiler_atomic \ - _gcov_indirect_call_profiler_v3 \ + _gcov_indirect_call_profiler_v4 \ _gcov_time_profiler LIBGCOV_INTERFACE = _gcov_dump _gcov_flush _gcov_fork \ _gcov_execl _gcov_execlp \ diff --git a/libgcc/libgcov-merge.c b/libgcc/libgcov-merge.c index 702a69f..4241634 100644 --- a/libgcc/libgcov-merge.c +++ b/libgcc/libgcov-merge.c @@ -34,8 +34,9 @@ void __gcov_merge_add (gcov_type *counters __attribute__ ((unused)), #endif #ifdef L_gcov_merge_single -void __gcov_merge_single (gcov_type *counters __attribute__ ((unused)), - unsigned n_counters __attribute__ ((unused))) {} +void __gcov_merge_single (gcov_type *counters __attribute__ ((unused))) +{ +} #endif #else @@ -85,40 +86,72 @@ __gcov_merge_time_profile (gcov_type *counters, unsigned n_counters) #endif /* L_gcov_merge_time_profile */ #ifdef L_gcov_merge_single + +static void +merge_single_value_set (gcov_type *counters) +{ + unsigned j; + gcov_type value, counter; + + /* First value is number of total executions of the profiler. */ + gcov_type all = gcov_get_counter_ignore_scaling (-1); + counters[0] += all; + ++counters; + + for (unsigned i = 0; i < GCOV_DISK_SINGLE_VALUES; i++) + { + value = gcov_get_counter_target (); + counter = gcov_get_counter_ignore_scaling (-1); + + if (counter == -1) + { + counters[1] = -1; + /* We can't return as we need to read all counters. */ + continue; + } + else if (counter == 0 || counters[1] == -1) + { + /* We can't return as we need to read all counters. */ + continue; + } + + for (j = 0; j < GCOV_DISK_SINGLE_VALUES; j++) + { + if (counters[2 * j] == value) + { + counters[2 * j + 1] += counter; + break; + } + else if (counters[2 * j + 1] == 0) + { + counters[2 * j] = value; + counters[2 * j + 1] = counter; + break; + } + } + + /* We haven't found a free slot for the value, mark overflow. */ + if (j == GCOV_DISK_SINGLE_VALUES) + counters[1] = -1; + } +} + /* The profile merging function for choosing the most common value. It is given an array COUNTERS of N_COUNTERS old counters and it reads the same number of counters from the gcov file. The counters - are split into 3-tuples where the members of the tuple have + are split into pairs where the members of the tuple have meanings: -- the stored candidate on the most common value of the measured entity -- counter - -- total number of evaluations of the value */ + */ void __gcov_merge_single (gcov_type *counters, unsigned n_counters) { - unsigned i, n_measures; - gcov_type value, counter, all; + gcc_assert (!(n_counters % GCOV_SINGLE_VALUE_COUNTERS)); - gcc_assert (!(n_counters % 3)); - n_measures = n_counters / 3; - for (i = 0; i < n_measures; i++, counters += 3) - { - value = gcov_get_counter_target (); - counter = gcov_get_counter (); - all = gcov_get_counter (); - - if (counters[0] == value) - counters[1] += counter; - else if (counter > counters[1]) - { - counters[0] = value; - counters[1] = counter - counters[1]; - } - else - counters[1] -= counter; - counters[2] += all; - } + for (unsigned i = 0; i < (n_counters / GCOV_SINGLE_VALUE_COUNTERS); i++) + merge_single_value_set (counters + (i * GCOV_SINGLE_VALUE_COUNTERS)); } #endif /* L_gcov_merge_single */ diff --git a/libgcc/libgcov-profiler.c b/libgcc/libgcov-profiler.c index 40f0858..9ba65b9 100644 --- a/libgcc/libgcov-profiler.c +++ b/libgcc/libgcov-profiler.c @@ -112,40 +112,37 @@ __gcov_pow2_profiler_atomic (gcov_type *counters, gcov_type value) COUNTERS[1] is decremented. Otherwise COUNTERS[1] is set to one and VALUE is stored to COUNTERS[0]. This algorithm guarantees that if this function is called more than 50% of the time with one value, this value - will be in COUNTERS[0] in the end. - - In any case, COUNTERS[2] is incremented. If USE_ATOMIC is set to 1, - COUNTERS[2] is updated with an atomic instruction. */ + will be in COUNTERS[0] in the end. */ static inline void __gcov_one_value_profiler_body (gcov_type *counters, gcov_type value, int use_atomic) { - if (value == counters[0]) - counters[1]++; - else if (counters[1] == 0) + if (value == counters[1]) + counters[2]++; + else if (counters[2] == 0) { - counters[1] = 1; - counters[0] = value; + counters[2] = 1; + counters[1] = value; } else - counters[1]--; + counters[2]--; if (use_atomic) - __atomic_fetch_add (&counters[2], 1, __ATOMIC_RELAXED); + __atomic_fetch_add (&counters[0], 1, __ATOMIC_RELAXED); else - counters[2]++; + counters[0]++; } -#ifdef L_gcov_one_value_profiler +#ifdef L_gcov_one_value_profiler_v2 void -__gcov_one_value_profiler (gcov_type *counters, gcov_type value) +__gcov_one_value_profiler_v2 (gcov_type *counters, gcov_type value) { __gcov_one_value_profiler_body (counters, value, 0); } #endif -#if defined(L_gcov_one_value_profiler_atomic) && GCOV_SUPPORTS_ATOMIC +#if defined(L_gcov_one_value_profiler_v2_atomic) && GCOV_SUPPORTS_ATOMIC /* Update one value profilers (COUNTERS) for a given VALUE. @@ -157,13 +154,13 @@ __gcov_one_value_profiler (gcov_type *counters, gcov_type value) https://gcc.gnu.org/ml/gcc-patches/2016-08/msg00024.html. */ void -__gcov_one_value_profiler_atomic (gcov_type *counters, gcov_type value) +__gcov_one_value_profiler_v2_atomic (gcov_type *counters, gcov_type value) { __gcov_one_value_profiler_body (counters, value, 1); } #endif -#ifdef L_gcov_indirect_call_profiler_v3 +#ifdef L_gcov_indirect_call_profiler_v4 /* These two variables are used to actually track caller and callee. Keep them in TLS memory so races are not common (they are written to often). @@ -185,7 +182,7 @@ struct indirect_call_tuple __gcov_indirect_call; /* Tries to determine the most common value among its inputs. */ void -__gcov_indirect_call_profiler_v3 (gcov_type value, void* cur_func) +__gcov_indirect_call_profiler_v4 (gcov_type value, void* cur_func) { /* If the C++ virtual tables contain function descriptors then one function may have multiple descriptors and we need to dereference diff --git a/libgcc/libgcov.h b/libgcc/libgcov.h index b4f1ec5..144b481 100644 --- a/libgcc/libgcov.h +++ b/libgcc/libgcov.h @@ -271,9 +271,9 @@ extern void __gcov_interval_profiler_atomic (gcov_type *, gcov_type, int, unsigned); extern void __gcov_pow2_profiler (gcov_type *, gcov_type); extern void __gcov_pow2_profiler_atomic (gcov_type *, gcov_type); -extern void __gcov_one_value_profiler (gcov_type *, gcov_type); -extern void __gcov_one_value_profiler_atomic (gcov_type *, gcov_type); -extern void __gcov_indirect_call_profiler_v3 (gcov_type, void *); +extern void __gcov_one_value_profiler_v2 (gcov_type *, gcov_type); +extern void __gcov_one_value_profiler_v2_atomic (gcov_type *, gcov_type); +extern void __gcov_indirect_call_profiler_v4 (gcov_type, void *); extern void __gcov_time_profiler (gcov_type *); extern void __gcov_time_profiler_atomic (gcov_type *); extern void __gcov_average_profiler (gcov_type *, gcov_type); @@ -324,6 +324,29 @@ gcov_get_counter (void) #endif } +/* Similar function as gcov_get_counter(), but do not scale + when read value is equal to IGNORE_SCALING. */ + +static inline gcov_type +gcov_get_counter_ignore_scaling (gcov_type ignore_scaling) +{ +#ifndef IN_GCOV_TOOL + /* This version is for reading count values in libgcov runtime: + we read from gcda files. */ + + return gcov_read_counter (); +#else + /* This version is for gcov-tool. We read the value from memory and + multiply it by the merge weight. */ + + gcov_type v = gcov_read_counter_mem (); + if (v != ignore_scaling) + v *= gcov_get_merge_weight (); + + return v; +#endif +} + /* Similar function as gcov_get_counter(), but handles target address counters. */ -- cgit v1.1 From 54e2d83caf591eb1ca3e6e8df44d67a4ac44d8fe Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Mon, 10 Jun 2019 11:53:46 +0200 Subject: Add missing ATTR_UNUSED (PR bootstrap/90808). 2019-06-10 Martin Liska PR bootstrap/90808 * libgcov.h: Add ATTRIBUTE_UNUSED. From-SVN: r272114 --- libgcc/ChangeLog | 5 +++++ libgcc/libgcov.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 669041e..5448567 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,5 +1,10 @@ 2019-06-10 Martin Liska + PR bootstrap/90808 + * libgcov.h: Add ATTRIBUTE_UNUSED. + +2019-06-10 Martin Liska + * Makefile.in: Add __gcov_one_value_profiler_v2, __gcov_one_value_profiler_v2_atomic and __gcov_indirect_call_profiler_v4. diff --git a/libgcc/libgcov.h b/libgcc/libgcov.h index 144b481..7f31614 100644 --- a/libgcc/libgcov.h +++ b/libgcc/libgcov.h @@ -328,7 +328,7 @@ gcov_get_counter (void) when read value is equal to IGNORE_SCALING. */ static inline gcov_type -gcov_get_counter_ignore_scaling (gcov_type ignore_scaling) +gcov_get_counter_ignore_scaling (gcov_type ignore_scaling ATTRIBUTE_UNUSED) { #ifndef IN_GCOV_TOOL /* This version is for reading count values in libgcov runtime: -- cgit v1.1 From 0d7b3e477bd705a9ff301dccd6abb729918a4551 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 11 Jun 2019 09:54:17 +0200 Subject: * libgcov-merge.c (__gcov_merge_single): Revert previous change. From-SVN: r272143 --- libgcc/ChangeLog | 4 ++++ libgcc/libgcov-merge.c | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 5448567..329e75b 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,7 @@ +2019-06-11 Jakub Jelinek + + * libgcov-merge.c (__gcov_merge_single): Revert previous change. + 2019-06-10 Martin Liska PR bootstrap/90808 diff --git a/libgcc/libgcov-merge.c b/libgcc/libgcov-merge.c index 4241634..f778cc4 100644 --- a/libgcc/libgcov-merge.c +++ b/libgcc/libgcov-merge.c @@ -34,9 +34,8 @@ void __gcov_merge_add (gcov_type *counters __attribute__ ((unused)), #endif #ifdef L_gcov_merge_single -void __gcov_merge_single (gcov_type *counters __attribute__ ((unused))) -{ -} +void __gcov_merge_single (gcov_type *counters __attribute__ ((unused)), + unsigned n_counters __attribute__ ((unused))) {} #endif #else -- cgit v1.1 From ae7deb4b85aad67c64228c19e226b902669032f4 Mon Sep 17 00:00:00 2001 From: Dimitar Dimitrov Date: Wed, 12 Jun 2019 19:28:51 +0000 Subject: Initial TI PRU libgcc port libgcc/ChangeLog: 2019-06-12 Dimitar Dimitrov * config.host: Add PRU target. * config/pru/asri.c: New file. * config/pru/eqd.c: New file. * config/pru/eqf.c: New file. * config/pru/ged.c: New file. * config/pru/gef.c: New file. * config/pru/gtd.c: New file. * config/pru/gtf.c: New file. * config/pru/led.c: New file. * config/pru/lef.c: New file. * config/pru/lib2bitcountHI.c: New file. * config/pru/lib2divHI.c: New file. * config/pru/lib2divQI.c: New file. * config/pru/lib2divSI.c: New file. * config/pru/libgcc-eabi.ver: New file. * config/pru/ltd.c: New file. * config/pru/ltf.c: New file. * config/pru/mpyll.S: New file. * config/pru/pru-abi.h: New file. * config/pru/pru-asm.h: New file. * config/pru/pru-divmod.h: New file. * config/pru/sfp-machine.h: New file. * config/pru/t-pru: New file. From-SVN: r272204 --- libgcc/ChangeLog | 26 ++++++++ libgcc/config.host | 7 +++ libgcc/config/pru/asri.c | 33 ++++++++++ libgcc/config/pru/eqd.c | 45 +++++++++++++ libgcc/config/pru/eqf.c | 45 +++++++++++++ libgcc/config/pru/ged.c | 45 +++++++++++++ libgcc/config/pru/gef.c | 45 +++++++++++++ libgcc/config/pru/gtd.c | 45 +++++++++++++ libgcc/config/pru/gtf.c | 45 +++++++++++++ libgcc/config/pru/led.c | 45 +++++++++++++ libgcc/config/pru/lef.c | 45 +++++++++++++ libgcc/config/pru/lib2bitcountHI.c | 43 +++++++++++++ libgcc/config/pru/lib2divHI.c | 42 +++++++++++++ libgcc/config/pru/lib2divQI.c | 42 +++++++++++++ libgcc/config/pru/lib2divSI.c | 48 ++++++++++++++ libgcc/config/pru/libgcc-eabi.ver | 88 ++++++++++++++++++++++++++ libgcc/config/pru/ltd.c | 45 +++++++++++++ libgcc/config/pru/ltf.c | 45 +++++++++++++ libgcc/config/pru/mpyll.S | 57 +++++++++++++++++ libgcc/config/pru/pru-abi.h | 109 ++++++++++++++++++++++++++++++++ libgcc/config/pru/pru-asm.h | 35 +++++++++++ libgcc/config/pru/pru-divmod.h | 117 ++++++++++++++++++++++++++++++++++ libgcc/config/pru/sfp-machine.h | 125 +++++++++++++++++++++++++++++++++++++ libgcc/config/pru/t-pru | 50 +++++++++++++++ 24 files changed, 1272 insertions(+) create mode 100644 libgcc/config/pru/asri.c create mode 100644 libgcc/config/pru/eqd.c create mode 100644 libgcc/config/pru/eqf.c create mode 100644 libgcc/config/pru/ged.c create mode 100644 libgcc/config/pru/gef.c create mode 100644 libgcc/config/pru/gtd.c create mode 100644 libgcc/config/pru/gtf.c create mode 100644 libgcc/config/pru/led.c create mode 100644 libgcc/config/pru/lef.c create mode 100644 libgcc/config/pru/lib2bitcountHI.c create mode 100644 libgcc/config/pru/lib2divHI.c create mode 100644 libgcc/config/pru/lib2divQI.c create mode 100644 libgcc/config/pru/lib2divSI.c create mode 100644 libgcc/config/pru/libgcc-eabi.ver create mode 100644 libgcc/config/pru/ltd.c create mode 100644 libgcc/config/pru/ltf.c create mode 100644 libgcc/config/pru/mpyll.S create mode 100644 libgcc/config/pru/pru-abi.h create mode 100644 libgcc/config/pru/pru-asm.h create mode 100644 libgcc/config/pru/pru-divmod.h create mode 100644 libgcc/config/pru/sfp-machine.h create mode 100644 libgcc/config/pru/t-pru (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 329e75b..ed6f97e 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,29 @@ +2019-06-12 Dimitar Dimitrov + + * config.host: Add PRU target. + * config/pru/asri.c: New file. + * config/pru/eqd.c: New file. + * config/pru/eqf.c: New file. + * config/pru/ged.c: New file. + * config/pru/gef.c: New file. + * config/pru/gtd.c: New file. + * config/pru/gtf.c: New file. + * config/pru/led.c: New file. + * config/pru/lef.c: New file. + * config/pru/lib2bitcountHI.c: New file. + * config/pru/lib2divHI.c: New file. + * config/pru/lib2divQI.c: New file. + * config/pru/lib2divSI.c: New file. + * config/pru/libgcc-eabi.ver: New file. + * config/pru/ltd.c: New file. + * config/pru/ltf.c: New file. + * config/pru/mpyll.S: New file. + * config/pru/pru-abi.h: New file. + * config/pru/pru-asm.h: New file. + * config/pru/pru-divmod.h: New file. + * config/pru/sfp-machine.h: New file. + * config/pru/t-pru: New file. + 2019-06-11 Jakub Jelinek * libgcov-merge.c (__gcov_merge_single): Revert previous change. diff --git a/libgcc/config.host b/libgcc/config.host index d75e2b5..588fd7c 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -175,6 +175,9 @@ or1k*-*-*) powerpc*-*-*) cpu_type=rs6000 ;; +pru-*-*) + cpu_type=pru + ;; rs6000*-*-*) ;; riscv*-*-*) @@ -1178,6 +1181,10 @@ powerpcle-*-eabi*) tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-crtstuff t-crtstuff-pic t-fdpbit" extra_parts="$extra_parts crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o" ;; +pru-*-*) + tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl t-softfp t-gnu-prefix pru/t-pru" + tm_file="$tm_file pru/pru-abi.h" + ;; riscv*-*-linux*) tmake_file="${tmake_file} riscv/t-softfp${host_address} t-softfp riscv/t-elf riscv/t-elf${host_address}" extra_parts="$extra_parts crtbegin.o crtend.o crti.o crtn.o crtendS.o crtbeginT.o" diff --git a/libgcc/config/pru/asri.c b/libgcc/config/pru/asri.c new file mode 100644 index 0000000..7d8d8f6 --- /dev/null +++ b/libgcc/config/pru/asri.c @@ -0,0 +1,33 @@ +/* PRU ABI compatibility functions + Arithmetic right shift + Copyright (C) 2017-2019 Free Software Foundation, Inc. + Contributed by Dimitar Dimitrov + + 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 + . */ + +int __pruabi_asri(int a, unsigned char shift) +{ + /* GCC has a built-in op. */ + return a >> shift; +} diff --git a/libgcc/config/pru/eqd.c b/libgcc/config/pru/eqd.c new file mode 100644 index 0000000..0ffb4f7 --- /dev/null +++ b/libgcc/config/pru/eqd.c @@ -0,0 +1,45 @@ +/* Software floating-point emulation. + Return 1 iff a == b, 0 otherwise. + Copyright (C) 1997-2019 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 + . */ + +#include +#include + +CMPtype __pruabi_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, 1); + FP_HANDLE_EXCEPTIONS; + + return !r; +} diff --git a/libgcc/config/pru/eqf.c b/libgcc/config/pru/eqf.c new file mode 100644 index 0000000..cb01021 --- /dev/null +++ b/libgcc/config/pru/eqf.c @@ -0,0 +1,45 @@ +/* Software floating-point emulation. + Return 1 iff a == b, 0 otherwise. + Copyright (C) 1997-2019 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 + . */ + +#include +#include + +CMPtype __pruabi_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, 1); + FP_HANDLE_EXCEPTIONS; + + return !r; +} diff --git a/libgcc/config/pru/ged.c b/libgcc/config/pru/ged.c new file mode 100644 index 0000000..982a994 --- /dev/null +++ b/libgcc/config/pru/ged.c @@ -0,0 +1,45 @@ +/* Software floating-point emulation. + Return 1 iff a >= b, 0 otherwise. + Copyright (C) 1997-2019 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 + . */ + +#include +#include + +CMPtype __pruabi_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, 2); + FP_HANDLE_EXCEPTIONS; + + return r >= 0; +} diff --git a/libgcc/config/pru/gef.c b/libgcc/config/pru/gef.c new file mode 100644 index 0000000..d9744e5 --- /dev/null +++ b/libgcc/config/pru/gef.c @@ -0,0 +1,45 @@ +/* Software floating-point emulation. + Return 1 iff a >= b, 0 otherwise. + Copyright (C) 1997-2019 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 + . */ + +#include +#include + +CMPtype __pruabi_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, 2); + FP_HANDLE_EXCEPTIONS; + + return r >= 0; +} diff --git a/libgcc/config/pru/gtd.c b/libgcc/config/pru/gtd.c new file mode 100644 index 0000000..bd3c3ed --- /dev/null +++ b/libgcc/config/pru/gtd.c @@ -0,0 +1,45 @@ +/* Software floating-point emulation. + Return 1 iff a > b, 0 otherwise. + Copyright (C) 1997-2019 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 + . */ + +#include +#include + +CMPtype __pruabi_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, 2); + FP_HANDLE_EXCEPTIONS; + + return r > 0; +} diff --git a/libgcc/config/pru/gtf.c b/libgcc/config/pru/gtf.c new file mode 100644 index 0000000..ccd73ee --- /dev/null +++ b/libgcc/config/pru/gtf.c @@ -0,0 +1,45 @@ +/* Software floating-point emulation. + Return 1 iff a > b, 0 otherwise. + Copyright (C) 1997-2019 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 + . */ + +#include +#include + +CMPtype __pruabi_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, 2); + FP_HANDLE_EXCEPTIONS; + + return r > 0; +} diff --git a/libgcc/config/pru/led.c b/libgcc/config/pru/led.c new file mode 100644 index 0000000..be23005 --- /dev/null +++ b/libgcc/config/pru/led.c @@ -0,0 +1,45 @@ +/* Software floating-point emulation. + Return 1 iff a <= b, 0 otherwise. + Copyright (C) 1997-2019 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 + . */ + +#include +#include + +CMPtype __pruabi_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, 2); + FP_HANDLE_EXCEPTIONS; + + return r <= 0; +} diff --git a/libgcc/config/pru/lef.c b/libgcc/config/pru/lef.c new file mode 100644 index 0000000..43bc252 --- /dev/null +++ b/libgcc/config/pru/lef.c @@ -0,0 +1,45 @@ +/* Software floating-point emulation. + Return 1 iff a <= b, 0 otherwise. + Copyright (C) 1997-2019 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 + . */ + +#include +#include + +CMPtype __pruabi_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, 2); + FP_HANDLE_EXCEPTIONS; + + return r <= 0; +} diff --git a/libgcc/config/pru/lib2bitcountHI.c b/libgcc/config/pru/lib2bitcountHI.c new file mode 100644 index 0000000..2de86db --- /dev/null +++ b/libgcc/config/pru/lib2bitcountHI.c @@ -0,0 +1,43 @@ +/* libgcc routines for PRU + Copyright (C) 2014-2019 Free Software Foundation, Inc. + Based on lib2bitcountHI.c from MSP430 port. + + 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 + . */ + +typedef int sint32_type __attribute__ ((mode (SI))); +typedef unsigned int uint32_type __attribute__ ((mode (SI))); +typedef int sint16_type __attribute__ ((mode (HI))); +typedef unsigned int uint16_type __attribute__ ((mode (HI))); +typedef int sint08_type __attribute__ ((mode (QI))); +typedef unsigned int uint08_type __attribute__ ((mode (QI))); +typedef int word_type __attribute__ ((mode (__word__))); + +#define C3B(a,b,c) a##b##c +#define C3(a,b,c) C3B(a,b,c) + +#define L_clzsi2 +#define L_ctzsi2 +#define L_ffssi2 +#define L_paritysi2 +#define L_popcountsi2 + +#include "libgcc2.c" diff --git a/libgcc/config/pru/lib2divHI.c b/libgcc/config/pru/lib2divHI.c new file mode 100644 index 0000000..9315530c --- /dev/null +++ b/libgcc/config/pru/lib2divHI.c @@ -0,0 +1,42 @@ +/* HI mode divide routines for libgcc for PRU + Copyright (C) 2014-2019 Free Software Foundation, Inc. + Based on lib2divHI.c from MSP430 port. + + 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 + . */ + +typedef int sint32_type __attribute__ ((mode (SI))); +typedef unsigned int uint32_type __attribute__ ((mode (SI))); +typedef int sint16_type __attribute__ ((mode (HI))); +typedef unsigned int uint16_type __attribute__ ((mode (HI))); +typedef int sint08_type __attribute__ ((mode (QI))); +typedef unsigned int uint08_type __attribute__ ((mode (QI))); +typedef int word_type __attribute__ ((mode (__word__))); + +#define C3B(a,b,c) a##b##c +#define C3(a,b,c) C3B(a,b,c) + +#define UINT_TYPE uint16_type +#define SINT_TYPE sint16_type +#define BITS_MINUS_1 15 +#define NAME_MODE hi + +#include "pru-divmod.h" diff --git a/libgcc/config/pru/lib2divQI.c b/libgcc/config/pru/lib2divQI.c new file mode 100644 index 0000000..994788a --- /dev/null +++ b/libgcc/config/pru/lib2divQI.c @@ -0,0 +1,42 @@ +/* QI mode divide routines for libgcc for PRU + Copyright (C) 2014-2019 Free Software Foundation, Inc. + Based on lib2divQI.c from MSP430 port. + + 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 + . */ + +typedef int sint32_type __attribute__ ((mode (SI))); +typedef unsigned int uint32_type __attribute__ ((mode (SI))); +typedef int sint16_type __attribute__ ((mode (HI))); +typedef unsigned int uint16_type __attribute__ ((mode (HI))); +typedef int sint08_type __attribute__ ((mode (QI))); +typedef unsigned int uint08_type __attribute__ ((mode (QI))); +typedef int word_type __attribute__ ((mode (__word__))); + +#define C3B(a,b,c) a##b##c +#define C3(a,b,c) C3B(a,b,c) + +#define UINT_TYPE uint08_type +#define SINT_TYPE sint08_type +#define BITS_MINUS_1 7 +#define NAME_MODE qi + +#include "pru-divmod.h" diff --git a/libgcc/config/pru/lib2divSI.c b/libgcc/config/pru/lib2divSI.c new file mode 100644 index 0000000..160b91f --- /dev/null +++ b/libgcc/config/pru/lib2divSI.c @@ -0,0 +1,48 @@ +/* SI mode divide routines for libgcc for PRU + Copyright (C) 2014-2019 Free Software Foundation, Inc. + Based on lib2divSI.c from MSP430 port. + + 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 + . */ + +typedef int sint32_type __attribute__ ((mode (SI))); +typedef unsigned int uint32_type __attribute__ ((mode (SI))); +typedef int sint16_type __attribute__ ((mode (HI))); +typedef unsigned int uint16_type __attribute__ ((mode (HI))); +typedef int sint08_type __attribute__ ((mode (QI))); +typedef unsigned int uint08_type __attribute__ ((mode (QI))); +typedef int word_type __attribute__ ((mode (__word__))); + +#define C3B(a,b,c) a##b##c +#define C3(a,b,c) C3B(a,b,c) + +/* PRU ABI dictates the library function names. */ +#define __gnu_divsi3 __pruabi_divi +#define __gnu_modsi3 __pruabi_remi +#define __gnu_udivsi3 __pruabi_divu +#define __gnu_umodsi3 __pruabi_remu + +#define UINT_TYPE uint32_type +#define SINT_TYPE sint32_type +#define BITS_MINUS_1 31 +#define NAME_MODE si + +#include "pru-divmod.h" diff --git a/libgcc/config/pru/libgcc-eabi.ver b/libgcc/config/pru/libgcc-eabi.ver new file mode 100644 index 0000000..cd27a7c --- /dev/null +++ b/libgcc/config/pru/libgcc-eabi.ver @@ -0,0 +1,88 @@ +# Copyright (C) 2017-2019 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 +# . + +GCC_9.0.0 { + __pruabi_asri + __pruabi_asrll + __pruabi_mpyll + __pruabi_negll + __pruabi_lslll + __pruabi_lsrll + __pruabi_fixfu + __pruabi_fixdu + __pruabi_fixflli + __pruabi_fixdlli + __pruabi_fixfull + __pruabi_fixdull + __pruabi_fltllif + __pruabi_fltllid + __pruabi_fltullf + __pruabi_fltulld + __pruabi_divlli + __pruabi_remlli + __pruabi_divull + __pruabi_remull + __pruabi_divremull + __pruabi_gef + __pruabi_gtf + __pruabi_lef + __pruabi_ltf + __pruabi_eqf + __pruabi_ged + __pruabi_gtd + __pruabi_led + __pruabi_ltd + __pruabi_eqd + __pruabi_addf + __pruabi_divf + __pruabi_neqf + __pruabi_cmpf + __pruabi_mpyf + __pruabi_negf + __pruabi_subf + __pruabi_unordf + __pruabi_fixfi + __pruabi_fltif + __pruabi_fltuf + __pruabi_addd + __pruabi_divd + __pruabi_neqd + __pruabi_cmpd + __pruabi_mpyd + __pruabi_negd + __pruabi_subd + __pruabi_unordd + __pruabi_fixdi + __pruabi_fltid + __pruabi_fltud + __pruabi_cvtfd + __pruabi_cvtdf + __pruabi_mulcf + __pruabi_mulcd + __pruabi_divcf + __pruabi_divcd + + __gnu_ltsf2 + __gnu_ltdf2 + __gnu_gesf2 + __gnu_gedf2 + __gnu_gtsf2 + __gnu_gtdf2 + __gnu_eqsf2 + __gnu_eqdf2 +} diff --git a/libgcc/config/pru/ltd.c b/libgcc/config/pru/ltd.c new file mode 100644 index 0000000..ab0da9c --- /dev/null +++ b/libgcc/config/pru/ltd.c @@ -0,0 +1,45 @@ +/* Software floating-point emulation. + Return 1 iff a < b, 0 otherwise. + Copyright (C) 1997-2019 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 + . */ + +#include +#include + +CMPtype __pruabi_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, 2); + FP_HANDLE_EXCEPTIONS; + + return r < 0; +} diff --git a/libgcc/config/pru/ltf.c b/libgcc/config/pru/ltf.c new file mode 100644 index 0000000..92c8771 --- /dev/null +++ b/libgcc/config/pru/ltf.c @@ -0,0 +1,45 @@ +/* Software floating-point emulation. + Return 1 iff a < b, 0 otherwise. + Copyright (C) 1997-2019 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 + . */ + +#include +#include + +CMPtype __pruabi_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, 2); + FP_HANDLE_EXCEPTIONS; + + return r < 0; +} diff --git a/libgcc/config/pru/mpyll.S b/libgcc/config/pru/mpyll.S new file mode 100644 index 0000000..a0c862e --- /dev/null +++ b/libgcc/config/pru/mpyll.S @@ -0,0 +1,57 @@ +/* Copyright (C) 2014-2019 Free Software Foundation, Inc. + Contributed by Dimitar Dimitrov + + 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 + . + + (al + C * ah) * (bl + C * bh) = al * bl + + C * ah * bl + + C * al * bh + + C * C * ah * bh -> discard, overflow + Where C=(1 << 32) + */ + +#include "pru-asm.h" + + .global SYM(__pruabi_mpyll) + FUNC(__pruabi_mpyll) +SYM(__pruabi_mpyll): + /* + C * ah * bl */ + mov r28, r15 + mov r29, r16 + nop + xin 0, r26, 8 + + /* + C * al * bh */ + mov r28, r14 + mov r29, r17 + mov r15, r26 /* "Loose" ah, record only reslo. */ + xin 0, r26, 8 + + /* + al * bl */ + /* mov r28, r14 -> No need, already loaded. */ + mov r29, r16 + add r15, r15, r26 + xin 0, r26, 8 + mov r14, r26 + add r15, r15, r27 + + ret + + ENDFUNC(__pruabi_mpyll) diff --git a/libgcc/config/pru/pru-abi.h b/libgcc/config/pru/pru-abi.h new file mode 100644 index 0000000..4b34cc5 --- /dev/null +++ b/libgcc/config/pru/pru-abi.h @@ -0,0 +1,109 @@ +/* Header file for PRU ABI versions of libgcc functions. + Copyright (C) 2011-2019 Free Software Foundation, Inc. + Contributed by Dimitar Dimitrov + Based on c6x/c6x-abi.h + + 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 + along with GCC; see the file COPYING3. If not see + . */ + +/* Make __pruabi_AEABI_NAME an alias for __GCC_NAME. */ +#define RENAME_LIBRARY(GCC_NAME, AEABI_NAME) \ + __asm__ (".globl\t__pruabi_" #AEABI_NAME "\n" \ + ".set\t__pruabi_" #AEABI_NAME \ + ", __gnu_" #GCC_NAME "\n"); + +/* Rename helper functions to the names specified in the PRU ELF ABI. */ +#ifdef L_divsi3 +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (divsi3, divi) +#endif +#ifdef L_divdi3 +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (divdi3, divlli) +#endif +#ifdef L_udivsi3 +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (udivsi3, divu) +#endif +#ifdef L_udivdi3 +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (udivdi3, divull) +#endif +#ifdef L_udivmoddi4 +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (udivmoddi4, divremull) +#endif +#ifdef L_modsi3 +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (modsi3, remi) +#endif +#ifdef L_moddi3 +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (moddi3, remlli) +#endif +#ifdef L_umodsi3 +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (umodsi3, remu) +#endif +#ifdef L_umoddi3 +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (umoddi3, remull) +#endif +#ifdef L_negdi2 +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (negdi2, negll) +#endif +#ifdef L_muldi3 +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (muldi3, mpyll) +#endif +#ifdef L_ashrdi3 +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (ashrdi3, asrll) +#endif +#ifdef L_lshrdi3 +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (lshrdi3, lsrll) +#endif +#ifdef L_ashldi3 +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (ashldi3, lslll) +#endif + +/* The following are excluded from softfp due to softfp_exclude_libgcc2, + so we rename them here rather than in sfp-machine.h. */ +#ifdef L_fixdfdi +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixdfdi, fixdlli) +#endif +#ifdef L_fixunsdfsi +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunsdfsi, fixdu) +#endif +#ifdef L_fixunsdfdi +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunsdfdi, fixdull) +#endif +#ifdef L_fixsfdi +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixsfdi, fixflli) +#endif +#ifdef L_fixunssfsi +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunssfsi, fixfu) +#endif +#ifdef L_fixunssfdi +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunssfdi, fixfull) +#endif +#ifdef L_floatdidf +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatdidf, fltllid) +#endif +#ifdef L_floatundidf +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatundidf, fltulld) +#endif +#ifdef L_floatdisf +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatdisf, fltllif) +#endif +#ifdef L_floatundisf +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatundisf, fltullf) +#endif + +#define LIBGCC2_GNU_PREFIX diff --git a/libgcc/config/pru/pru-asm.h b/libgcc/config/pru/pru-asm.h new file mode 100644 index 0000000..01307dd --- /dev/null +++ b/libgcc/config/pru/pru-asm.h @@ -0,0 +1,35 @@ +/* Copyright (C) 2014-2019 Free Software Foundation, Inc. + Contributed by Dimitar Dimitrov + + 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 + . */ + +/* ANSI concatenation macros. */ + +#define CONCAT1(a, b) CONCAT2(a, b) +#define CONCAT2(a, b) a ## b + +/* Use the right prefix for global labels. */ + +#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x) + +#define FUNC(X) .type SYM(X),@function +#define HIDDEN_FUNC(X) FUNC(X)` .hidden SYM(X) +#define ENDFUNC0(X) CONCAT1(.Lfe_,X): .size X,CONCAT1(.Lfe_,X)-X +#define ENDFUNC(X) ENDFUNC0(SYM(X)) diff --git a/libgcc/config/pru/pru-divmod.h b/libgcc/config/pru/pru-divmod.h new file mode 100644 index 0000000..59b2444 --- /dev/null +++ b/libgcc/config/pru/pru-divmod.h @@ -0,0 +1,117 @@ +/* libgcc routines for PRU + Copyright (C) 2014-2019 Free Software Foundation, Inc. + Based on msp430-divmod.h from MSP430 port. + + 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 + . */ + +UINT_TYPE C3(udivmod,NAME_MODE,4) (UINT_TYPE, UINT_TYPE, word_type); +SINT_TYPE C3(__gnu_div,NAME_MODE,3) (SINT_TYPE, SINT_TYPE); +SINT_TYPE C3(__gnu_mod,NAME_MODE,3) (SINT_TYPE, SINT_TYPE); +UINT_TYPE C3(__gnu_udiv,NAME_MODE,3) (UINT_TYPE, UINT_TYPE); +UINT_TYPE C3(__gnu_umod,NAME_MODE,3) (UINT_TYPE, UINT_TYPE); + +UINT_TYPE +C3(udivmod,NAME_MODE,4) (UINT_TYPE num, UINT_TYPE den, word_type modwanted) +{ + UINT_TYPE bit = 1; + UINT_TYPE res = 0; + + while (den < num && bit && !(den & (1L << BITS_MINUS_1))) + { + den <<= 1; + bit <<= 1; + } + while (bit) + { + if (num >= den) + { + num -= den; + res |= bit; + } + bit >>= 1; + den >>= 1; + } + if (modwanted) + return num; + return res; +} + +SINT_TYPE +C3(__gnu_div,NAME_MODE,3) (SINT_TYPE a, SINT_TYPE b) +{ + word_type neg = 0; + SINT_TYPE res; + + if (a < 0) + { + a = -a; + neg = !neg; + } + + if (b < 0) + { + b = -b; + neg = !neg; + } + + res = C3(udivmod,NAME_MODE,4) (a, b, 0); + + if (neg) + res = -res; + + return res; +} + +SINT_TYPE +C3(__gnu_mod,NAME_MODE,3) (SINT_TYPE a, SINT_TYPE b) +{ + word_type neg = 0; + SINT_TYPE res; + + if (a < 0) + { + a = -a; + neg = 1; + } + + if (b < 0) + b = -b; + + res = C3(udivmod,NAME_MODE,4) (a, b, 1); + + if (neg) + res = -res; + + return res; +} + +UINT_TYPE +C3(__gnu_udiv,NAME_MODE,3) (UINT_TYPE a, UINT_TYPE b) +{ + return C3(udivmod,NAME_MODE,4) (a, b, 0); +} + +UINT_TYPE +C3(__gnu_umod,NAME_MODE,3) (UINT_TYPE a, UINT_TYPE b) +{ + return C3(udivmod,NAME_MODE,4) (a, b, 1); +} diff --git a/libgcc/config/pru/sfp-machine.h b/libgcc/config/pru/sfp-machine.h new file mode 100644 index 0000000..ec86f6c --- /dev/null +++ b/libgcc/config/pru/sfp-machine.h @@ -0,0 +1,125 @@ +/* Soft-FP definitions for TI PRU. + Copyright (C) 2010-2019 Free Software Foundation, Inc. + Based on C6X soft-fp header. + + This files 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 + . */ + +#define _FP_W_TYPE_SIZE 32 +#define _FP_W_TYPE unsigned long +#define _FP_WS_TYPE signed long +#define _FP_I_TYPE long + +#define _FP_MUL_MEAT_S(R,X,Y) \ + _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm) +#define _FP_MUL_MEAT_D(R,X,Y) \ + _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm) +#define _FP_MUL_MEAT_Q(R,X,Y) \ + _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm) + +#define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_loop(S,R,X,Y) +#define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_2_udiv(D,R,X,Y) +#define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_4_udiv(Q,R,X,Y) + +#define _FP_NANFRAC_H ((_FP_QNANBIT_H << 1) - 1) +#define _FP_NANFRAC_S ((_FP_QNANBIT_S << 1) - 1) +#define _FP_NANFRAC_D ((_FP_QNANBIT_D << 1) - 1), -1 +#define _FP_NANFRAC_Q ((_FP_QNANBIT_Q << 1) - 1), -1, -1, -1 +#define _FP_NANSIGN_H 0 +#define _FP_NANSIGN_S 0 +#define _FP_NANSIGN_D 0 +#define _FP_NANSIGN_Q 0 + +#define _FP_KEEPNANFRACP 1 +#define _FP_QNANNEGATEDP 0 + +/* Someone please check this. */ +#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \ + do { \ + if ((_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs) \ + && !(_FP_FRAC_HIGH_RAW_##fs(Y) & _FP_QNANBIT_##fs)) \ + { \ + R##_s = Y##_s; \ + _FP_FRAC_COPY_##wc(R,Y); \ + } \ + else \ + { \ + R##_s = X##_s; \ + _FP_FRAC_COPY_##wc(R,X); \ + } \ + R##_c = FP_CLS_NAN; \ + } while (0) + +#define __LITTLE_ENDIAN 1234 +#define __BIG_ENDIAN 4321 + +#if defined _BIG_ENDIAN +# define __BYTE_ORDER __BIG_ENDIAN +#else +# define __BYTE_ORDER __LITTLE_ENDIAN +#endif + +/* Not checked. */ +#define _FP_TININESS_AFTER_ROUNDING 0 + + +/* Define ALIASNAME as a strong alias for NAME. */ +# define strong_alias(name, aliasname) _strong_alias(name, aliasname) +# define _strong_alias(name, aliasname) \ + extern __typeof (name) aliasname __attribute__ ((alias (#name))); + +/* Rename helper functions to the names specified in the PRU ELF ABI. */ +#define __fixdfsi __pruabi_fixdi +#define __fixsfsi __pruabi_fixfi +#define __floatsidf __pruabi_fltid +#define __floatunsidf __pruabi_fltud +#define __floatsisf __pruabi_fltif +#define __floatunsisf __pruabi_fltuf +#define __truncdfsf2 __pruabi_cvtdf +#define __extendsfdf2 __pruabi_cvtfd +#define __adddf3 __pruabi_addd +#define __subdf3 __pruabi_subd +#define __muldf3 __pruabi_mpyd +#define __divdf3 __pruabi_divd +#define __negdf2 __pruabi_negd +#define __absdf2 __pruabi_absd +#define __addsf3 __pruabi_addf +#define __subsf3 __pruabi_subf +#define __mulsf3 __pruabi_mpyf +#define __divsf3 __pruabi_divf +#define __negsf2 __pruabi_negf +#define __abssf2 __pruabi_absf +#define __lesf2 __pruabi_cmpf +#define __ledf2 __pruabi_cmpd +#define __ltsf2 __gnu_ltsf2 +#define __ltdf2 __gnu_ltdf2 +#define __gesf2 __gnu_gesf2 +#define __gedf2 __gnu_gedf2 +#define __gtsf2 __gnu_gtsf2 +#define __gtdf2 __gnu_gtdf2 +#define __eqsf2 __gnu_eqsf2 +#define __eqdf2 __gnu_eqdf2 +#define __nesf2 __pruabi_neqf +#define __nedf2 __pruabi_neqd +#define __unordsf2 __pruabi_unordf +#define __unorddf2 __pruabi_unordd diff --git a/libgcc/config/pru/t-pru b/libgcc/config/pru/t-pru new file mode 100644 index 0000000..1df86a3 --- /dev/null +++ b/libgcc/config/pru/t-pru @@ -0,0 +1,50 @@ +# Makefile fragment for building LIBGCC for the TI PRU processor. +# Copyright (C) 2014-2019 Free Software Foundation, Inc. +# Contributed by Dimitar Dimitrov +# +# 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 +# . + +# Note - we have separate versions of the lib2div files +# as the functions are quite large and we do not want to pull +# in unneeded division routines. + +LIB2ADD += \ + $(srcdir)/config/pru/lib2divQI.c \ + $(srcdir)/config/pru/lib2divHI.c \ + $(srcdir)/config/pru/lib2divSI.c \ + $(srcdir)/config/pru/lib2bitcountHI.c \ + $(srcdir)/config/pru/mpyll.S \ + $(srcdir)/config/pru/gef.c \ + $(srcdir)/config/pru/gtf.c \ + $(srcdir)/config/pru/lef.c \ + $(srcdir)/config/pru/ltf.c \ + $(srcdir)/config/pru/eqf.c \ + $(srcdir)/config/pru/ged.c \ + $(srcdir)/config/pru/gtd.c \ + $(srcdir)/config/pru/led.c \ + $(srcdir)/config/pru/ltd.c \ + $(srcdir)/config/pru/eqd.c \ + $(srcdir)/config/pru/asri.c + +HOST_LIBGCC2_CFLAGS += -Os -ffunction-sections -fdata-sections + +LIB2FUNCS_EXCLUDE = _muldi3 + +SHLIB_MAPFILES += $(srcdir)/config/pru/libgcc-eabi.ver +# Local Variables: +# mode: Makefile +# End: -- cgit v1.1 From b27c10823418d58d70274ee3a7378e1aca21d418 Mon Sep 17 00:00:00 2001 From: Matt Thomas Date: Fri, 14 Jun 2019 14:04:20 +0000 Subject: [NetBSD] Add support for the Arm EABI. This is a roll-up of a set of changes needed to support the Arm EABI on NetBSD. 2019-06-14 Matt Thomas Matthew Green Nick Hudson Maya Rashish Richard Earnshaw gcc: * config.gcc (arm*-*-netbsdelf*) Add support for EABI configuration. * config.host (arm*-*-netbsd*): Use driver-arm.o on native NetBSD. * config/arm/netbsd-eabi.h: New file. * config/arm/netbsd-elf.h (TARGET_OS_CPP_BUILTINS): Undefine before redefining. (SUBTARGET_EXTRA_ASM_SPEC): Don't pass -matpcs to the assembler. * config/netbsd-elf.h (NETBSD_LINK_LD_ELF_SO_SPEC): New define. (NETBSD_SUBTARGET_EXTRA_SPECS): New define. (SUBTARGET_EXTRA_SPECS): Define to NETBSD_SUBTARGET_EXTRA_SPECS. libatomic: * configure.tgt (arm*): Handle NetBSD in the same way as FreeBSD. libgcc: * config.host (arm*-*-netbsdelf*): Add support for EABI configurations. * config/arm/t-netbsd (LIB1ASMFUNCS): Add some additional assembler functions to build. * config/arm/t-netbsd-eabi: New file. Co-Authored-By: Matthew Green Co-Authored-By: Maya Rashish Co-Authored-By: Nick Hudson Co-Authored-By: Richard Earnshaw From-SVN: r272290 --- libgcc/ChangeLog | 10 ++++++++++ libgcc/config.host | 11 ++++++++++- libgcc/config/arm/t-netbsd | 8 ++++++++ libgcc/config/arm/t-netbsd-eabi | 18 ++++++++++++++++++ 4 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 libgcc/config/arm/t-netbsd-eabi (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index ed6f97e..959776d 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,13 @@ +2019-06-14 Matt Thomas + Matthew Green + Nick Hudson + Maya Rashish + + * config.host (arm*-*-netbsdelf*): Add support for EABI configurations. + * config/arm/t-netbsd (LIB1ASMFUNCS): Add some additional assembler + functions to build. + * config/arm/t-netbsd-eabi: New file. + 2019-06-12 Dimitar Dimitrov * config.host: Add PRU target. diff --git a/libgcc/config.host b/libgcc/config.host index 588fd7c..0574b4d 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -436,7 +436,16 @@ arm*-*-fuchsia*) unwind_header=config/arm/unwind-arm.h ;; arm*-*-netbsdelf*) - tmake_file="$tmake_file arm/t-arm arm/t-netbsd t-slibgcc-gld-nover" + tmake_file="$tmake_file arm/t-arm" + case ${host} in + arm*-*-netbsdelf-*eabi*) + tmake_file="${tmake_file} arm/t-netbsd-eabi" + unwind_header=config/arm/unwind-arm.h + ;; + *) + tmake_file="${tmake_file} arm/t-netbsd t-slibgcc-gld-nover" + ;; + esac ;; arm*-*-linux*) # ARM GNU/Linux with ELF tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix t-crtfm" diff --git a/libgcc/config/arm/t-netbsd b/libgcc/config/arm/t-netbsd index 95358f9..ea4d5de 100644 --- a/libgcc/config/arm/t-netbsd +++ b/libgcc/config/arm/t-netbsd @@ -1,3 +1,11 @@ +# This list is from t-elf, but with some things removed. +LIB1ASMFUNCS += _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func \ + _call_via_rX _interwork_call_via_rX \ + _arm_fixunsdfsi _arm_fixunssfsi \ + _arm_floatdidf _arm_floatdisf _arm_floatundidf _arm_floatundisf \ + _lshrdi3 _ashrdi3 _ashldi3 \ + _clzsi2 _clzdi2 _ctzsi2 + # 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 diff --git a/libgcc/config/arm/t-netbsd-eabi b/libgcc/config/arm/t-netbsd-eabi new file mode 100644 index 0000000..ae08ea4 --- /dev/null +++ b/libgcc/config/arm/t-netbsd-eabi @@ -0,0 +1,18 @@ +# This list is from t-elf, but with lots removed. +LIB1ASMFUNCS += _dvmd_tls _bb_init_func _call_via_rX _interwork_call_via_rX \ + _clzsi2 _clzdi2 _ctzsi2 + +# Derived from t-bpabi +# Add the BPABI C functions. +LIB2ADD += $(srcdir)/config/arm/unaligned-funcs.c + +# Not using libgcc for EH. +LIB2ADDEH = + +# Add the BPABI names. +SHLIB_MAPFILES += $(srcdir)/config/arm/libgcc-bpabi.ver + +# On ARM, specifying -fnon-call-exceptions will needlessly pull in +# the unwinder in simple programs which use 64-bit division. Omitting +# the option is safe. +LIB2_DIVMOD_EXCEPTION_FLAGS := -fexceptions -- cgit v1.1 From 0fcc78f79e85b816480e0425cc8d7c496e739e88 Mon Sep 17 00:00:00 2001 From: Jozef Lawrynowicz Date: Sun, 16 Jun 2019 21:24:56 +0000 Subject: MSP430: Implement 64-bit shifts in assembly code gcc/ChangeLog: 2019-06-16 Jozef Lawrynowicz * config/msp430/msp430.c (msp430_expand_helper): Setup arguments which describe how to perform MSPABI compliant 64-bit shift. * config/msp430/msp430.md (ashldi3): New define_expand. (ashrdi3): New define_expand. (lshrdi3): New define_expand. libgcc/ChangeLog: 2019-06-16 Jozef Lawrynowicz * config/msp430/slli.S (__mspabi_sllll): New library function for performing a logical left shift of a 64-bit value. * config/msp430/srai.S (__mspabi_srall): New library function for performing a arithmetic right shift of a 64-bit value. * config/msp430/srll.S (__mspabi_srlll): New library function for performing a logical right shift of a 64-bit value. gcc/testsuite/ChangeLog: 2019-06-16 Jozef Lawrynowicz * gcc.target/msp430/mspabi_sllll.c: New test. * gcc.target/msp430/mspabi_srall.c: New test. * gcc.target/msp430/mspabi_srlll.c: New test. * gcc.c-torture/execute/shiftdi-2.c: New test. From-SVN: r272360 --- libgcc/ChangeLog | 9 +++++++++ libgcc/config/msp430/slli.S | 33 +++++++++++++++++++++++++++++++++ libgcc/config/msp430/srai.S | 34 ++++++++++++++++++++++++++++++++++ libgcc/config/msp430/srli.S | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 111 insertions(+) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 959776d..fee8b38 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,12 @@ +2019-06-16 Jozef Lawrynowicz + + * config/msp430/slli.S (__mspabi_sllll): New library function for + performing a logical left shift of a 64-bit value. + * config/msp430/srai.S (__mspabi_srall): New library function for + performing a arithmetic right shift of a 64-bit value. + * config/msp430/srll.S (__mspabi_srlll): New library function for + performing a logical right shift of a 64-bit value. + 2019-06-14 Matt Thomas Matthew Green Nick Hudson diff --git a/libgcc/config/msp430/slli.S b/libgcc/config/msp430/slli.S index 89ca35a..9210fe6 100644 --- a/libgcc/config/msp430/slli.S +++ b/libgcc/config/msp430/slli.S @@ -110,3 +110,36 @@ __mspabi_slll: RET #endif +/* Logical Left Shift - R8:R11 -> R12:R15 + A 64-bit argument would normally be passed in R12:R15, but __mspabi_sllll has + special conventions, so the 64-bit value to shift is passed in R8:R11. + According to the MSPABI, the shift amount is a 64-bit value in R12:R15, but + we only use the low word in R12. */ + + .section .text.__mspabi_sllll + .global __mspabi_sllll +__mspabi_sllll: + MOV R11, R15 ; Free up R11 first + MOV R12, R11 ; Save the shift amount in R11 + MOV R10, R14 + MOV R9, R13 + MOV R8, R12 + CMP #0,R11 + JNZ 1f +#ifdef __MSP430X_LARGE__ + RETA +#else + RET +#endif +1: + RLA R12 + RLC R13 + RLC R14 + RLC R15 + ADD #-1,R11 + JNZ 1b +#ifdef __MSP430X_LARGE__ + RETA +#else + RET +#endif diff --git a/libgcc/config/msp430/srai.S b/libgcc/config/msp430/srai.S index 564f798..ed5c6a5 100644 --- a/libgcc/config/msp430/srai.S +++ b/libgcc/config/msp430/srai.S @@ -108,3 +108,37 @@ __mspabi_sral: #else RET #endif + +/* Arithmetic Right Shift - R8:R11 -> R12:R15 + A 64-bit argument would normally be passed in R12:R15, but __mspabi_srall has + special conventions, so the 64-bit value to shift is passed in R8:R11. + According to the MSPABI, the shift amount is a 64-bit value in R12:R15, but + we only use the low word in R12. */ + + .section .text.__mspabi_srall + .global __mspabi_srall +__mspabi_srall: + MOV R11, R15 ; Free up R11 first + MOV R12, R11 ; Save the shift amount in R11 + MOV R10, R14 + MOV R9, R13 + MOV R8, R12 + CMP #0, R11 + JNZ 1f +#ifdef __MSP430X_LARGE__ + RETA +#else + RET +#endif +1: + RRA R15 + RRC R14 + RRC R13 + RRC R12 + ADD #-1,R11 + JNZ 1b +#ifdef __MSP430X_LARGE__ + RETA +#else + RET +#endif diff --git a/libgcc/config/msp430/srli.S b/libgcc/config/msp430/srli.S index 4dd32ea..bc1b034 100644 --- a/libgcc/config/msp430/srli.S +++ b/libgcc/config/msp430/srli.S @@ -112,3 +112,38 @@ __mspabi_srll: #else RET #endif + +/* Logical Right Shift - R8:R11 -> R12:R15 + A 64-bit argument would normally be passed in R12:R15, but __mspabi_srlll has + special conventions, so the 64-bit value to shift is passed in R8:R11. + According to the MSPABI, the shift amount is a 64-bit value in R12:R15, but + we only use the low word in R12. */ + + .section .text.__mspabi_srlll + .global __mspabi_srlll +__mspabi_srlll: + MOV R11, R15 ; Free up R11 first + MOV R12, R11 ; Save the shift amount in R11 + MOV R10, R14 + MOV R9, R13 + MOV R8, R12 + CMP #0,R11 + JNZ 1f +#ifdef __MSP430X_LARGE__ + RETA +#else + RET +#endif +1: + CLRC + RRC R15 + RRC R14 + RRC R13 + RRC R12 + ADD #-1,R11 + JNZ 1b +#ifdef __MSP430X_LARGE__ + RETA +#else + RET +#endif -- cgit v1.1 From f32f75858a14e7b304df7a71dae15d75081b0deb Mon Sep 17 00:00:00 2001 From: Matthew Green Date: Mon, 17 Jun 2019 14:43:11 +0000 Subject: [netbsd][aarch64] add netbsd/aarch64 target Initial support for AArch64 running NetBSD. Matthew Green Maya Rashish gcc: * config.gcc (aarch64*-*-netbsd*): New target. * config/aarch64/aarch64-netbsd.h: New file. * config/aarch64/t-aarch64-netbsd: Likewise. libgcc: * config.host (aarch64*-*-netbsd*): New case. Co-Authored-By: Maya Rashish From-SVN: r272387 --- libgcc/ChangeLog | 5 +++++ libgcc/config.host | 6 ++++++ 2 files changed, 11 insertions(+) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index fee8b38..934733d 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +2019-06-17 Matthew Green + Maya Rashish + + * config.host (aarch64*-*-netbsd*): New case. + 2019-06-16 Jozef Lawrynowicz * config/msp430/slli.S (__mspabi_sllll): New library function for diff --git a/libgcc/config.host b/libgcc/config.host index 0574b4d..e6a834b 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -359,6 +359,12 @@ aarch64*-*-freebsd*) tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp t-crtfm" md_unwind_header=aarch64/freebsd-unwind.h ;; +aarch64*-*-netbsd*) + extra_parts="$extra_parts crtfastmath.o" + tmake_file="${tmake_file} ${cpu_type}/t-aarch64" + tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp t-crtfm" + md_unwind_header=aarch64/aarch64-unwind.h + ;; aarch64*-*-fuchsia*) tmake_file="${tmake_file} ${cpu_type}/t-aarch64" tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp" -- cgit v1.1 From 787783a0356dd75e462c9d5337f06f156e0ed110 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Tue, 18 Jun 2019 09:19:28 +0000 Subject: [nvptx] Fix __main missing prototype warning in crt0.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Atm we see: ... libgcc/config/nvptx/crt0.c:36:1: warning: no previous prototype for \ ‘__main’ [-Wmissing-prototypes] ... Fix this by adding the prototype. Build and reg-tested on nvptx. Build and reg-tested on x86_64 with nvptx accelerator. 2019-06-18 Tom de Vries * config/nvptx/crt0.c (__main): Declare. From-SVN: r272412 --- libgcc/ChangeLog | 4 ++++ libgcc/config/nvptx/crt0.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 934733d..53acb8b 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,7 @@ +2019-06-18 Tom de Vries + + * config/nvptx/crt0.c (__main): Declare. + 2019-06-17 Matthew Green Maya Rashish diff --git a/libgcc/config/nvptx/crt0.c b/libgcc/config/nvptx/crt0.c index 097193c..b3bf147 100644 --- a/libgcc/config/nvptx/crt0.c +++ b/libgcc/config/nvptx/crt0.c @@ -32,7 +32,9 @@ void *__nvptx_stacks[32] __attribute__((shared,nocommon)); /* Likewise for -muniform-simt. */ unsigned __nvptx_uni[32] __attribute__((shared,nocommon)); -void __attribute__((kernel)) +extern void __main (int *, int, void **) __attribute__((kernel)); + +void __main (int *rval_ptr, int argc, void **argv) { __exitval_ptr = rval_ptr; -- cgit v1.1 From 76d463310787c8c7fd0c55cf88031b240311ab68 Mon Sep 17 00:00:00 2001 From: Kwok Cheung Yeung Date: Tue, 25 Jun 2019 11:41:29 +0000 Subject: Create GCN-specific gthreads 2019-06-25 Kwok Cheung Yeung Andrew Stubbs gcc/ * config.gcc (thread_file): Set to gcn for AMD GCN. * config/gcn/gcn.c (gcn_emutls_var_init): New function. (TARGET_EMUTLS_VAR_INIT): New hook. config/ * gthr.m4 (GCC_AC_THREAD_HEADER): Add case for gcn. libgcc/ * configure: Regenerate. * config/gcn/gthr-gcn.h: New. Co-Authored-By: Andrew Stubbs From-SVN: r272647 --- libgcc/ChangeLog | 6 ++ libgcc/config/gcn/gthr-gcn.h | 163 +++++++++++++++++++++++++++++++++++++++++++ libgcc/configure | 1 + 3 files changed, 170 insertions(+) create mode 100644 libgcc/config/gcn/gthr-gcn.h (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 53acb8b..c6c1b1f 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,9 @@ +2019-06-25 Kwok Cheung Yeung + Andrew Stubbs + + * configure: Regenerate. + * config/gcn/gthr-gcn.h: New. + 2019-06-18 Tom de Vries * config/nvptx/crt0.c (__main): Declare. diff --git a/libgcc/config/gcn/gthr-gcn.h b/libgcc/config/gcn/gthr-gcn.h new file mode 100644 index 0000000..4227b51 --- /dev/null +++ b/libgcc/config/gcn/gthr-gcn.h @@ -0,0 +1,163 @@ +/* Threads compatibility routines for libgcc2 and libobjc. */ +/* Compile this one with gcc. */ +/* Copyright (C) 2019 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 +. */ + +/* AMD GCN does not support dynamic creation of threads. There may be many + hardware threads, but they're all created simultaneously at launch time. + + This implementation is intended to provide mutexes for libgfortran, etc. + It is not intended to provide a TLS implementation at this time, + although that may be added later if needed. + + __gthread_active_p returns "1" to ensure that mutexes are used, and that + programs attempting to use emutls will fail with the appropriate abort. + It is expected that the TLS tests will fail. */ + +#ifndef GCC_GTHR_GCN_H +#define GCC_GTHR_GCN_H + +#define __GTHREADS 1 + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef _LIBOBJC +#error "Objective C is not supported on AMD GCN" +#else + +static inline int +__gthread_active_p (void) +{ + return 1; +} + +typedef int __gthread_key_t; +typedef int __gthread_once_t; +typedef int __gthread_mutex_t; +typedef int __gthread_recursive_mutex_t; + +#define __GTHREAD_ONCE_INIT 0 +#define __GTHREAD_MUTEX_INIT 0 +#define __GTHREAD_RECURSIVE_MUTEX_INIT 0 + +static inline int +__gthread_once (__gthread_once_t *__once __attribute__((unused)), + void (*__func) (void) __attribute__((unused))) +{ + return 0; +} + +static inline int +__gthread_key_create (__gthread_key_t *__key __attribute__((unused)), + void (*__dtor) (void *) __attribute__((unused))) +{ + /* Operation is not supported. */ + return -1; +} + +static inline int +__gthread_key_delete (__gthread_key_t __key __attribute__ ((__unused__))) +{ + /* Operation is not supported. */ + return -1; +} + +static inline void * +__gthread_getspecific (__gthread_key_t __key __attribute__((unused))) +{ + return NULL; +} + +static inline int +__gthread_setspecific (__gthread_key_t __key __attribute__((unused)), + const void *__ptr __attribute__((unused))) +{ + /* Operation is not supported. */ + return -1; +} + +static inline int +__gthread_mutex_destroy (__gthread_mutex_t *__mutex __attribute__((unused))) +{ + return 0; +} + +static inline int +__gthread_recursive_mutex_destroy (__gthread_recursive_mutex_t *__mutex __attribute__((unused))) +{ + return 0; +} + + +static inline int +__gthread_mutex_lock (__gthread_mutex_t *__mutex) +{ + while (__sync_lock_test_and_set (__mutex, 1)) + asm volatile ("s_sleep\t1" ::: "memory"); + + return 0; +} + +static inline int +__gthread_mutex_trylock (__gthread_mutex_t *__mutex) +{ + return __sync_lock_test_and_set (__mutex, 1); +} + +static inline int +__gthread_mutex_unlock (__gthread_mutex_t *__mutex) +{ + __sync_lock_release (__mutex); + + return 0; +} + +static inline int +__gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *__mutex __attribute__((unused))) +{ + /* Operation is not supported. */ + return -1; +} + +static inline int +__gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *__mutex __attribute__((unused))) +{ + /* Operation is not supported. */ + return -1; +} + +static inline int +__gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *__mutex __attribute__((unused))) +{ + /* Operation is not supported. */ + return -1; +} +#endif /* _LIBOBJC */ + +#ifdef __cplusplus +} +#endif + +#endif /* ! GCC_GTHR_GCN_H */ diff --git a/libgcc/configure b/libgcc/configure index b2914de..af910b6 100644 --- a/libgcc/configure +++ b/libgcc/configure @@ -5542,6 +5542,7 @@ tm_file="${tm_file_}" case $target_thread_file in aix) thread_header=config/rs6000/gthr-aix.h ;; dce) thread_header=config/pa/gthr-dce.h ;; + gcn) thread_header=config/gcn/gthr-gcn.h ;; lynx) thread_header=config/gthr-lynx.h ;; mipssde) thread_header=config/mips/gthr-mipssde.h ;; posix) thread_header=gthr-posix.h ;; -- cgit v1.1 From 52a47d2856bb64b33ba037d404c1c00cb9e65796 Mon Sep 17 00:00:00 2001 From: Andrew Stubbs Date: Tue, 25 Jun 2019 11:41:33 +0000 Subject: Stub implementation of unwinding for AMD GCN. 2019-06-25 Andrew Stubbs libgcc/ * config/gcn/t-amdgcn (LIB2ADD): Add unwind-gcn.c. * config/gcn/unwind-gcn.c: New file. From-SVN: r272648 --- libgcc/ChangeLog | 5 +++++ libgcc/config/gcn/t-amdgcn | 3 ++- libgcc/config/gcn/unwind-gcn.c | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 libgcc/config/gcn/unwind-gcn.c (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index c6c1b1f..4b9a470 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +2019-06-25 Andrew Stubbs + + * config/gcn/t-amdgcn (LIB2ADD): Add unwind-gcn.c. + * config/gcn/unwind-gcn.c: New file. + 2019-06-25 Kwok Cheung Yeung Andrew Stubbs diff --git a/libgcc/config/gcn/t-amdgcn b/libgcc/config/gcn/t-amdgcn index 8687c9f..adbd866 100644 --- a/libgcc/config/gcn/t-amdgcn +++ b/libgcc/config/gcn/t-amdgcn @@ -1,5 +1,6 @@ LIB2ADD += $(srcdir)/config/gcn/lib2-divmod.c \ - $(srcdir)/config/gcn/lib2-divmod-hi.c + $(srcdir)/config/gcn/lib2-divmod-hi.c \ + $(srcdir)/config/gcn/unwind-gcn.c LIB2ADDEH= LIB2FUNCS_EXCLUDE=__main diff --git a/libgcc/config/gcn/unwind-gcn.c b/libgcc/config/gcn/unwind-gcn.c new file mode 100644 index 0000000..8aa84d3 --- /dev/null +++ b/libgcc/config/gcn/unwind-gcn.c @@ -0,0 +1,37 @@ +/* Stub unwinding implementation. + + Copyright (C) 2019 Free Software Foundation, Inc. + Contributed by Mentor Graphics + + 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 + . */ + +#include "unwind.h" + +_Unwind_Reason_Code +_Unwind_Backtrace(_Unwind_Trace_Fn trace, void * trace_argument) +{ + return 0; +} + +_Unwind_Ptr +_Unwind_GetIPInfo (struct _Unwind_Context *c, int *ip_before_insn) +{ + return 0; +} -- cgit v1.1 From e5ce4cbc72adbfc8284ed6998b7d36c9f50c1ef6 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 25 Jun 2019 13:49:36 +0200 Subject: Do not call strlen with NULL argument in libgcov. 2019-06-25 Martin Liska * libgcov-driver-system.c (replace_filename_variables): Do not call strlen with NULL argument. From-SVN: r272650 --- libgcc/ChangeLog | 5 +++++ libgcc/libgcov-driver-system.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 4b9a470..a589615 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +2019-06-25 Martin Liska + + * libgcov-driver-system.c (replace_filename_variables): Do not + call strlen with NULL argument. + 2019-06-25 Andrew Stubbs * config/gcn/t-amdgcn (LIB2ADD): Add unwind-gcn.c. diff --git a/libgcc/libgcov-driver-system.c b/libgcc/libgcov-driver-system.c index b5f3e89..39dc627 100644 --- a/libgcc/libgcov-driver-system.c +++ b/libgcc/libgcov-driver-system.c @@ -186,13 +186,14 @@ replace_filename_variables (char *filename) /* Concat beginning of the path, replacement and ending of the path. */ unsigned end = length - (p - filename); - unsigned repl_length = strlen (replacement); + unsigned repl_length = replacement != NULL ? strlen (replacement) : 0; char *buffer = (char *)xmalloc (start + end + repl_length + 1); char *buffer_ptr = buffer; buffer_ptr = (char *)memcpy (buffer_ptr, filename, start); buffer_ptr += start; - buffer_ptr = (char *)memcpy (buffer_ptr, replacement, repl_length); + if (replacement != NULL) + buffer_ptr = (char *)memcpy (buffer_ptr, replacement, repl_length); buffer_ptr += repl_length; buffer_ptr = (char *)memcpy (buffer_ptr, p, end); buffer_ptr += end; -- cgit v1.1 From a8e55c61f8b3dba1931405959c506919a6a75234 Mon Sep 17 00:00:00 2001 From: Iain Sandoe Date: Tue, 25 Jun 2019 20:11:11 +0000 Subject: [Darwin, PPC] Move the out of line register save/restore to an endfile. We have been including this in libgcc, which means that we have to append -lgcc even when using shared libgcc. In preparation for revision of libgcc split this into an endfile. gcc/ 2019-06-25 Iain Sandoe * config/rs6000/darwin.h (ENDFILE_SPEC): New. libgcc/ 2019-06-25 Iain Sandoe * config.host: Add libef_ppc.a to the extra files for powerpc-darwin. * config/rs6000/t-darwin: (PPC_ENDFILE_SRC, PPC_ENDFILE_OBJS): New. Build objects for the out of line save/restore register functions so that they can be used for any supported Darwin version. * config/t-darwin: Default the build Darwin version to Darwin8 (MacOS 10.4). From-SVN: r272659 --- libgcc/ChangeLog | 9 +++++++++ libgcc/config/rs6000/t-darwin | 42 ++++++++++++++++++++++++++++++++++-------- libgcc/config/t-darwin | 2 +- 3 files changed, 44 insertions(+), 9 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index a589615..a6e8c20 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,12 @@ +2019-06-25 Iain Sandoe + + * config.host: Add libef_ppc.a to the extra files for powerpc-darwin. + * config/rs6000/t-darwin: (PPC_ENDFILE_SRC, PPC_ENDFILE_OBJS): New. + Build objects for the out of line save/restore register functions + so that they can be used for any supported Darwin version. + * config/t-darwin: Default the build Darwin version to Darwin8 + (MacOS 10.4). + 2019-06-25 Martin Liska * libgcov-driver-system.c (replace_filename_variables): Do not diff --git a/libgcc/config/rs6000/t-darwin b/libgcc/config/rs6000/t-darwin index 61da0bd..0c238b7 100644 --- a/libgcc/config/rs6000/t-darwin +++ b/libgcc/config/rs6000/t-darwin @@ -3,23 +3,49 @@ DARWIN_EXTRA_CRT_BUILD_CFLAGS = -mlongcall -mmacosx-version-min=10.4 crt2.o: $(srcdir)/config/rs6000/darwin-crt2.c $(crt_compile) $(DARWIN_EXTRA_CRT_BUILD_CFLAGS) -c $< +# The outlined register save/restore functions need to run anywhere, and +# they must be leaf functions suitable for use in an endfile. + +PPC_ENDFILE_SRC = \ + $(srcdir)/config/rs6000/darwin-gpsave.S \ + $(srcdir)/config/rs6000/darwin-fpsave.S \ + $(srcdir)/config/rs6000/darwin-vecsave.S + +PPC_ENDFILE_OBJS = \ + darwin-gpsave.o \ + darwin-fpsave.o \ + darwin-vecsave.o + +darwin-gpsave.o: $(srcdir)/config/rs6000/darwin-gpsave.S + $(crt_compile) -mmacosx-version-min=10.1 -c $< + +darwin-fpsave.o: $(srcdir)/config/rs6000/darwin-fpsave.S + $(crt_compile) -mmacosx-version-min=10.1 -c $< + +darwin-vecsave.o: $(srcdir)/config/rs6000/darwin-vecsave.S + $(crt_compile) -mmacosx-version-min=10.1 -c $< + +# We build these into a library, so that they are only linked as needed and not +# forced into every object. + +libef_ppc.a: $(PPC_ENDFILE_OBJS) + $(AR_CREATE_FOR_TARGET) $@ $(PPC_ENDFILE_OBJS) + $(RANLIB_FOR_TARGET) $@ + LIB2ADD = $(srcdir)/config/rs6000/darwin-tramp.S \ $(srcdir)/config/darwin-64.c \ - $(srcdir)/config/rs6000/darwin-fpsave.S \ - $(srcdir)/config/rs6000/darwin-gpsave.S \ $(srcdir)/config/rs6000/darwin-world.S \ $(srcdir)/config/rs6000/ppc64-fp.c -LIB2ADD_ST = \ - $(srcdir)/config/rs6000/darwin-vecsave.S - # The .S files above are designed to run on all processors, even though # they use AltiVec instructions. # -Wa is used because -force_cpusubtype_ALL doesn't work with -dynamiclib. -# -mmacosx-version-min=10.4 is used to provide compatibility for code from -# earlier OSX versions. -HOST_LIBGCC2_CFLAGS += -Wa,-force_cpusubtype_ALL -mmacosx-version-min=10.4 +HOST_LIBGCC2_CFLAGS += -Wa,-force_cpusubtype_ALL + +# Although the default for 10.4 is G3, we need the unwinder to be built +# with vector support so that the "save/rest_world" outlined functions are +# correctly invoked. unwind-dw2_s.o: HOST_LIBGCC2_CFLAGS += -maltivec unwind-dw2.o: HOST_LIBGCC2_CFLAGS += -maltivec diff --git a/libgcc/config/t-darwin b/libgcc/config/t-darwin index 8340ea2..2fcb712 100644 --- a/libgcc/config/t-darwin +++ b/libgcc/config/t-darwin @@ -1,6 +1,6 @@ # Set this as a minimum (unless overriden by arch t-files) since it's a # reasonable lowest common denominator that works for all our archs. -HOST_LIBGCC2_CFLAGS += -mmacosx-version-min=10.5 +HOST_LIBGCC2_CFLAGS += -mmacosx-version-min=10.4 crt3.o: $(srcdir)/config/darwin-crt3.c $(crt_compile) $(DARWIN_EXTRA_CRT_BUILD_CFLAGS) -c $< -- cgit v1.1 From ebecdd0c3649b02de48836d17baa949fa8f106f8 Mon Sep 17 00:00:00 2001 From: Iain Sandoe Date: Tue, 25 Jun 2019 20:12:49 +0000 Subject: Darwin, add a missed file change From the last commit. 2019-06-25 Iain Sandoe * config.host: Add libef_ppc.a to the extra files for powerpc-darwin. From-SVN: r272660 --- libgcc/config.host | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libgcc') diff --git a/libgcc/config.host b/libgcc/config.host index e6a834b..cf52b27 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -1091,11 +1091,11 @@ powerpc-*-darwin*) ;; esac tmake_file="$tmake_file rs6000/t-ibm-ldouble" - extra_parts="$extra_parts crt2.o" + extra_parts="$extra_parts crt2.o libef_ppc.a" ;; powerpc64-*-darwin*) tmake_file="$tmake_file rs6000/t-darwin64 rs6000/t-ibm-ldouble" - extra_parts="$extra_parts crt2.o" + extra_parts="$extra_parts crt2.o libef_ppc.a" ;; powerpc*-*-freebsd*) tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-savresfgpr rs6000/t-crtstuff rs6000/t-freebsd t-softfp-sfdf t-softfp-excl t-softfp" -- cgit v1.1 From c2f7a665a184e4ff00a6ac3fc147f63f276cc5a5 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Thu, 27 Jun 2019 10:21:32 +0200 Subject: Fix misc stuff seen by clang-static-analyzer. 2019-06-27 Martin Liska * lto-dump.c (struct symbol_entry): Add default dtor. (struct variable_entry): Likewise. (struct function_entry): Likewise. (dump_list_functions): Release memory. (dump_list_variables): Likewise. 2019-06-27 Martin Liska * libgcov-util.c (gcov_profile_merge): Release allocated memory. (calculate_overlap): Likewise. From-SVN: r272733 --- libgcc/ChangeLog | 6 ++++++ libgcc/libgcov-util.c | 5 +++++ 2 files changed, 11 insertions(+) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index a6e8c20..fa82306 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,9 @@ +2019-06-27 Martin Liska + + * libgcov-util.c (gcov_profile_merge): Release allocated + memory. + (calculate_overlap): Likewise. + 2019-06-25 Iain Sandoe * config.host: Add libef_ppc.a to the extra files for powerpc-darwin. diff --git a/libgcc/libgcov-util.c b/libgcc/libgcov-util.c index c794132..404ece6 100644 --- a/libgcc/libgcov-util.c +++ b/libgcc/libgcov-util.c @@ -681,6 +681,9 @@ gcov_profile_merge (struct gcov_info *tgt_profile, struct gcov_info *src_profile tgt_tail = gi_ptr; } + free (in_src_not_tgt); + free (tgt_infos); + return 0; } @@ -1280,6 +1283,8 @@ calculate_overlap (struct gcov_info *gcov_list1, } + free (all_infos); + if (overlap_obj_level) printf(" SUM:%36s overlap = %6.2f%% (%5.2f%% %5.2f%%)\n", "", sum_val*100, sum_cum_1*100, sum_cum_2*100); -- cgit v1.1 From 45309d286c80ecad8b7a4efba0e9aba35d847af6 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Thu, 27 Jun 2019 12:25:21 +0200 Subject: Remove quite obvious dead assignments. 2019-06-27 Martin Liska * asan.c (asan_emit_allocas_unpoison): Remove obviously dead assignments. * bt-load.c (move_btr_def): Likewise. * builtins.c (expand_builtin_apply_args_1): Likewise. (expand_builtin_apply): Likewise. * cfgexpand.c (expand_asm_stmt): Likewise. (construct_init_block): Likewise. * cfghooks.c (verify_flow_info): Likewise. * cfgloopmanip.c (remove_path): Likewise. * cfgrtl.c (rtl_verify_bb_layout): Likewise. * cgraph.c (cgraph_node::set_pure_flag): Likewise. * combine.c (simplify_if_then_else): Likewise. * config/i386/i386.c (ix86_setup_incoming_vararg_bounds): Likewise. (choose_basereg): Likewise. (ix86_expand_prologue): Likewise. (ix86_preferred_output_reload_class): Likewise. * cselib.c (cselib_record_sets): Likewise. * df-scan.c (df_scan_alloc): Likewise. * dojump.c (do_jump_by_parts_greater_rtx): Likewise. * early-remat.c (early_remat::record_equiv_candidates): Likewise. * emit-rtl.c (try_split): Likewise. * graphite-scop-detection.c (assign_parameter_index_in_region): Likewise. * ipa-cp.c (cgraph_edge_brings_all_agg_vals_for_node): Likewise. * ira-color.c (setup_profitable_hard_regs): Likewise. * ira.c (rtx_moveable_p): Likewise. * lra-eliminations.c (eliminate_regs_in_insn): Likewise. * read-rtl.c (read_subst_mapping): Likewise. * regrename.c (scan_rtx): Likewise. * reorg.c (fill_slots_from_thread): Likewise. * tree-inline.c (tree_function_versioning): Likewise. * tree-ssa-reassoc.c (optimize_ops_list): Likewise. * tree-ssa-sink.c (statement_sink_location): Likewise. * tree-ssa-threadedge.c (thread_across_edge): Likewise. * tree-vect-loop.c (vect_get_loop_niters): Likewise. (vect_create_epilog_for_reduction): Likewise. * tree.c (build_nonstandard_integer_type): Likewise. 2019-06-27 Martin Liska * class.c (adjust_clone_args): Remove obviously dead assignments. (dump_class_hierarchy_r): Likewise. * decl.c (check_initializer): Likewise. * parser.c (cp_parser_lambda_expression): Likewise. * pt.c (unify_bound_ttp_args): Likewise. (convert_template_argument): Likewise. * rtti.c (build_headof): Likewise. * typeck.c (convert_for_initialization): Likewise. 2019-06-27 Martin Liska * libgcov-driver-system.c (gcov_exit_open_gcda_file): Remove obviously dead assignments. * libgcov-util.c: Likewise. From-SVN: r272744 --- libgcc/ChangeLog | 6 ++++++ libgcc/libgcov-driver-system.c | 4 +--- libgcc/libgcov-util.c | 3 +-- 3 files changed, 8 insertions(+), 5 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index fa82306..5b560e8 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,5 +1,11 @@ 2019-06-27 Martin Liska + * libgcov-driver-system.c (gcov_exit_open_gcda_file): Remove obviously + dead assignments. + * libgcov-util.c: Likewise. + +2019-06-27 Martin Liska + * libgcov-util.c (gcov_profile_merge): Release allocated memory. (calculate_overlap): Likewise. diff --git a/libgcc/libgcov-driver-system.c b/libgcc/libgcov-driver-system.c index 39dc627..7d48a1f 100644 --- a/libgcc/libgcov-driver-system.c +++ b/libgcc/libgcov-driver-system.c @@ -263,10 +263,8 @@ static int gcov_exit_open_gcda_file (struct gcov_info *gi_ptr, struct gcov_filename *gf) { - const char *fname = gi_ptr->filename; int append_slash = 0; - - fname = gi_ptr->filename; + const char *fname = gi_ptr->filename; /* Build relocated filename, stripping off leading directories from the initial filename if requested. */ diff --git a/libgcc/libgcov-util.c b/libgcc/libgcov-util.c index 404ece6..94d4575 100644 --- a/libgcc/libgcov-util.c +++ b/libgcc/libgcov-util.c @@ -461,10 +461,9 @@ gcov_read_profile_dir (const char* dir_name, int recompute_summary ATTRIBUTE_UNU #ifdef HAVE_FTW_H ftw (".", ftw_read_file, 50); #endif - ret = chdir (pwd); + chdir (pwd); free (pwd); - return gcov_info_head;; } -- cgit v1.1 From 5a4602805eb3ebddbc935b102481e63bffc7c5e6 Mon Sep 17 00:00:00 2001 From: Ilia Diachkov Date: Thu, 27 Jun 2019 23:41:03 +0000 Subject: Add --disable-tm-clone-registry libgcc configure option. This patch adds libgcc configuration option to disable TM clone registry. This option helps to reduce code size for embedded targets which do not need transactional memory support. gcc/ * doc/install.texi: Document --disable-tm-clone-registry. libgcc/ * Makefile.in (USE_TM_CLONE_REGISTRY): New. (CRTSTUFF_CFLAGS): Use USE_TM_CLONE_REGISTRY. * configure.ac: Add --disable-tm-clone-registry option. * configure: Regenerate. From-SVN: r272769 --- libgcc/ChangeLog | 7 +++++++ libgcc/Makefile.in | 4 +++- libgcc/configure | 15 +++++++++++++++ libgcc/configure.ac | 10 ++++++++++ 4 files changed, 35 insertions(+), 1 deletion(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 5b560e8..d69e55e 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,10 @@ +2019-06-27 Ilia Diachkov + + * Makefile.in (USE_TM_CLONE_REGISTRY): New. + (CRTSTUFF_CFLAGS): Use USE_TM_CLONE_REGISTRY. + * configure.ac: Add --disable-tm-clone-registry option. + * configure: Regenerate. + 2019-06-27 Martin Liska * libgcov-driver-system.c (gcov_exit_open_gcda_file): Remove obviously diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in index 33b8380..e10a197 100644 --- a/libgcc/Makefile.in +++ b/libgcc/Makefile.in @@ -259,6 +259,8 @@ PICFLAG = @PICFLAG@ CET_FLAGS = @CET_FLAGS@ +USE_TM_CLONE_REGISTRY = @use_tm_clone_registry@ + # Defined in libgcc2.c, included only in the static library. LIB2FUNCS_ST = _eprintf __gcc_bcmp @@ -299,7 +301,7 @@ CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \ $(NO_PIE_CFLAGS) -finhibit-size-directive -fno-inline -fno-exceptions \ -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize \ -fbuilding-libgcc -fno-stack-protector $(FORCE_EXPLICIT_EH_REGISTRY) \ - $(INHIBIT_LIBC_CFLAGS) + $(INHIBIT_LIBC_CFLAGS) $(USE_TM_CLONE_REGISTRY) # Extra flags to use when compiling crt{begin,end}.o. CRTSTUFF_T_CFLAGS = diff --git a/libgcc/configure b/libgcc/configure index af910b6..29f6473 100644 --- a/libgcc/configure +++ b/libgcc/configure @@ -604,6 +604,7 @@ vis_hide solaris_ld_v2_maps real_host_noncanonical accel_dir_suffix +use_tm_clone_registry force_explicit_eh_registry CET_FLAGS fixed_point @@ -712,6 +713,7 @@ enable_decimal_float with_system_libunwind enable_cet enable_explicit_exception_frame_registration +enable_tm_clone_registry with_glibc_version enable_tls with_gcc_major_version_only @@ -1355,6 +1357,7 @@ Optional Features: register exception tables explicitly at module start, for use e.g. for compatibility with installations without PT_GNU_EH_FRAME support + --disable-tm-clone-registry disable TM clone registry --enable-tls Use thread-local storage [default=yes] Optional Packages: @@ -4953,6 +4956,18 @@ fi +# Check whether --enable-tm-clone-registry was given. +if test "${enable_tm_clone_registry+set}" = set; then : + enableval=$enable_tm_clone_registry; +use_tm_clone_registry= +if test "$enable_tm_clone_registry" = no; then + use_tm_clone_registry=-DUSE_TM_CLONE_REGISTRY=0 +fi + +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${acl_cv_prog_gnu_ld+:} false; then : diff --git a/libgcc/configure.ac b/libgcc/configure.ac index 5f11455..b1b90d2 100644 --- a/libgcc/configure.ac +++ b/libgcc/configure.ac @@ -261,6 +261,16 @@ fi ]) AC_SUBST([force_explicit_eh_registry]) +AC_ARG_ENABLE([tm-clone-registry], +[ --disable-tm-clone-registry disable TM clone registry], +[ +use_tm_clone_registry= +if test "$enable_tm_clone_registry" = no; then + use_tm_clone_registry=-DUSE_TM_CLONE_REGISTRY=0 +fi +]) +AC_SUBST([use_tm_clone_registry]) + AC_LIB_PROG_LD_GNU AC_MSG_CHECKING([for thread model used by GCC]) -- cgit v1.1 From 1b309ca5edddd6bf8051993876df5f123394bc79 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Wed, 3 Jul 2019 14:42:02 +0200 Subject: Support N values in libgcov for single value counter type. 2019-07-03 Martin Liska * gcc.dg/tree-prof/val-prof-2.c: Update scanned pattern as we do now better. 2019-07-03 Martin Liska * libgcov-merge.c (merge_single_value_set): Support N values. * libgcov-profiler.c (__gcov_one_value_profiler_body): Likewise. From-SVN: r273004 --- libgcc/ChangeLog | 5 +++++ libgcc/libgcov-merge.c | 48 +++++++++++++++++++++++++---------------------- libgcc/libgcov-profiler.c | 42 ++++++++++++++++++++++++++++++++--------- 3 files changed, 64 insertions(+), 31 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index d69e55e..90183dc 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +2019-07-03 Martin Liska + + * libgcov-merge.c (merge_single_value_set): Support N values. + * libgcov-profiler.c (__gcov_one_value_profiler_body): Likewise. + 2019-06-27 Ilia Diachkov * Makefile.in (USE_TM_CLONE_REGISTRY): New. diff --git a/libgcc/libgcov-merge.c b/libgcc/libgcov-merge.c index f778cc4..8436700 100644 --- a/libgcc/libgcov-merge.c +++ b/libgcc/libgcov-merge.c @@ -89,49 +89,53 @@ __gcov_merge_time_profile (gcov_type *counters, unsigned n_counters) static void merge_single_value_set (gcov_type *counters) { - unsigned j; - gcov_type value, counter; - /* First value is number of total executions of the profiler. */ gcov_type all = gcov_get_counter_ignore_scaling (-1); counters[0] += all; ++counters; + /* Read all part values. */ + gcov_type read_counters[2 * GCOV_DISK_SINGLE_VALUES]; + for (unsigned i = 0; i < GCOV_DISK_SINGLE_VALUES; i++) { - value = gcov_get_counter_target (); - counter = gcov_get_counter_ignore_scaling (-1); + read_counters[2 * i] = gcov_get_counter_target (); + read_counters[2 * i + 1] = gcov_get_counter_ignore_scaling (-1); + } - if (counter == -1) - { - counters[1] = -1; - /* We can't return as we need to read all counters. */ - continue; - } - else if (counter == 0 || counters[1] == -1) - { - /* We can't return as we need to read all counters. */ - continue; - } + if (read_counters[1] == -1) + { + counters[1] = -1; + return; + } + + for (unsigned i = 0; i < GCOV_DISK_SINGLE_VALUES; i++) + { + if (read_counters[2 * i + 1] == 0) + return; + unsigned j; for (j = 0; j < GCOV_DISK_SINGLE_VALUES; j++) { - if (counters[2 * j] == value) + if (counters[2 * j] == read_counters[2 * i]) { - counters[2 * j + 1] += counter; + counters[2 * j + 1] += read_counters[2 * i + 1]; break; } else if (counters[2 * j + 1] == 0) { - counters[2 * j] = value; - counters[2 * j + 1] = counter; + counters[2 * j] += read_counters[2 * i]; + counters[2 * j + 1] += read_counters[2 * i + 1]; break; } } - /* We haven't found a free slot for the value, mark overflow. */ + /* We haven't found a slot, bail out. */ if (j == GCOV_DISK_SINGLE_VALUES) - counters[1] = -1; + { + counters[1] = -1; + return; + } } } diff --git a/libgcc/libgcov-profiler.c b/libgcc/libgcov-profiler.c index 9ba65b9..04d6f9c 100644 --- a/libgcc/libgcov-profiler.c +++ b/libgcc/libgcov-profiler.c @@ -118,20 +118,44 @@ static inline void __gcov_one_value_profiler_body (gcov_type *counters, gcov_type value, int use_atomic) { - if (value == counters[1]) - counters[2]++; - else if (counters[2] == 0) + if (use_atomic) + __atomic_fetch_add (&counters[0], 1, __ATOMIC_RELAXED); + else + counters[0]++; + + ++counters; + + /* We have GCOV_DISK_SINGLE_VALUES as we can keep multiple values + next to each other. */ + unsigned sindex = 0; + + for (unsigned i = 0; i < GCOV_DISK_SINGLE_VALUES; i++) { - counters[2] = 1; - counters[1] = value; + if (value == counters[2 * i]) + { + if (use_atomic) + __atomic_fetch_add (&counters[2 * i + 1], 1, __ATOMIC_RELAXED); + else + counters[2 * i + 1]++; + return; + } + else if (counters[2 * i + 1] == 0) + { + /* We found an empty slot. */ + counters[2 * i] = value; + counters[2 * i + 1] = 1; + return; + } + + if (counters[2 * i + 1] < counters[2 * sindex + 1]) + sindex = i; } - else - counters[2]--; + /* We haven't found an empty slot, then decrement the smallest. */ if (use_atomic) - __atomic_fetch_add (&counters[0], 1, __ATOMIC_RELAXED); + __atomic_fetch_sub (&counters[2 * sindex + 1], 1, __ATOMIC_RELAXED); else - counters[0]++; + counters[2 * sindex + 1]--; } #ifdef L_gcov_one_value_profiler_v2 -- cgit v1.1 From 596341c741a4a746497a1da8322fce0ad625e26b Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Wed, 3 Jul 2019 14:42:23 +0200 Subject: Rename SINGE_VALUE to TOPN_VALUES counters. 2019-07-03 Martin Liska * gcov-counter.def (GCOV_COUNTER_V_SINGLE): Remove. (GCOV_COUNTER_V_TOPN): New. (GCOV_COUNTER_V_INDIR): Use _topn. * gcov-io.h (GCOV_DISK_SINGLE_VALUES): Remove. (GCOV_TOPN_VALUES): New. (GCOV_SINGLE_VALUE_COUNTERS): Remove. (GCOV_TOPN_VALUES_COUNTERS): New. * profile.c (instrument_values): Use HIST_TYPE_TOPN_VALUES. * tree-profile.c: (gimple_init_gcov_profiler): Rename variables from one_value to topn_values. (gimple_gen_one_value_profiler): Remove. (gimple_gen_topn_values_profiler): New function. * value-prof.c (dump_histogram_value): Use TOPN_VALUES names instead of SINGLE_VALUE. (stream_out_histogram_value): Likewise. (stream_in_histogram_value): Likewise. (get_most_common_single_value): Likewise. (gimple_divmod_fixed_value_transform): Likewise. (gimple_stringops_transform): Likewise. (gimple_divmod_values_to_profile): Likewise. (gimple_stringops_values_to_profile): Likewise. (gimple_find_values_to_profile): Likewise. * value-prof.h (enum hist_type): Rename to TOPN. (gimple_gen_one_value_profiler): Remove. (gimple_gen_topn_values_profiler): New. 2019-07-03 Martin Liska * Makefile.in: Use topn_values instead of one_value names. * libgcov-merge.c (__gcov_merge_single): Move to ... (__gcov_merge_topn): ... this. (merge_single_value_set): Move to ... (merge_topn_values_set): ... this. * libgcov-profiler.c (__gcov_one_value_profiler_body): Move to ... (__gcov_topn_values_profiler_body): ... this. (__gcov_one_value_profiler_v2): Move to ... (__gcov_topn_values_profiler): ... this. (__gcov_one_value_profiler_v2_atomic): Move to ... (__gcov_topn_values_profiler_atomic): ... this. (__gcov_indirect_call_profiler_v4): Remove. * libgcov-util.c (__gcov_single_counter_op): Move to ... (__gcov_topn_counter_op): ... this. * libgcov.h (L_gcov_merge_single): Remove. (L_gcov_merge_topn): New. (__gcov_merge_single): Remove. (__gcov_merge_topn): New. (__gcov_one_value_profiler_v2): Move to .. (__gcov_topn_values_profiler): ... this. (__gcov_one_value_profiler_v2_atomic): Move to ... (__gcov_topn_values_profiler_atomic): ... this. From-SVN: r273005 --- libgcc/ChangeLog | 26 ++++++++++++++++++++++++++ libgcc/Makefile.in | 6 +++--- libgcc/libgcov-merge.c | 30 +++++++++++++++--------------- libgcc/libgcov-profiler.c | 30 ++++++++++++------------------ libgcc/libgcov-util.c | 6 +++--- libgcc/libgcov.h | 10 +++++----- 6 files changed, 64 insertions(+), 44 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 90183dc..d4cbee0 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,5 +1,31 @@ 2019-07-03 Martin Liska + * Makefile.in: Use topn_values instead of one_value names. + * libgcov-merge.c (__gcov_merge_single): Move to ... + (__gcov_merge_topn): ... this. + (merge_single_value_set): Move to ... + (merge_topn_values_set): ... this. + * libgcov-profiler.c (__gcov_one_value_profiler_body): Move to + ... + (__gcov_topn_values_profiler_body): ... this. + (__gcov_one_value_profiler_v2): Move to ... + (__gcov_topn_values_profiler): ... this. + (__gcov_one_value_profiler_v2_atomic): Move to ... + (__gcov_topn_values_profiler_atomic): ... this. + (__gcov_indirect_call_profiler_v4): Remove. + * libgcov-util.c (__gcov_single_counter_op): Move to ... + (__gcov_topn_counter_op): ... this. + * libgcov.h (L_gcov_merge_single): Remove. + (L_gcov_merge_topn): New. + (__gcov_merge_single): Remove. + (__gcov_merge_topn): New. + (__gcov_one_value_profiler_v2): Move to .. + (__gcov_topn_values_profiler): ... this. + (__gcov_one_value_profiler_v2_atomic): Move to ... + (__gcov_topn_values_profiler_atomic): ... this. + +2019-07-03 Martin Liska + * libgcov-merge.c (merge_single_value_set): Support N values. * libgcov-profiler.c (__gcov_one_value_profiler_body): Likewise. diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in index e10a197..5608352 100644 --- a/libgcc/Makefile.in +++ b/libgcc/Makefile.in @@ -889,14 +889,14 @@ include $(iterator) # Build libgcov components. -LIBGCOV_MERGE = _gcov_merge_add _gcov_merge_single \ +LIBGCOV_MERGE = _gcov_merge_add _gcov_merge_topn \ _gcov_merge_ior _gcov_merge_time_profile LIBGCOV_PROFILER = _gcov_interval_profiler \ _gcov_interval_profiler_atomic \ _gcov_pow2_profiler \ _gcov_pow2_profiler_atomic \ - _gcov_one_value_profiler_v2 \ - _gcov_one_value_profiler_v2_atomic \ + _gcov_topn_values_profiler \ + _gcov_topn_values_profiler_atomic \ _gcov_average_profiler \ _gcov_average_profiler_atomic \ _gcov_ior_profiler \ diff --git a/libgcc/libgcov-merge.c b/libgcc/libgcov-merge.c index 8436700..15f27ae 100644 --- a/libgcc/libgcov-merge.c +++ b/libgcc/libgcov-merge.c @@ -33,9 +33,9 @@ void __gcov_merge_add (gcov_type *counters __attribute__ ((unused)), unsigned n_counters __attribute__ ((unused))) {} #endif -#ifdef L_gcov_merge_single -void __gcov_merge_single (gcov_type *counters __attribute__ ((unused)), - unsigned n_counters __attribute__ ((unused))) {} +#ifdef L_gcov_merge_topn +void __gcov_merge_topn (gcov_type *counters __attribute__ ((unused)), + unsigned n_counters __attribute__ ((unused))) {} #endif #else @@ -84,10 +84,10 @@ __gcov_merge_time_profile (gcov_type *counters, unsigned n_counters) } #endif /* L_gcov_merge_time_profile */ -#ifdef L_gcov_merge_single +#ifdef L_gcov_merge_topn static void -merge_single_value_set (gcov_type *counters) +merge_topn_values_set (gcov_type *counters) { /* First value is number of total executions of the profiler. */ gcov_type all = gcov_get_counter_ignore_scaling (-1); @@ -95,9 +95,9 @@ merge_single_value_set (gcov_type *counters) ++counters; /* Read all part values. */ - gcov_type read_counters[2 * GCOV_DISK_SINGLE_VALUES]; + gcov_type read_counters[2 * GCOV_TOPN_VALUES]; - for (unsigned i = 0; i < GCOV_DISK_SINGLE_VALUES; i++) + for (unsigned i = 0; i < GCOV_TOPN_VALUES; i++) { read_counters[2 * i] = gcov_get_counter_target (); read_counters[2 * i + 1] = gcov_get_counter_ignore_scaling (-1); @@ -109,13 +109,13 @@ merge_single_value_set (gcov_type *counters) return; } - for (unsigned i = 0; i < GCOV_DISK_SINGLE_VALUES; i++) + for (unsigned i = 0; i < GCOV_TOPN_VALUES; i++) { if (read_counters[2 * i + 1] == 0) return; unsigned j; - for (j = 0; j < GCOV_DISK_SINGLE_VALUES; j++) + for (j = 0; j < GCOV_TOPN_VALUES; j++) { if (counters[2 * j] == read_counters[2 * i]) { @@ -131,7 +131,7 @@ merge_single_value_set (gcov_type *counters) } /* We haven't found a slot, bail out. */ - if (j == GCOV_DISK_SINGLE_VALUES) + if (j == GCOV_TOPN_VALUES) { counters[1] = -1; return; @@ -149,13 +149,13 @@ merge_single_value_set (gcov_type *counters) -- counter */ void -__gcov_merge_single (gcov_type *counters, unsigned n_counters) +__gcov_merge_topn (gcov_type *counters, unsigned n_counters) { - gcc_assert (!(n_counters % GCOV_SINGLE_VALUE_COUNTERS)); + gcc_assert (!(n_counters % GCOV_TOPN_VALUES_COUNTERS)); - for (unsigned i = 0; i < (n_counters / GCOV_SINGLE_VALUE_COUNTERS); i++) - merge_single_value_set (counters + (i * GCOV_SINGLE_VALUE_COUNTERS)); + for (unsigned i = 0; i < (n_counters / GCOV_TOPN_VALUES_COUNTERS); i++) + merge_topn_values_set (counters + (i * GCOV_TOPN_VALUES_COUNTERS)); } -#endif /* L_gcov_merge_single */ +#endif /* L_gcov_merge_topn */ #endif /* inhibit_libc */ diff --git a/libgcc/libgcov-profiler.c b/libgcc/libgcov-profiler.c index 04d6f9c..8f877a9 100644 --- a/libgcc/libgcov-profiler.c +++ b/libgcc/libgcov-profiler.c @@ -106,17 +106,11 @@ __gcov_pow2_profiler_atomic (gcov_type *counters, gcov_type value) #endif -/* Tries to determine the most common value among its inputs. Checks if the - value stored in COUNTERS[0] matches VALUE. If this is the case, COUNTERS[1] - is incremented. If this is not the case and COUNTERS[1] is not zero, - COUNTERS[1] is decremented. Otherwise COUNTERS[1] is set to one and - VALUE is stored to COUNTERS[0]. This algorithm guarantees that if this - function is called more than 50% of the time with one value, this value - will be in COUNTERS[0] in the end. */ +/* Tries to determine N most commons value among its inputs. */ static inline void -__gcov_one_value_profiler_body (gcov_type *counters, gcov_type value, - int use_atomic) +__gcov_topn_values_profiler_body (gcov_type *counters, gcov_type value, + int use_atomic) { if (use_atomic) __atomic_fetch_add (&counters[0], 1, __ATOMIC_RELAXED); @@ -125,11 +119,11 @@ __gcov_one_value_profiler_body (gcov_type *counters, gcov_type value, ++counters; - /* We have GCOV_DISK_SINGLE_VALUES as we can keep multiple values + /* We have GCOV_TOPN_VALUES as we can keep multiple values next to each other. */ unsigned sindex = 0; - for (unsigned i = 0; i < GCOV_DISK_SINGLE_VALUES; i++) + for (unsigned i = 0; i < GCOV_TOPN_VALUES; i++) { if (value == counters[2 * i]) { @@ -158,15 +152,15 @@ __gcov_one_value_profiler_body (gcov_type *counters, gcov_type value, counters[2 * sindex + 1]--; } -#ifdef L_gcov_one_value_profiler_v2 +#ifdef L_gcov_topn_values_profiler void -__gcov_one_value_profiler_v2 (gcov_type *counters, gcov_type value) +__gcov_topn_values_profiler (gcov_type *counters, gcov_type value) { - __gcov_one_value_profiler_body (counters, value, 0); + __gcov_topn_values_profiler_body (counters, value, 0); } #endif -#if defined(L_gcov_one_value_profiler_v2_atomic) && GCOV_SUPPORTS_ATOMIC +#if defined(L_gcov_topn_values_profiler_atomic) && GCOV_SUPPORTS_ATOMIC /* Update one value profilers (COUNTERS) for a given VALUE. @@ -178,9 +172,9 @@ __gcov_one_value_profiler_v2 (gcov_type *counters, gcov_type value) https://gcc.gnu.org/ml/gcc-patches/2016-08/msg00024.html. */ void -__gcov_one_value_profiler_v2_atomic (gcov_type *counters, gcov_type value) +__gcov_topn_values_profiler_atomic (gcov_type *counters, gcov_type value) { - __gcov_one_value_profiler_body (counters, value, 1); + __gcov_topn_values_profiler_body (counters, value, 1); } #endif @@ -214,7 +208,7 @@ __gcov_indirect_call_profiler_v4 (gcov_type value, void* cur_func) if (cur_func == __gcov_indirect_call.callee || (__LIBGCC_VTABLE_USES_DESCRIPTORS__ && *(void **) cur_func == *(void **) __gcov_indirect_call.callee)) - __gcov_one_value_profiler_body (__gcov_indirect_call.counters, value, 0); + __gcov_topn_values_profiler_body (__gcov_indirect_call.counters, value, 0); __gcov_indirect_call.callee = NULL; } diff --git a/libgcc/libgcov-util.c b/libgcc/libgcov-util.c index 94d4575..32b3f82 100644 --- a/libgcc/libgcov-util.c +++ b/libgcc/libgcov-util.c @@ -725,11 +725,11 @@ __gcov_time_profile_counter_op (gcov_type *counters ATTRIBUTE_UNUSED, /* Do nothing. */ } -/* Performing FN upon single counters. */ +/* Performing FN upon TOP N counters. */ static void -__gcov_single_counter_op (gcov_type *counters, unsigned n_counters, - counter_op_fn fn, void *data1, void *data2) +__gcov_topn_counter_op (gcov_type *counters, unsigned n_counters, + counter_op_fn fn, void *data1, void *data2) { unsigned i, n_measures; diff --git a/libgcc/libgcov.h b/libgcc/libgcov.h index 7f31614..30a8a11 100644 --- a/libgcc/libgcov.h +++ b/libgcc/libgcov.h @@ -126,7 +126,7 @@ typedef unsigned gcov_position_t; #define L_gcov 1 #define L_gcov_merge_add 1 -#define L_gcov_merge_single 1 +#define L_gcov_merge_topn 1 #define L_gcov_merge_ior 1 #define L_gcov_merge_time_profile 1 @@ -259,8 +259,8 @@ extern void __gcov_merge_add (gcov_type *, unsigned) ATTRIBUTE_HIDDEN; /* The merge function to select the minimum valid counter value. */ extern void __gcov_merge_time_profile (gcov_type *, unsigned) ATTRIBUTE_HIDDEN; -/* The merge function to choose the most common value. */ -extern void __gcov_merge_single (gcov_type *, unsigned) ATTRIBUTE_HIDDEN; +/* The merge function to choose the most common N values. */ +extern void __gcov_merge_topn (gcov_type *, unsigned) ATTRIBUTE_HIDDEN; /* The merge function that just ors the counters together. */ extern void __gcov_merge_ior (gcov_type *, unsigned) ATTRIBUTE_HIDDEN; @@ -271,8 +271,8 @@ extern void __gcov_interval_profiler_atomic (gcov_type *, gcov_type, int, unsigned); extern void __gcov_pow2_profiler (gcov_type *, gcov_type); extern void __gcov_pow2_profiler_atomic (gcov_type *, gcov_type); -extern void __gcov_one_value_profiler_v2 (gcov_type *, gcov_type); -extern void __gcov_one_value_profiler_v2_atomic (gcov_type *, gcov_type); +extern void __gcov_topn_values_profiler (gcov_type *, gcov_type); +extern void __gcov_topn_values_profiler_atomic (gcov_type *, gcov_type); extern void __gcov_indirect_call_profiler_v4 (gcov_type, void *); extern void __gcov_time_profiler (gcov_type *); extern void __gcov_time_profiler_atomic (gcov_type *); -- cgit v1.1 From 179c7ef523f4331036fe70c298c2f5f46e4ba3b1 Mon Sep 17 00:00:00 2001 From: Iain Sandoe Date: Wed, 3 Jul 2019 18:36:28 +0000 Subject: [Darwin] Some TLC for older Darwin versions. The library handling and some of the options for creating the crts for the older PPC Darwin versions had bit-rotted somewhat. This adjusts the build criteria for the crts to avoid newer ld64 versions warnings about mismatches in build and object versions. Added to some of the comments that it's documented why the specs are as they are. 2019-07-03 Iain Sandoe gcc/ * config/darwin.h (REAL_LIBGCC_SPEC): Adjust for earlier Darwin. (STARTFILE_SPEC): Split crt3 into a separate spec. (DARWIN_EXTRA_SPECS): Add crt2 and crt3 spec. (DARWIN_CRT2_SPEC): New. (DARWIN_CRT3_SPEC): New. (MIN_LD64_OMIT_STUBS): Revise to 62.1. * config/rs6000/darwin.h (DARWIN_CRT2_SPEC): Revise conditions. (DARWIN_CRT3_SPEC): New. libgcc/ 2019-07-03 Iain Sandoe * config.host (powerpc-*-darwin*,powerpc64-*-darwin*): Revise crt list. * config/rs6000/t-darwin: Build crt3_2 for older systems. Revise mmacosx-version-min for crts to run across all system versions. * config/rs6000/t-darwin64 (LIB2ADD): Remove. * config/t-darwin: Revise mmacosx-version-min for crts to run across system versions >= 10.4. From-SVN: r273016 --- libgcc/ChangeLog | 10 ++++++++++ libgcc/config.host | 10 ++++++---- libgcc/config/rs6000/t-darwin | 14 ++++++++++---- libgcc/config/rs6000/t-darwin64 | 6 ------ libgcc/config/t-darwin | 14 ++++---------- 5 files changed, 30 insertions(+), 24 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index d4cbee0..f9f900b 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,13 @@ +2019-07-03 Iain Sandoe + + * config.host (powerpc-*-darwin*,powerpc64-*-darwin*): Revise crt + list. + * config/rs6000/t-darwin: Build crt3_2 for older systems. Revise + mmacosx-version-min for crts to run across all system versions. + * config/rs6000/t-darwin64 (LIB2ADD): Remove. + * config/t-darwin: Revise mmacosx-version-min for crts to run across + system versions >= 10.4. + 2019-07-03 Martin Liska * Makefile.in: Use topn_values instead of one_value names. diff --git a/libgcc/config.host b/libgcc/config.host index cf52b27..e11a065 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -1084,18 +1084,20 @@ powerpc-*-darwin*) case ${host} in *-*-darwin9* | *-*-darwin[12][0-9]*) # libSystem contains unwind information for signal frames since - # Darwin 9. + # Darwin 9. We don't need longcall either. ;; *) + # prepend the fragment forcing darwin8 codegen. + tmake_file="rs6000/t-darwin8 $tmake_file" md_unwind_header=rs6000/darwin-unwind.h ;; esac - tmake_file="$tmake_file rs6000/t-ibm-ldouble" - extra_parts="$extra_parts crt2.o libef_ppc.a" + tmake_file="$tmake_file rs6000/t-ppc64-fp rs6000/t-ibm-ldouble" + extra_parts="$extra_parts crt2.o crt3_2.o libef_ppc.a dw_ppc.o" ;; powerpc64-*-darwin*) tmake_file="$tmake_file rs6000/t-darwin64 rs6000/t-ibm-ldouble" - extra_parts="$extra_parts crt2.o libef_ppc.a" + extra_parts="$extra_parts crt2.o crt3_2.o libef_ppc.a dw_ppc.o" ;; powerpc*-*-freebsd*) tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-savresfgpr rs6000/t-crtstuff rs6000/t-freebsd t-softfp-sfdf t-softfp-excl t-softfp" diff --git a/libgcc/config/rs6000/t-darwin b/libgcc/config/rs6000/t-darwin index 0c238b7..8b513bd 100644 --- a/libgcc/config/rs6000/t-darwin +++ b/libgcc/config/rs6000/t-darwin @@ -1,7 +1,11 @@ -DARWIN_EXTRA_CRT_BUILD_CFLAGS = -mlongcall -mmacosx-version-min=10.4 crt2.o: $(srcdir)/config/rs6000/darwin-crt2.c - $(crt_compile) $(DARWIN_EXTRA_CRT_BUILD_CFLAGS) -c $< + $(crt_compile) -mmacosx-version-min=10.1 -c $< + +# The sources for this indicate that there are some parts that +# don't apply >= 10.4 +crt3_2.o: $(srcdir)/config/darwin-crt3.c + $(crt_compile) -mmacosx-version-min=10.1 -c $< # The outlined register save/restore functions need to run anywhere, and # they must be leaf functions suitable for use in an endfile. @@ -32,10 +36,12 @@ libef_ppc.a: $(PPC_ENDFILE_OBJS) $(AR_CREATE_FOR_TARGET) $@ $(PPC_ENDFILE_OBJS) $(RANLIB_FOR_TARGET) $@ +dw_ppc.o: $(srcdir)/config/rs6000/darwin-world.S + $(crt_compile) -mmacosx-version-min=10.1 -c $< + LIB2ADD = $(srcdir)/config/rs6000/darwin-tramp.S \ $(srcdir)/config/darwin-64.c \ - $(srcdir)/config/rs6000/darwin-world.S \ - $(srcdir)/config/rs6000/ppc64-fp.c + $(srcdir)/config/rs6000/darwin-world.S # The .S files above are designed to run on all processors, even though # they use AltiVec instructions. diff --git a/libgcc/config/rs6000/t-darwin64 b/libgcc/config/rs6000/t-darwin64 index 50f09d6..999679f 100644 --- a/libgcc/config/rs6000/t-darwin64 +++ b/libgcc/config/rs6000/t-darwin64 @@ -1,7 +1 @@ LIB2_SIDITI_CONV_FUNCS = yes - -LIB2ADD = $(srcdir)/config/rs6000/darwin-tramp.S \ - $(srcdir)/config/darwin-64.c \ - $(srcdir)/config/rs6000/darwin-fpsave.S \ - $(srcdir)/config/rs6000/darwin-gpsave.S \ - $(srcdir)/config/rs6000/darwin-world.S diff --git a/libgcc/config/t-darwin b/libgcc/config/t-darwin index 2fcb712..3b5e342 100644 --- a/libgcc/config/t-darwin +++ b/libgcc/config/t-darwin @@ -3,19 +3,13 @@ HOST_LIBGCC2_CFLAGS += -mmacosx-version-min=10.4 crt3.o: $(srcdir)/config/darwin-crt3.c - $(crt_compile) $(DARWIN_EXTRA_CRT_BUILD_CFLAGS) -c $< + $(crt_compile) -mmacosx-version-min=10.4 -c $< crttms.o: $(srcdir)/config/darwin-crt-tm.c - $(crt_compile) $(DARWIN_EXTRA_CRT_BUILD_CFLAGS) -DSTART -c $< + $(crt_compile) -mmacosx-version-min=10.4 -DSTART -c $< crttme.o: $(srcdir)/config/darwin-crt-tm.c - $(crt_compile) $(DARWIN_EXTRA_CRT_BUILD_CFLAGS) -DEND -c $< - -# -pipe because there's an assembler bug, 4077127, which causes -# it to not properly process the first # directive, causing temporary -# file names to appear in stabs, causing the bootstrap to fail. Using -pipe -# works around this by not having any temporary file names. -HOST_LIBGCC2_CFLAGS += -pipe + $(crt_compile) -mmacosx-version-min=10.4 -DEND -c $< # Use unwind-dw2-fde-darwin LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/config/unwind-dw2-fde-darwin.c \ @@ -23,4 +17,4 @@ LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/config/unwind-dw2-fde-darwin.c \ # Patch to __Unwind_Find_Enclosing_Function for Darwin10. d10-uwfef.o: $(srcdir)/config/darwin10-unwind-find-enc-func.c - $(crt_compile) $(DARWIN_EXTRA_CRT_BUILD_CFLAGS) -mmacosx-version-min=10.6 -c $< + $(crt_compile) -mmacosx-version-min=10.6 -c $< -- cgit v1.1