> (clrsb:m x)
> Represents the number of redundant leading sign bits in x, represented
> as an integer of mode m, starting at the most significant bit position.
This explanation is just what the NSA instruction (not ever emitted before)
calculates in Xtensa ISA.
gcc/ChangeLog:
* config/xtensa/xtensa.md (clrsbsi2): New insn pattern.
libgcc/ChangeLog:
* config/xtensa/lib1funcs.S (__clrsbsi2): New function.
* config/xtensa/t-xtensa (LIB1ASMFUNCS): Add _clrsbsi2.
Aligne __EH_FRAME_BEGIN__ to pointer size since gcc/unwind-dw2-fde.h has
/* The first few fields of a CIE. The CIE_id field is 0 for a CIE,
to distinguish it from a valid FDE. FDEs are aligned to an addressing
unit boundary, but the fields within are unaligned. */
struct dwarf_cie
{
uword length;
sword CIE_id;
ubyte version;
unsigned char augmentation[];
} __attribute__ ((packed, aligned (__alignof__ (void *))));
/* The first few fields of an FDE. */
struct dwarf_fde
{
uword length;
sword CIE_delta;
unsigned char pc_begin[];
} __attribute__ ((packed, aligned (__alignof__ (void *))));
which indicates that CIE/FDE should be aligned at the pointer size.
PR libgcc/27576
* crtstuff.c (__EH_FRAME_BEGIN__): Aligned to pointer size.
Increase the priority of the init_have_lse_atomics constructor so it runs
before other constructors. This improves chances that rr works when LSE
atomics are supported.
libgcc/
PR libgcc/105708
* config/aarch64/lse-init.c: Increase constructor priority.
The RA_SIGN_STATE dwarf pseudo-register is normally only set using the
DW_CFA_AARCH64_negate_ra_state (== DW_CFA_window_save) operation which
toggles the return address signedness state (the default state is 0).
(It may be set by remember/restore_state CFI too, those save/restore
the state of all registers.)
However RA_SIGN_STATE can be set directly via DW_CFA_val_expression too.
GCC does not generate such CFI but some other compilers reportedly do.
Note: the toggle operation must not be mixed with other dwarf register
rule CFI within the same CIE and FDE.
In libgcc we assume REG_UNSAVED means the RA_STATE is set using toggle
operations, otherwise we assume its value is set by other CFI.
libgcc/ChangeLog:
PR target/104689
* config/aarch64/aarch64-unwind.h (aarch64_frob_update_context):
Handle the !REG_UNSAVED case.
* unwind-dw2.c (execute_cfa_program): Fail toggle if !REG_UNSAVED.
gcc/testsuite/ChangeLog:
PR target/104689
* gcc.target/aarch64/pr104689.c: New test.
This patch replaces libbid's implementations of clz and ctz for 32 and
64 bits inputs which used several masks, and switches to the
corresponding builtins. This will provide a better implementation,
especially on targets with clz/ctz instructions.
2022-05-06 Christophe Lyon <christophe.lyon@arm.com>
libgcc/config/libbid/ChangeLog:
* bid_binarydecimal.c (CLZ32_MASK16): Delete.
(CLZ32_MASK8): Delete.
(CLZ32_MASK4): Delete.
(CLZ32_MASK2): Delete.
(CLZ32_MASK1): Delete.
(clz32_nz): Use __builtin_clz.
(ctz32_1bit): Delete.
(ctz32): Use __builtin_ctz.
(CLZ64_MASK32): Delete.
(CLZ64_MASK16): Delete.
(CLZ64_MASK8): Delete.
(CLZ64_MASK4): Delete.
(CLZ64_MASK2): Delete.
(CLZ64_MASK1): Delete.
(clz64_nz): Use __builtin_clzl.
(ctz64_1bit): Delete.
(ctz64): Use __builtin_ctzl.
This patch adds support for trunc and extend operations between HF
mode (_Float16) and Decimal Floating Point formats (_Decimal32,
_Decimal64 and _Decimal128).
For simplicity we rely on the implicit conversions inserted by the
compiler between HF and SD/DF/TF modes. The existing bid*_to_binary*
and binary*_to_bid* functions are non-trivial and at this stage it is
not clear if there is a performance-critical use case involving _Float16
and _Decimal* formats.
The patch also adds two executable tests, to make sure the right
functions are called, available (link phase) and functional.
Tested on aarch64 and x86_64. The number of symbol matches in the
testcases includes the .global XXX to avoid having to match different
call instructions for different targets.
2022-05-04 Christophe Lyon <christophe.lyon@arm.com>
libgcc/ChangeLog:
* Makefile.in (D32PBIT_FUNCS): Add _hf_to_sd and _sd_to_hf.
(D64PBIT_FUNCS): Add _hf_to_dd and _dd_to_hf.
(D128PBIT_FUNCS): Add _hf_to_td _td_to_hf.
libgcc/config/libbid/ChangeLog:
* bid_gcc_intrinsics.h (LIBGCC2_HAS_HF_MODE): Define according to
__LIBGCC_HAS_HF_MODE__.
(BID_HAS_HF_MODE): Define.
(HFtype): Define.
(__bid_extendhfsd): New prototype.
(__bid_extendhfdd): Likewise.
(__bid_extendhftd): Likewise.
(__bid_truncsdhf): Likewise.
(__bid_truncddhf): Likewise.
(__bid_trunctdhf): Likewise.
* _dd_to_hf.c: New file.
* _hf_to_dd.c: New file.
* _hf_to_sd.c: New file.
* _hf_to_td.c: New file.
* _sd_to_hf.c: New file.
* _td_to_hf.c: New file.
gcc/testsuite/ChangeLog:
* gcc.dg/torture/convert-dfp-2.c: New test.
* gcc.dg/torture/convert-dfp.c: New test.
DFP support on AArch64 relies on libgcc, so enable its DFP routines
for all AArch64 targets.
2022-03-31 Christophe Lyon <christophe.lyon@arm.com>
libgcc/
* config.host: Add t-dfprules to AArch64 targets.
gcov_info::n_functions type is initialized by generated
code in build_info_type:
/* n_functions */
field = build_decl (BUILTINS_LOCATION, FIELD_DECL, NULL_TREE,
get_gcov_unsigned_t ());
It uses gcov_unsigned_t, but the struct definition in libgcov.h uses
unsigned type. That brings troubled on 16-bit targets.
PR gcov-profile/105535
libgcc/ChangeLog:
* libgcov.h (struct gcov_info): Use gcov_unsigned_t for
n_functions.
Co-Authored-By: Hans-Peter Helfert <peter-helfert@t-online.de>
This allows to reuse read_gcda_file() to read multiple objects from a single
file.
libgcc/
* libgcov-util.c (read_gcda_file): Do not open file.
(ftw_read_file): Open file here.
This helps to reuse read_gcda_file().
libgcc/
* libgcov-util.c (read_gcda_file): Prepend new info object to global
list.
(ftw_read_file): Remove list append here.
Move duplication of filename to caller and use xstrdup() instead of custom
code. This helps to reuse read_gcda_file() for other purposes.
libgcc/
* libgcov-util.c (read_gcda_file): Do not duplicate filename.
(ftw_read_file): Duplicate filename for read_gcda_file().
gcc/
* doc/invoke.texi (fprofile-info-section): Mention
__gcov_filename_to_gcfn(). Use "freestanding" to match with C11
standard language. Fix minor example code issues.
* gcov-io.h (GCOV_FILENAME_MAGIC): Define and document.
gcc/testsuite/
* gcc.dg/gcov-info-to-gcda.c: Test __gcov_filename_to_gcfn().
libgcc/
* gcov.h (__gcov_info_to_gcda): Mention __gcov_filename_to_gcfn().
(__gcov_filename_to_gcfn): Declare and document.
* libgcov-driver.c (dump_string): New.
(__gcov_filename_to_gcfn): Likewise.
(__gcov_info_to_gcda): Adjust comment to match C11 standard language.
This function is only used by gcov_write_length() in the gcov-io.cc file.
gcc/
* gcov-io.cc (gcov_seek): Make it static.
* gcov-io.h (struct gcov_summary): Do not mention gcov_seek().
libgcc/
* libgcov.h (gcov_seek): Remove define and declaration.
gcc/
* gcov-io.cc (gcov_open): Always use the mode parameter.
* gcov-io.h (gcov_open): Declare it unconditionally.
libgcc/
* libgcov-driver-system.c (gcov_exit_open_gcda_file): Open file for
reading and writing.
* libgcov-util.c (read_gcda_file): Open file for reading.
* libgcov.h (gcov_open): Delete declaration.
The gcov_profile_merge() already had code to deal with profile information
which had no counterpart to merge with. For profile information from files
with no associated counterpart, the profile information is simply used as is
with the weighting transformation applied. Make sure that gcov_profile_merge()
works with an empty target profile list. Return the merged profile list.
gcc/
* gcov-tool.cc (gcov_profile_merge): Adjust return type.
(profile_merge): Allow merging of directories which contain no profile
files.
libgcc/
* libgcov-util.c (gcov_profile_merge): Return the list of merged
profiles. Accept empty target and source profile lists.
In --without-headers mode gcc fails to bootstrap on libgcc as:
/build/build/./gcc/xgcc -B/build/build/./gcc/ ... -Dinhibit_libc -c fde-glibc.c
../../../gcc-12-20220403/libgcc/config/ia64/fde-glibc.c:33:10:
fatal error: stdlib.h: No such file or directory
Most other linux targets are able to build the --without-headers
compiler without additional effort. This change adds IA64 to the fold.
The change drops part of the code that relies on DYNAMIC glibc
section traversal for backtraces.
Tested bootstrap of ia64-unknown-linux-gnu with and without libc
headers present.
libgcc/
* config/ia64/fde-glibc.c: Make a no-op in inhibit_libc mode.
libgcc/
PR libgcc/86224
* config/m68k/lb1sf68.S (__mulsi3_internal): Internal, hidden alias
for __mulsi3.
(__udivsi3_internal, __divsi3_internal): Similarly.
(__umodsi3, __modsi3): Use the internal function names.
libgcc/ChangeLog:
PR target/102215
* config/gcn/atomic.c (__sync_val_compare_and_swap_##SIZE): Move
a line up to non-arg-dependent value first.
(__ATOMIC_COMPARE_EXCHANGE): Define + call to generate
__atomic_compare_exchange_{1,2}.
PowerPC Darwin8 is the last version to use an unwind frame fallback routine.
This had been omitted from the new shared EH library, along with one more
header dependency that only fires there.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
libgcc/ChangeLog:
* config/rs6000/t-darwin-ehs: Add darwin-fallback.o.
* config/t-darwin-ehs: Add dependency on unwind.h.
The third parameter of find_fde_tail is an _Unwind_Ptr (which is an
integer type instead of a pointer), but we are passing NULL to it. This
causes a -Wint-conversion warning.
libgcc/
* unwind-dw2-fde-dip.c (_Unwind_Find_FDE): Call find_fde_tail
with 0 instead of NULL.
This patch changes the build machinery in order to disable the build
of GCOV (both compiler and libgcc) in bpf-*-* targets. The reason for
this change is that BPF is (currently) too restricted in order to
support the coverage instrumentalization.
Tested in bpf-unknown-none and x86_64-linux-gnu targets.
2022-02-23 Jose E. Marchesi <jose.marchesi@oracle.com>
gcc/ChangeLog
PR target/104656
* configure.ac: --disable-gcov if targetting bpf-*.
* configure: Regenerate.
libgcc/ChangeLog
PR target/104656
* configure.ac: --disable-gcov if targetting bpf-*.
* configure: Regenerate.
_dl_find_object returns success even if no unwind information has been
found, and dlfo_eh_frame is NULL.
libgcc/ChangeLog:
PR libgcc/104207
* unwind-dw2-fde-dip.c (_Unwind_Find_FDE): Add NULL check.