public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch][aarch64]  Use IFUNCs to enable LSE instructions in libatomic on aarch64
@ 2017-08-07 20:44 Steve Ellcey
  2017-08-07 20:46 ` Steve Ellcey
  2017-08-25 16:43 ` Szabolcs Nagy
  0 siblings, 2 replies; 22+ messages in thread
From: Steve Ellcey @ 2017-08-07 20:44 UTC (permalink / raw)
  To: gcc-patches

This patch uses the libatomic IFUNC infrastructure so that aarch64
machines that support the LSE instructions can use them.  Note that
aarch64 still isn't enabling IFUNC support by default though I have
submitted a patch to do that.  You can enable IFUNC support by
configuring with --enable-gnu-indirect-function.

Glibc has an environment variable, LD_HWCAP_MASK, that can be used to
mask out some or all of the bits returned by getauxval(AT_HWCAP) and
ignore certain hardware capabilities.  I enabled this functionality
for libatomic by looking at the LD_HWCAP_MASK variable in the IFUNC
resolver function.  That way, if I had a system that supported LSE but
did not want to use it for some reason, I could set LD_HWCAP_MASK to
zero and then the IFUNC selector function would not enable the LSE
routines.  I could remove this functionality if we thought it was not
appropriate but I think it is useful, both for testing and for end
users.

Tested on aarch64, OK for checkin?

Steve Ellcey
sellcey@cavium.com




2017-08-07  Steve Ellcey  <sellcey@cavium.com>

	* Makefile.am (ARCH_AARCH64_LINUX_LSE): Add IFUNC_OPTIONS and
	libatomic_la_LIBADD.
	* config/linux/aarch64/host-config.h: New file.
	* config/linux/aarch64/init.c: New file.
	* configure.ac (AC_CHECK_HEADERS): Check for sys/auxv.h.
	(AC_CHECK_FUNCS): Check for getauxval.
	(ARCH_AARCH64_LINUX_LSE): New conditional for IFUNC builds.
	* configure.tgt (aarch64): Set AARCH and try_ifunc.
	(aarch64*-*-linux*) Update config_path.
	* Makefile.in: Regenerate.
	* auto-config.h.in: Regenerate.
	* configure: Regenerate.

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2017-12-07 15:58 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-07 20:44 [Patch][aarch64] Use IFUNCs to enable LSE instructions in libatomic on aarch64 Steve Ellcey
2017-08-07 20:46 ` Steve Ellcey
2017-08-25  4:56   ` Steve Ellcey
2017-08-25 16:43 ` Szabolcs Nagy
2017-08-28 18:40   ` Steve Ellcey
2017-08-29 11:42     ` Szabolcs Nagy
2017-08-30 18:39       ` Steve Ellcey
2017-08-31 18:55       ` Steve Ellcey
2017-09-27 20:35         ` Steve Ellcey
2017-09-28 11:31         ` Szabolcs Nagy
2017-09-29 20:29           ` Steve Ellcey
2017-10-02 14:38             ` Szabolcs Nagy
2017-10-03 18:57               ` Steve Ellcey
2017-10-24 18:17                 ` Steve Ellcey
2017-11-20 18:27                   ` Steve Ellcey
2017-11-20 18:29                     ` James Greenhalgh
2017-11-20 19:50                       ` Steve Ellcey
2017-11-21 17:36                         ` James Greenhalgh
2017-11-29  8:09                           ` Steve Ellcey
2017-12-05  0:51                             ` Steve Ellcey
2017-12-07  9:56             ` James Greenhalgh
2017-12-07 15:58               ` Steve Ellcey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).