This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 1/7] Save and restore vector registers in x86-64 ld.so
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 19 Aug 2015 05:15:40 -0700
- Subject: Re: [PATCH 1/7] Save and restore vector registers in x86-64 ld.so
- Authentication-results: sourceware.org; auth=none
- References: <20150814130334 dot GA24378 at gmail dot com>
On Fri, Aug 14, 2015 at 6:03 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> OK for master?
>
> ---
> This patch adds SSE, AVX and AVX512 versions of _dl_runtime_resolve
> and _dl_runtime_profile, which save and restore the first 8 vector
> registers used for parameter passing. elf_machine_runtime_setup
> selects the proper _dl_runtime_resolve or _dl_runtime_profile based
> on _dl_x86_cpu_features. It avoids race condition caused by
> FOREIGN_CALL macros, whicha are only used for x86-64.
>
> Performance impact of saving and restoring 8 vector registers are
> negligible on Nehalem, Sandy Bridge, Ivy Bridge and Haswell when
> ld.so is optimized with SSE2.
>
> [BZ #15128]
> * sysdeps/x86_64/Makefile [$(subdir) == elf] (tests): Add
> ifuncmain8.
> (modules-names): Add ifuncmod8.
> ($(objpfx)ifuncmain8): New rule.
> * sysdeps/x86_64/dl-machine.h: Include <dl-procinfo.h> and
> <cpuid.h>.
> (elf_machine_runtime_setup): Use _dl_runtime_resolve_sse,
> _dl_runtime_resolve_avx, or _dl_runtime_resolve_avx512,
> _dl_runtime_profile_sse, _dl_runtime_profile_avx, or
> _dl_runtime_profile_avx512, based on HAS_ARCH_FEATURE.
> * sysdeps/x86_64/dl-trampoline.S: Rewrite.
> * sysdeps/x86_64/dl-trampoline.h: Likewise.
> * sysdeps/x86_64/ifuncmain8.c: New file.
> * sysdeps/x86_64/ifuncmod8.c: Likewise.
> * sysdeps/x86_64/nptl/tcb-offsets.sym (RTLD_SAVESPACE_SSE):
> Removed.
> * sysdeps/x86_64/nptl/tls.h (__128bits): Removed.
> (tcbhead_t): Change rtld_must_xmm_save to __glibc_unused1.
> Change rtld_savespace_sse to __glibc_unused2.
> (RTLD_CHECK_FOREIGN_CALL): Removed.
> (RTLD_ENABLE_FOREIGN_CALL): Likewise.
> (RTLD_PREPARE_FOREIGN_CALL): Likewise.
> (RTLD_FINALIZE_FOREIGN_CALL): Likewise.
Any comments, feedbacks, objections?
--
H.J.