about summary refs log tree commit diff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2015-10-13 10:29:45 -0700
committerH.J. Lu <hjl.tools@gmail.com>2016-02-23 11:17:23 -0800
commitf39988f5d94fe7f6ea0e5c7615a16580d0d113ec (patch)
tree0035be8ea40bc9f407cf7f735a2e7b6ded8742b2
parent5cee7c02d4a7eda73460405493032eb484a015be (diff)
downloadglibc-f39988f5d94fe7f6ea0e5c7615a16580d0d113ec.tar.gz
glibc-f39988f5d94fe7f6ea0e5c7615a16580d0d113ec.tar.xz
glibc-f39988f5d94fe7f6ea0e5c7615a16580d0d113ec.zip
Support x86-64 assmebler without AVX512
When x86-64 assmebler doesn't support AVX512, we should make
_dl_runtime_resolve_avx512/_dl_runtime_profile_avx512 as aliases of
_dl_runtime_resolve_avx/_dl_runtime_profile_avx.  Tested on x86-64
using GCC 5.2 with binutils 20151008 and GCC 4.8 with binutils 20130219.
There are no differences in ld.so with binutils 20151008.  There are no
unexpected failures with binutils 20130219 and 20151008.

	[BZ #19124]
	* sysdeps/x86_64/dl-trampoline.S [!HAVE_AVX512_ASM_SUPPORT]
	(_dl_runtime_resolve_avx512): Make it a hidden alias of
	_dl_runtime_resolve_avx.
	(_dl_runtime_profile_avx512): Make it a hidden alias of
	_dl_runtime_profile_avx.
-rw-r--r--sysdeps/x86_64/dl-trampoline.S40
1 files changed, 24 insertions, 16 deletions
diff --git a/sysdeps/x86_64/dl-trampoline.S b/sysdeps/x86_64/dl-trampoline.S
index 8475d26d07..bfc27a1a2a 100644
--- a/sysdeps/x86_64/dl-trampoline.S
+++ b/sysdeps/x86_64/dl-trampoline.S
@@ -71,24 +71,32 @@
 #define REGISTER_SAVE_R8	(REGISTER_SAVE_RDI + 8)
 #define REGISTER_SAVE_R9	(REGISTER_SAVE_R8 + 8)
 
-#define VEC_SIZE		64
-#define VMOVA			vmovdqa64
-#if DL_RUNIME_RESOLVE_REALIGN_STACK || VEC_SIZE <= DL_STACK_ALIGNMENT
-# define VMOV			vmovdqa64
+#define RESTORE_AVX
+
+#ifdef HAVE_AVX512_ASM_SUPPORT
+# define VEC_SIZE		64
+# define VMOVA			vmovdqa64
+# if DL_RUNIME_RESOLVE_REALIGN_STACK || VEC_SIZE <= DL_STACK_ALIGNMENT
+#  define VMOV			vmovdqa64
+# else
+#  define VMOV			vmovdqu64
+# endif
+# define VEC(i)			zmm##i
+# define _dl_runtime_resolve	_dl_runtime_resolve_avx512
+# define _dl_runtime_profile	_dl_runtime_profile_avx512
+# include "dl-trampoline.h"
+# undef _dl_runtime_resolve
+# undef _dl_runtime_profile
+# undef VEC
+# undef VMOV
+# undef VMOVA
+# undef VEC_SIZE
 #else
-# define VMOV			vmovdqu64
+strong_alias (_dl_runtime_resolve_avx, _dl_runtime_resolve_avx512)
+	.hidden _dl_runtime_resolve_avx512
+strong_alias (_dl_runtime_profile_avx, _dl_runtime_profile_avx512)
+	.hidden _dl_runtime_profile_avx512
 #endif
-#define VEC(i)			zmm##i
-#define _dl_runtime_resolve	_dl_runtime_resolve_avx512
-#define _dl_runtime_profile	_dl_runtime_profile_avx512
-#define RESTORE_AVX
-#include "dl-trampoline.h"
-#undef _dl_runtime_resolve
-#undef _dl_runtime_profile
-#undef VEC
-#undef VMOV
-#undef VMOVA
-#undef VEC_SIZE
 
 #define VEC_SIZE		32
 #define VMOVA			vmovdqa