gcc/libatomic
Victor Do Nascimento e64602c025 libatomic: atomic_16.S: Improve ENTRY, END and ALIAS macro interface
The introduction of further architectural-feature dependent ifuncs
for AArch64 makes hard-coding ifunc `_i<n>' suffixes to functions
cumbersome to work with.  It is awkward to remember which ifunc maps
onto which arch feature and makes the code harder to maintain when new
ifuncs are added and their suffixes possibly altered.

This patch uses pre-processor `#define' statements to map each suffix to
a descriptive feature name macro, for example:

  #define LSE(NAME) NAME##_i1

Where we wish to generate ifunc names with the pre-processor's token
concatenation feature, we add a level of indirection to previous macro
calls.  If before we would have had`MACRO(<name>_i<n>)', we now have
`MACRO_FEAT(name, feature)'.  Where we wish to refer to base
functionality (i.e., functions where ifunc suffixes are absent), the
original `MACRO(<name>)' may be used to bypass suffixing.

Consequently, for base functionality, where the ifunc suffix is
absent, the macro interface remains the same.  For example, the entry
and endpoints of `libat_store_16' remain defined by:

  ENTRY (libat_store_16)

and

  END (libat_store_16)

For the LSE2 implementation of the same 16-byte atomic store, we now
have:

  ENTRY_FEAT (libat_store_16, LSE2)

and

  END_FEAT (libat_store_16, LSE2)

For the aliasing of function names, we define the following new
implementation of the ALIAS macro:

  ALIAS (FN_BASE_NAME, FROM_SUFFIX, TO_SUFFIX)

Defining the `CORE(NAME)' macro to be the identity operator, it
returns the base function name unaltered and allows us to alias
target-specific ifuncs to the corresponding base implementation.
For example, we'd alias the LSE2 `libat_exchange_16' to it base
implementation with:

  ALIAS (libat_exchange_16, LSE2, CORE)

libatomic/ChangeLog:
	* config/linux/aarch64/atomic_16.S (CORE): New macro.
	(LSE2): Likewise.
	(ENTRY_FEAT): Likewise.
	(ENTRY_FEAT1): Likewise.
	(END_FEAT): Likewise.
	(END_FEAT1): Likewise.
	(ALIAS): Modify macro to take in `arch' arguments.
	(ALIAS1): New.
2024-01-28 19:52:41 +00:00
..
config libatomic: atomic_16.S: Improve ENTRY, END and ALIAS macro interface 2024-01-28 19:52:41 +00:00
testsuite Update copyright years. 2024-01-03 12:19:35 +01:00
.gitignore
acinclude.m4 Add mold detection for libs. 2022-01-31 09:46:44 +01:00
aclocal.m4
auto-config.h.in
cas_n.c Update copyright years. 2024-01-03 12:19:35 +01:00
ChangeLog Update Copyright year in ChangeLog files 2024-01-03 11:35:18 +01:00
configure libatomic: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951] 2023-10-26 18:04:11 +02:00
configure.ac Update copyright years. 2024-01-03 12:19:35 +01:00
configure.tgt Update copyright years. 2024-01-03 12:19:35 +01:00
exch_n.c Update copyright years. 2024-01-03 12:19:35 +01:00
fadd_n.c Update copyright years. 2024-01-03 12:19:35 +01:00
fand_n.c
fence.c Update copyright years. 2024-01-03 12:19:35 +01:00
fenv.c Update copyright years. 2024-01-03 12:19:35 +01:00
fior_n.c
flag.c Update copyright years. 2024-01-03 12:19:35 +01:00
fnand_n.c
fop_n.c Update copyright years. 2024-01-03 12:19:35 +01:00
fsub_n.c
fxor_n.c
gcas.c Update copyright years. 2024-01-03 12:19:35 +01:00
gexch.c Update copyright years. 2024-01-03 12:19:35 +01:00
glfree.c Update copyright years. 2024-01-03 12:19:35 +01:00
gload.c Update copyright years. 2024-01-03 12:19:35 +01:00
gstore.c Update copyright years. 2024-01-03 12:19:35 +01:00
host-config.h Update copyright years. 2024-01-03 12:19:35 +01:00
init.c
libatomic.map
libatomic_i.h Update copyright years. 2024-01-03 12:19:35 +01:00
load_n.c Update copyright years. 2024-01-03 12:19:35 +01:00
Makefile.am Update copyright years. 2024-01-03 12:19:35 +01:00
Makefile.in libatomic: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951] 2023-10-26 18:04:11 +02:00
store_n.c Update copyright years. 2024-01-03 12:19:35 +01:00
tas_n.c Update copyright years. 2024-01-03 12:19:35 +01:00