This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch hjl/plt/2.21 updated. glibc-2.21-32-g95cb16c
- From: hjl at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 3 Aug 2015 17:19:06 -0000
- Subject: GNU C Library master sources branch hjl/plt/2.21 updated. glibc-2.21-32-g95cb16c
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, hjl/plt/2.21 has been updated
via 95cb16c93f3029382442c59176388b67c4ec27c1 (commit)
via 7edf7c2253d0522a07cdda56e7ea25ff21306bde (commit)
from ee31b78f6a17c08ff274f045b5c694175d0604fe (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=95cb16c93f3029382442c59176388b67c4ec27c1
commit 95cb16c93f3029382442c59176388b67c4ec27c1
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Mon Aug 3 10:03:16 2015 -0700
Remove __get_cpu_features from x86_64/fpu/multiarch
diff --git a/sysdeps/x86_64/fpu/multiarch/s_ceil.S b/sysdeps/x86_64/fpu/multiarch/s_ceil.S
index 00ecede..c1b9026 100644
--- a/sysdeps/x86_64/fpu/multiarch/s_ceil.S
+++ b/sysdeps/x86_64/fpu/multiarch/s_ceil.S
@@ -22,10 +22,9 @@
ENTRY(__ceil)
.type __ceil, @gnu_indirect_function
- call __get_cpu_features@plt
- movq %rax, %rdx
+ LOAD_RTLD_GLOBAL_RO_RDX
leaq __ceil_sse41(%rip), %rax
- testl $bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx)
+ HAS_CPU_FEATURE (SSE4_1)
jnz 2f
leaq __ceil_c(%rip), %rax
2: ret
diff --git a/sysdeps/x86_64/fpu/multiarch/s_ceilf.S b/sysdeps/x86_64/fpu/multiarch/s_ceilf.S
index c8ed705..7809e03 100644
--- a/sysdeps/x86_64/fpu/multiarch/s_ceilf.S
+++ b/sysdeps/x86_64/fpu/multiarch/s_ceilf.S
@@ -22,10 +22,9 @@
ENTRY(__ceilf)
.type __ceilf, @gnu_indirect_function
- call __get_cpu_features@plt
- movq %rax, %rdx
+ LOAD_RTLD_GLOBAL_RO_RDX
leaq __ceilf_sse41(%rip), %rax
- testl $bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx)
+ HAS_CPU_FEATURE (SSE4_1)
jnz 2f
leaq __ceilf_c(%rip), %rax
2: ret
diff --git a/sysdeps/x86_64/fpu/multiarch/s_floor.S b/sysdeps/x86_64/fpu/multiarch/s_floor.S
index 952ffaa..fa3f98e 100644
--- a/sysdeps/x86_64/fpu/multiarch/s_floor.S
+++ b/sysdeps/x86_64/fpu/multiarch/s_floor.S
@@ -22,10 +22,9 @@
ENTRY(__floor)
.type __floor, @gnu_indirect_function
- call __get_cpu_features@plt
- movq %rax, %rdx
+ LOAD_RTLD_GLOBAL_RO_RDX
leaq __floor_sse41(%rip), %rax
- testl $bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx)
+ HAS_CPU_FEATURE (SSE4_1)
jnz 2f
leaq __floor_c(%rip), %rax
2: ret
diff --git a/sysdeps/x86_64/fpu/multiarch/s_floorf.S b/sysdeps/x86_64/fpu/multiarch/s_floorf.S
index c8231e8..f60f662 100644
--- a/sysdeps/x86_64/fpu/multiarch/s_floorf.S
+++ b/sysdeps/x86_64/fpu/multiarch/s_floorf.S
@@ -22,10 +22,10 @@
ENTRY(__floorf)
.type __floorf, @gnu_indirect_function
- call __get_cpu_features@plt
+ LOAD_RTLD_GLOBAL_RO_RDX
movq %rax, %rdx
leaq __floorf_sse41(%rip), %rax
- testl $bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx)
+ HAS_CPU_FEATURE (SSE4_1)
jnz 2f
leaq __floorf_c(%rip), %rax
2: ret
diff --git a/sysdeps/x86_64/fpu/multiarch/s_nearbyint.S b/sysdeps/x86_64/fpu/multiarch/s_nearbyint.S
index b5d32b5..109395c 100644
--- a/sysdeps/x86_64/fpu/multiarch/s_nearbyint.S
+++ b/sysdeps/x86_64/fpu/multiarch/s_nearbyint.S
@@ -22,10 +22,10 @@
ENTRY(__nearbyint)
.type __nearbyint, @gnu_indirect_function
- call __get_cpu_features@plt
+ LOAD_RTLD_GLOBAL_RO_RDX
movq %rax, %rdx
leaq __nearbyint_sse41(%rip), %rax
- testl $bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx)
+ HAS_CPU_FEATURE (SSE4_1)
jnz 2f
leaq __nearbyint_c(%rip), %rax
2: ret
diff --git a/sysdeps/x86_64/fpu/multiarch/s_nearbyintf.S b/sysdeps/x86_64/fpu/multiarch/s_nearbyintf.S
index cd7e177..b870c0c 100644
--- a/sysdeps/x86_64/fpu/multiarch/s_nearbyintf.S
+++ b/sysdeps/x86_64/fpu/multiarch/s_nearbyintf.S
@@ -22,10 +22,9 @@
ENTRY(__nearbyintf)
.type __nearbyintf, @gnu_indirect_function
- call __get_cpu_features@plt
- movq %rax, %rdx
+ LOAD_RTLD_GLOBAL_RO_RDX
leaq __nearbyintf_sse41(%rip), %rax
- testl $bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx)
+ HAS_CPU_FEATURE (SSE4_1)
jnz 2f
leaq __nearbyintf_c(%rip), %rax
2: ret
diff --git a/sysdeps/x86_64/fpu/multiarch/s_rint.S b/sysdeps/x86_64/fpu/multiarch/s_rint.S
index f52cef6..b238d49 100644
--- a/sysdeps/x86_64/fpu/multiarch/s_rint.S
+++ b/sysdeps/x86_64/fpu/multiarch/s_rint.S
@@ -22,10 +22,9 @@
ENTRY(__rint)
.type __rint, @gnu_indirect_function
- call __get_cpu_features@plt
- movq %rax, %rdx
+ LOAD_RTLD_GLOBAL_RO_RDX
leaq __rint_sse41(%rip), %rax
- testl $bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx)
+ HAS_CPU_FEATURE (SSE4_1)
jnz 2f
leaq __rint_c(%rip), %rax
2: ret
diff --git a/sysdeps/x86_64/fpu/multiarch/s_rintf.S b/sysdeps/x86_64/fpu/multiarch/s_rintf.S
index e2608d4..8869196 100644
--- a/sysdeps/x86_64/fpu/multiarch/s_rintf.S
+++ b/sysdeps/x86_64/fpu/multiarch/s_rintf.S
@@ -22,10 +22,9 @@
ENTRY(__rintf)
.type __rintf, @gnu_indirect_function
- call __get_cpu_features@plt
- movq %rax, %rdx
+ LOAD_RTLD_GLOBAL_RO_RDX
leaq __rintf_sse41(%rip), %rax
- testl $bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx)
+ HAS_CPU_FEATURE (SSE4_1)
jnz 2f
leaq __rintf_c(%rip), %rax
2: ret
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7edf7c2253d0522a07cdda56e7ea25ff21306bde
commit 7edf7c2253d0522a07cdda56e7ea25ff21306bde
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Mon Aug 3 08:00:40 2015 -0700
Rename init-arch.c to dl-get-cpu-features.c
Add testcases for __get_cpu_features
diff --git a/sysdeps/i386/i686/multiarch/Makefile b/sysdeps/i386/i686/multiarch/Makefile
index 11ce4ba..31bfd39 100644
--- a/sysdeps/i386/i686/multiarch/Makefile
+++ b/sysdeps/i386/i686/multiarch/Makefile
@@ -1,5 +1,4 @@
ifeq ($(subdir),csu)
-aux += init-arch
tests += test-multiarch
gen-as-const-headers += ifunc-defines.sym
endif
diff --git a/sysdeps/i386/i686/multiarch/Versions b/sysdeps/i386/i686/multiarch/Versions
deleted file mode 100644
index 59b185a..0000000
--- a/sysdeps/i386/i686/multiarch/Versions
+++ /dev/null
@@ -1,5 +0,0 @@
-libc {
- GLIBC_PRIVATE {
- __get_cpu_features;
- }
-}
diff --git a/sysdeps/unix/sysv/linux/x86/Makefile b/sysdeps/unix/sysv/linux/x86/Makefile
index d6be472..9e6ec44 100644
--- a/sysdeps/unix/sysv/linux/x86/Makefile
+++ b/sysdeps/unix/sysv/linux/x86/Makefile
@@ -15,7 +15,6 @@ sysdep_headers += sys/elf.h sys/perm.h sys/reg.h sys/vm86.h sys/debugreg.h sys/i
endif
ifeq ($(subdir),nptl)
-libpthread-sysdep_routines += init-arch
libpthread-sysdep_routines += elision-lock elision-unlock elision-timed \
elision-trylock
endif
diff --git a/sysdeps/x86/Makefile b/sysdeps/x86/Makefile
index f499308..0de4f42 100644
--- a/sysdeps/x86/Makefile
+++ b/sysdeps/x86/Makefile
@@ -1,3 +1,10 @@
ifeq ($(subdir),csu)
gen-as-const-headers += cpu-features-offsets.sym rtld-global-offsets.sym
endif
+
+ifeq ($(subdir),elf)
+sysdep-dl-routines += dl-get-cpu-features
+
+tests += tst-get-cpu-features
+tests-static += tst-get-cpu-features-static
+endif
diff --git a/sysdeps/x86_64/multiarch/Versions b/sysdeps/x86/Versions
similarity index 87%
rename from sysdeps/x86_64/multiarch/Versions
rename to sysdeps/x86/Versions
index 59b185a..e029237 100644
--- a/sysdeps/x86_64/multiarch/Versions
+++ b/sysdeps/x86/Versions
@@ -1,4 +1,4 @@
-libc {
+ld {
GLIBC_PRIVATE {
__get_cpu_features;
}
diff --git a/sysdeps/x86/cpu-features.h b/sysdeps/x86/cpu-features.h
index 9478e48..22e5abb 100644
--- a/sysdeps/x86/cpu-features.h
+++ b/sysdeps/x86/cpu-features.h
@@ -90,49 +90,53 @@
# define index_AVX512F_Usable FEATURE_INDEX_1*FEATURE_SIZE
# define index_AVX512DQ_Usable FEATURE_INDEX_1*FEATURE_SIZE
-# ifdef __x86_64__
-# ifdef SHARED
-# if IS_IN (rtld)
-# define LOAD_RTLD_GLOBAL_RO_RDX
-# define HAS_FEATURE(offset, name) \
+# if defined (_LIBC) && !IS_IN (nonlib)
+# ifdef __x86_64__
+# ifdef SHARED
+# if IS_IN (rtld)
+# define LOAD_RTLD_GLOBAL_RO_RDX
+# define HAS_FEATURE(offset, name) \
testl $(bit_##name), _rtld_local_ro+offset+(index_##name)(%rip)
-# else
-# define LOAD_RTLD_GLOBAL_RO_RDX \
+# else
+# define LOAD_RTLD_GLOBAL_RO_RDX \
mov _rtld_global_ro@GOTPCREL(%rip), %RDX_LP
-# define HAS_FEATURE(offset, name) \
+# define HAS_FEATURE(offset, name) \
testl $(bit_##name), \
RTLD_GLOBAL_RO_DL_X86_CPU_FEATURES_OFFSET+offset+(index_##name)(%rdx)
-# endif
-# else /* SHARED */
-# define LOAD_RTLD_GLOBAL_RO_RDX
-# define HAS_FEATURE(offset, name) \
+# endif
+# else /* SHARED */
+# define LOAD_RTLD_GLOBAL_RO_RDX
+# define HAS_FEATURE(offset, name) \
testl $(bit_##name), _dl_x86_cpu_features+offset+(index_##name)(%rip)
-# endif /* !SHARED */
-# else /* __x86_64__ */
-# ifdef SHARED
-# define LOAD_FUNC_GOT_EAX(func) \
+# endif /* !SHARED */
+# else /* __x86_64__ */
+# ifdef SHARED
+# define LOAD_FUNC_GOT_EAX(func) \
leal func@GOTOFF(%edx), %eax
-# if IS_IN (rtld)
+# if IS_IN (rtld)
# define LOAD_GOT_AND_RTLD_GLOBAL_RO \
LOAD_PIC_REG(dx)
-# define HAS_FEATURE(offset, name) \
+# define HAS_FEATURE(offset, name) \
testl $(bit_##name), offset+(index_##name)+_rtld_local_ro@GOTOFF(%edx)
-# else
-# define LOAD_GOT_AND_RTLD_GLOBAL_RO \
+# else
+# define LOAD_GOT_AND_RTLD_GLOBAL_RO \
LOAD_PIC_REG(dx); \
mov _rtld_global_ro@GOT(%edx), %ecx
-# define HAS_FEATURE(offset, name) \
+# define HAS_FEATURE(offset, name) \
testl $(bit_##name), \
RTLD_GLOBAL_RO_DL_X86_CPU_FEATURES_OFFSET+offset+(index_##name)(%ecx)
-# endif
-# else /* SHARED */
-# define LOAD_FUNC_GOT_EAX(func) \
+# endif
+# else /* SHARED */
+# define LOAD_FUNC_GOT_EAX(func) \
leal func, %eax
-# define LOAD_GOT_AND_RTLD_GLOBAL_RO
-# define HAS_FEATURE(offset, name) \
+# define LOAD_GOT_AND_RTLD_GLOBAL_RO
+# define HAS_FEATURE(offset, name) \
testl $(bit_##name), _dl_x86_cpu_features+offset+(index_##name)
-# endif /* !SHARED */
-# endif /* !__x86_64__ */
+# endif /* !SHARED */
+# endif /* !__x86_64__ */
+# else /* _LIBC && !nonlib */
+# error "Sorry, <cpu-features.h> is unimplemented for assembler"
+# endif /* !_LIBC || nonlib */
/* HAS_* evaluates to true if we may use the feature at runtime. */
# define HAS_CPU_FEATURE(name) HAS_FEATURE (CPUID_OFFSET, name)
@@ -171,15 +175,14 @@ struct cpu_features
unsigned int feature[FEATURE_INDEX_MAX];
};
-/* Unused for x86. */
-# define INIT_ARCH()
-
/* Used from outside of glibc to get access to the CPU features
structure. */
extern const struct cpu_features *__get_cpu_features (void)
__attribute__ ((const));
# if defined (_LIBC) && !IS_IN (nonlib)
+/* Unused for x86. */
+# define INIT_ARCH()
# define __get_cpu_features() (&GLRO(dl_x86_cpu_features))
# endif
diff --git a/sysdeps/x86_64/multiarch/init-arch.c b/sysdeps/x86/dl-get-cpu-features.c
similarity index 81%
copy from sysdeps/x86_64/multiarch/init-arch.c
copy to sysdeps/x86/dl-get-cpu-features.c
index 01a379c..080e5e8 100644
--- a/sysdeps/x86_64/multiarch/init-arch.c
+++ b/sysdeps/x86/dl-get-cpu-features.c
@@ -1,7 +1,5 @@
-/* Initialize CPU feature data.
- This file is part of the GNU C Library.
- Copyright (C) 2008-2015 Free Software Foundation, Inc.
- Contributed by Ulrich Drepper <drepper@redhat.com>.
+/* This file is part of the GNU C Library.
+ Copyright (C) 2015 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
diff --git a/sysdeps/x86/tst-get-cpu-features-static.c b/sysdeps/x86/tst-get-cpu-features-static.c
new file mode 100644
index 0000000..03f5906
--- /dev/null
+++ b/sysdeps/x86/tst-get-cpu-features-static.c
@@ -0,0 +1 @@
+#include "tst-get-cpu-features.c"
diff --git a/sysdeps/x86_64/multiarch/init-arch.c b/sysdeps/x86/tst-get-cpu-features.c
similarity index 69%
rename from sysdeps/x86_64/multiarch/init-arch.c
rename to sysdeps/x86/tst-get-cpu-features.c
index 01a379c..c17060f 100644
--- a/sysdeps/x86_64/multiarch/init-arch.c
+++ b/sysdeps/x86/tst-get-cpu-features.c
@@ -1,7 +1,6 @@
-/* Initialize CPU feature data.
+/* Test case for x86 __get_cpu_features interface
+ Copyright (C) 2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Copyright (C) 2008-2015 Free Software Foundation, Inc.
- Contributed by Ulrich Drepper <drepper@redhat.com>.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -17,13 +16,16 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <stdlib.h>
+#include <cpu-features.h>
-#include <ldsodefs.h>
-
-#undef __get_cpu_features
-
-const struct cpu_features *
-__get_cpu_features (void)
+static int
+do_test (void)
{
- return &GLRO(dl_x86_cpu_features);
+ if (__get_cpu_features ()->kind == arch_kind_unknown)
+ abort ();
+ return 0;
}
+
+#define TEST_FUNCTION do_test ()
+#include "../../test-skeleton.c"
diff --git a/sysdeps/x86_64/multiarch/Makefile b/sysdeps/x86_64/multiarch/Makefile
index d7002a9..d10b4d4 100644
--- a/sysdeps/x86_64/multiarch/Makefile
+++ b/sysdeps/x86_64/multiarch/Makefile
@@ -1,5 +1,4 @@
ifeq ($(subdir),csu)
-aux += init-arch
tests += test-multiarch
gen-as-const-headers += ifunc-defines.sym
endif
-----------------------------------------------------------------------
Summary of changes:
sysdeps/i386/i686/multiarch/Makefile | 1 -
sysdeps/i386/i686/multiarch/Versions | 5 --
sysdeps/unix/sysv/linux/x86/Makefile | 1 -
sysdeps/x86/Makefile | 7 +++
sysdeps/x86/Versions | 5 ++
sysdeps/x86/cpu-features.h | 65 ++++++++++++++-------------
sysdeps/x86/dl-get-cpu-features.c | 27 +++++++++++
sysdeps/x86/tst-get-cpu-features-static.c | 1 +
sysdeps/x86/tst-get-cpu-features.c | 31 +++++++++++++
sysdeps/x86_64/fpu/multiarch/s_ceil.S | 5 +-
sysdeps/x86_64/fpu/multiarch/s_ceilf.S | 5 +-
sysdeps/x86_64/fpu/multiarch/s_floor.S | 5 +-
sysdeps/x86_64/fpu/multiarch/s_floorf.S | 4 +-
sysdeps/x86_64/fpu/multiarch/s_nearbyint.S | 4 +-
sysdeps/x86_64/fpu/multiarch/s_nearbyintf.S | 5 +-
sysdeps/x86_64/fpu/multiarch/s_rint.S | 5 +-
sysdeps/x86_64/fpu/multiarch/s_rintf.S | 5 +-
sysdeps/x86_64/multiarch/Makefile | 1 -
sysdeps/x86_64/multiarch/Versions | 5 --
sysdeps/x86_64/multiarch/init-arch.c | 29 ------------
20 files changed, 121 insertions(+), 95 deletions(-)
delete mode 100644 sysdeps/i386/i686/multiarch/Versions
create mode 100644 sysdeps/x86/Versions
create mode 100644 sysdeps/x86/dl-get-cpu-features.c
create mode 100644 sysdeps/x86/tst-get-cpu-features-static.c
create mode 100644 sysdeps/x86/tst-get-cpu-features.c
delete mode 100644 sysdeps/x86_64/multiarch/Versions
delete mode 100644 sysdeps/x86_64/multiarch/init-arch.c
hooks/post-receive
--
GNU C Library master sources