gcc/libatomic
Victor Do Nascimento 7dd4466b39 Libatomic: Add checks in ifunc selectors for LSE/LSE2 requirements.
At present, Evaluation of both `has_lse2(hwcap)' and
`has_lse128(hwcap)' may require issuing an `mrs' instruction to query
a system register.  This instruction, when issued from user-space
results in a trap by the kernel which then returns the value read in
by the system register.  Given the undesirable nature of the
computational expense associated with the context switch, it is
important to implement mechanisms to, wherever possible, forgo the
operation.

In light of this, given how other architectural requirements serving
as prerequisites have long been assigned HWCAP bits by the kernel, we
can inexpensively query for their availability before attempting to
read any system registers.  Where one of these early tests fail, we
can assert that the main feature of interest (be it LSE2 or LSE128)
cannot be present, allowing us to return from the function early and
skip the unnecessary expensive kernel-mediated access to system
registers.

libatomic/ChangeLog:

	* config/linux/aarch64/host-config.h (has_lse2): Add test for LSE.
	(has_lse128): Add test for LSE2.
2024-01-28 20:02:17 +00:00
..
config Libatomic: Add checks in ifunc selectors for LSE/LSE2 requirements. 2024-01-28 20:02:17 +00:00
testsuite
.gitignore
acinclude.m4 libatomic: Enable LSE128 128-bit atomics for Armv9.4-a 2024-01-28 20:02:01 +00:00
aclocal.m4
auto-config.h.in libatomic: Enable LSE128 128-bit atomics for Armv9.4-a 2024-01-28 20:02:01 +00:00
cas_n.c
ChangeLog
configure libatomic: Enable LSE128 128-bit atomics for Armv9.4-a 2024-01-28 20:02:01 +00:00
configure.ac libatomic: Enable LSE128 128-bit atomics for Armv9.4-a 2024-01-28 20:02:01 +00:00
configure.tgt libatomic: Add support for __ifunc_arg_t arg in ifunc resolver 2024-01-28 19:52:42 +00:00
exch_n.c
fadd_n.c
fand_n.c
fence.c
fenv.c
fior_n.c
flag.c
fnand_n.c
fop_n.c
fsub_n.c
fxor_n.c
gcas.c
gexch.c
glfree.c
gload.c
gstore.c
host-config.h
init.c
libatomic_i.h
libatomic.map
load_n.c
Makefile.am libatomic: Enable LSE128 128-bit atomics for Armv9.4-a 2024-01-28 20:02:01 +00:00
Makefile.in libatomic: Enable LSE128 128-bit atomics for Armv9.4-a 2024-01-28 20:02:01 +00:00
store_n.c
tas_n.c