This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add sysdeps/x86/i686


On Fri, Jan 11, 2013 at 3:35 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Fri, Jan 11, 2013 at 2:58 PM, Roland McGrath <roland@hack.frob.com> wrote:
>>> There are #ifdef under sysdeps/x86:
>>
>> Only in installed headers.
>>
>
> It shouldn't make a difference.  But I don't mind to leave them
> where they are.
>

Here is the patch to move cacheinfo.c to sysdeps/x86/i686.
OK to install? The followup patches are

1.  A patch to share multi-arch files in C:

http://sourceware.org/git/?p=glibc.git;a=patch;h=5aff58049a0421cc531cfb3c452463d34528fe01

This patch has

#ifndef __x86_64__
# define __strcasestr_sse2 __strcasestr_ia32
#endif

2. A patch to rename xxx_ia32/xxx_sse2 to xxx_generic:

http://sourceware.org/git/?p=glibc.git;a=patch;h=ae5b491bc523ad440184c4ba6bcfa15b35fe11c8

This patch removes __x86_64__ check in
sysdeps/x86/i686/multiarch

With those changes, we only need to update one
place for both ia32 and x86-64 when sources are in
C.

Thanks.

-- 
H.J.
---
2013-01-11  H.J. Lu  <hongjiu.lu@intel.com>

	* sysdeps/i386/i686/Implies: Add x86/i686.
	* sysdeps/x86_64/Implies: Likewise.
	* sysdeps/i386/i686/Makefile (sysdep_routines): Don't add
	cacheinfo.
	* sysdeps/x86_64/Makefile: Likewise.
	* sysdeps/i386/i686/cacheinfo.c: Updated.
	* sysdeps/x86_64/multiarch/cacheinfo.c: Likewise.
	* sysdeps/x86/i686/Makefile: New file.
	* sysdeps/x86_64/cacheinfo.c: Moved to ...
	* sysdeps/x86/i686/cacheinfo.c: Here.

diff --git a/sysdeps/i386/i686/Implies b/sysdeps/i386/i686/Implies
index e1fcccd..656cd9e 100644
--- a/sysdeps/i386/i686/Implies
+++ b/sysdeps/i386/i686/Implies
@@ -1,4 +1,5 @@
 # Due to the reordering and the other nifty extensions in the i686 it is
 # not really good to use heavily i586 optimized code on a i686.  It's
 # better to use i486/i386 code.
+x86/i686
 i386/i486
diff --git a/sysdeps/i386/i686/Makefile b/sysdeps/i386/i686/Makefile
index e6b2924..e1ff934 100644
--- a/sysdeps/i386/i686/Makefile
+++ b/sysdeps/i386/i686/Makefile
@@ -6,10 +6,6 @@ endif
 # So that we can test __m128's alignment
 stack-align-test-flags += -msse

-ifeq ($(subdir),string)
-sysdep_routines += cacheinfo
-endif
-
 ifeq (yes,$(config-asflags-i686))
 CFLAGS-.o += -Wa,-mtune=i686
 CFLAGS-.os += -Wa,-mtune=i686
diff --git a/sysdeps/i386/i686/cacheinfo.c b/sysdeps/i386/i686/cacheinfo.c
index 0f869df..dfee51a 100644
--- a/sysdeps/i386/i686/cacheinfo.c
+++ b/sysdeps/i386/i686/cacheinfo.c
@@ -1,4 +1,4 @@
 #define DISABLE_PREFETCHW
 #define DISABLE_PREFERRED_MEMORY_INSTRUCTION

-#include <sysdeps/x86_64/cacheinfo.c>
+#include <sysdeps/x86/i686/cacheinfo.c>
diff --git a/sysdeps/x86/i686/Makefile b/sysdeps/x86/i686/Makefile
new file mode 100644
index 0000000..e116d1f
--- /dev/null
+++ b/sysdeps/x86/i686/Makefile
@@ -0,0 +1,3 @@
+ifeq ($(subdir),string)
+sysdep_routines += cacheinfo
+endif
diff --git a/sysdeps/x86_64/cacheinfo.c b/sysdeps/x86/i686/cacheinfo.c
similarity index 100%
rename from sysdeps/x86_64/cacheinfo.c
rename to sysdeps/x86/i686/cacheinfo.c
diff --git a/sysdeps/x86_64/Implies b/sysdeps/x86_64/Implies
index 811c19a..fc0daf3 100644
--- a/sysdeps/x86_64/Implies
+++ b/sysdeps/x86_64/Implies
@@ -1,4 +1,5 @@
 x86
+x86/i686
 ieee754/ldbl-96
 ieee754/dbl-64/wordsize-64
 ieee754/dbl-64
diff --git a/sysdeps/x86_64/Makefile b/sysdeps/x86_64/Makefile
index 78c98e7..efaae27 100644
--- a/sysdeps/x86_64/Makefile
+++ b/sysdeps/x86_64/Makefile
@@ -16,7 +16,7 @@ tests += tst-mallocalign1
 endif

 ifeq ($(subdir),string)
-sysdep_routines += cacheinfo strcasecmp_l-nonascii strncase_l-nonascii
+sysdep_routines += strcasecmp_l-nonascii strncase_l-nonascii
 gen-as-const-headers += locale-defines.sym
 endif

diff --git a/sysdeps/x86_64/multiarch/cacheinfo.c
b/sysdeps/x86_64/multiarch/cacheinfo.c
index f87b8dc..f6cd3e4 100644
--- a/sysdeps/x86_64/multiarch/cacheinfo.c
+++ b/sysdeps/x86_64/multiarch/cacheinfo.c
@@ -1,2 +1,2 @@
 #define DISABLE_PREFERRED_MEMORY_INSTRUCTION
-#include "../cacheinfo.c"
+#include <sysdeps/x86/i686/cacheinfo.c>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]