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: Repost PATCH: Improve wcschr, wcsrchr, wcscpy for x86_64 andx86_32.


On 05/17/2012 09:37 PM, Andreas Jaeger wrote:
On 12/12/2011 08:03 PM, Dmitrieva Liubov wrote:
This is repost of old patches with optimized wcschr (with SSE2),
wcsrchr (with SSE2), wcscpy (with SSSE3) and its tests.
Please, can you review it.

compiling on Linux/i686 I saw the following warning:


gcc -m32 ../sysdeps/i386/i686/multiarch/wcsrchr-c.c -c -std=gnu99 -fgnu89-inline  -O2 -Wall -Wi
nline -Wwrite-strings -fmerge-all-constants -frounding-math -g -Wstrict-prototypes   -Wa,-mtune
=i686       -I../include -I/home/aj/build/glibc/x86/wcsmbs -I/home/aj/build/glibc/x86 -I../nptl
/sysdeps/unix/sysv/linux/i386/i686 -I../sysdeps/unix/sysv/linux/i386/i686 -I../nptl/sysdeps/uni
x/sysv/linux/i386 -I../sysdeps/unix/sysv/linux/i386/nptl -I../sysdeps/unix/sysv/linux/i386 -I..
/nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../sysdeps/unix/
sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/inet -I../nptl/sysdeps/unix/sysv -I../sysdeps/uni
x/sysv -I../sysdeps/unix/i386 -I../nptl/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../
sysdeps/i386/i686/fpu/multiarch -I../sysdeps/i386/i686/fpu -I../sysdeps/i386/i686/multiarch -I.
./nptl/sysdeps/i386/i686 -I../sysdeps/i386/i686 -I../sysdeps/i386/i486 -I../nptl/sysdeps/i386/i
486 -I../sysdeps/i386/fpu -I../nptl/sysdeps/i386 -I../sysdeps/i386 -I../sysdeps/wordsize-32 -I.
./sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/
ieee754 -I../sysdeps/generic -I../nptl  -I.. -I../libio -I.  -D_LIBC_REENTRANT -include ../incl
ude/libc-symbols.h       -D_IO_MTSAFE_IO -o /home/aj/build/glibc/x86/wcsmbs/wcsrchr-c.o -MD -MP
  -MF /home/aj/build/glibc/x86/wcsmbs/wcsrchr-c.o.dt -MT /home/aj/build/glibc/x86/wcsmbs/wcsrchr
-c.o
In file included from ../sysdeps/i386/i686/multiarch/wcschr-c.c:8:0:
../wcsmbs/wcschr.c:26:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
../wcsmbs/wcschr.c:37:1: warning: data definition has no type or storage class [enabled by default]
../wcsmbs/wcschr.c:37:1: warning: type defaults to ‘int’ in declaration of ‘__hidden_ver1’ [enabled by default]
../wcsmbs/wcschr.c:37:1: warning: parameter names (without types) in function declaration [enabled by default]

Could you fix these, please?


Fixed with the following patch which does the same like other i686
multiarch implementations. Tested on Linux/x86-64 and committing now
as obvious,

Andreas

2012-05-21 Andreas Jaeger <aj@suse.de>

	* sysdeps/i386/i686/multiarch/wcschr-c.c: Redefine libc_hidden_def
	only if [SHARED]. Add prototype for __wcschr_ia32.

diff --git a/sysdeps/i386/i686/multiarch/wcschr-c.c b/sysdeps/i386/i686/multiarch/wcschr-c.c
index a63e50e..c23af26 100644
--- a/sysdeps/i386/i686/multiarch/wcschr-c.c
+++ b/sysdeps/i386/i686/multiarch/wcschr-c.c
@@ -1,8 +1,14 @@
+#include <wchar.h>
+
#ifndef NOT_IN_libc
-# undef libc_hidden_def
-# define libc_hidden_def(name) \
- __hidden_ver1 (__wcschr_ia32, __GI_wcschr, __wcschr_ia32);
+# ifdef SHARED
+# undef libc_hidden_def
+# define libc_hidden_def(name) \
+ __hidden_ver1 (__wcschr_ia32, __GI_wcschr, __wcschr_ia32);
+# endif
# define WCSCHR __wcschr_ia32
#endif


+extern __typeof (wcschr) __wcschr_ia32;
+
 #include "wcsmbs/wcschr.c"

--
 Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
  SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
    GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126


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