about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-04-07 14:53:04 +0000
committerUlrich Drepper <drepper@redhat.com>2009-04-07 14:53:04 +0000
commitddba0f17007795ac53ee2f82e6e954dc1a50d104 (patch)
tree62715ca2e6a1422c4a196ed13d80ef2496488a19
parent4bcb2658ff02d72aa83640cf76ac65a430f17004 (diff)
downloadglibc-ddba0f17007795ac53ee2f82e6e954dc1a50d104.tar.gz
glibc-ddba0f17007795ac53ee2f82e6e954dc1a50d104.tar.xz
glibc-ddba0f17007795ac53ee2f82e6e954dc1a50d104.zip
* string/stratcliff.c (do_test): Add memchr tests..
	* sysdeps/x86_64/memchr.S: Fix handling of end of buffer after
	first read quad word.
-rw-r--r--ChangeLog6
-rw-r--r--localedata/locales/ks_IN@devanagari50
-rw-r--r--string/stratcliff.c34
-rw-r--r--sysdeps/x86_64/memchr.S8
4 files changed, 50 insertions, 48 deletions
diff --git a/ChangeLog b/ChangeLog
index 6a26ed5f0e..5efbf5088d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-04-07  Ulrich Drepper  <drepper@redhat.com>
+
+	* string/stratcliff.c (do_test): Add memchr tests..
+	* sysdeps/x86_64/memchr.S: Fix handling of end of buffer after
+	first read quad word.
+
 2009-04-06  Ulrich Drepper  <drepper@redhat.com>
 
 	* string/strverscmp.c (__strverscmp): Fix last cleanups.
diff --git a/localedata/locales/ks_IN@devanagari b/localedata/locales/ks_IN@devanagari
index 2e55de75bf..ebc523481c 100644
--- a/localedata/locales/ks_IN@devanagari
+++ b/localedata/locales/ks_IN@devanagari
@@ -1,11 +1,11 @@
 comment_char    %
 escape_char     /
-% Kashmiri language locale for India.
+% Kashmiri(devanagari) language locale for India.
 % Contributed by Rakesh Pandit <rakesh.pandit@gmail.com> and 
 % Pravin Satpute <psatpute@redhat.com>
 
 LC_IDENTIFICATION
-title      "Kashmiri language locale for India"
+title      "Kashmiri(devanagari) language locale for India"
 source     ""
 address    ""
 contact    ""
@@ -32,51 +32,20 @@ category  "ks_IN@devanagari:2008";LC_TELEPHONE
 END LC_IDENTIFICATION
 
 LC_CTYPE
-copy "i18n"
-
-translit_start
-include "translit_combining";""
-translit_end
+copy "ks_IN"
 END LC_CTYPE
 
 LC_COLLATE
-
-% Copy the template from ISO/IEC 14651
-copy "iso14651_t1"
-
+copy "ks_IN"
 END LC_COLLATE
 
 LC_MONETARY
-% This is the POSIX Locale definition the LC_MONETARY category.
-% These are generated based on XML base Locale difintion file
-% for IBM Class for Unicode/Java
-%
-int_curr_symbol       "<U0049><U004E><U0052><U0020>"
-currency_symbol       "<U0930><U0942>"
-mon_decimal_point     "<U002E>"
-mon_thousands_sep     "<U002C>"
-mon_grouping          3
-positive_sign         ""
-negative_sign         "<U002D>"
-int_frac_digits       2
-frac_digits           2
-p_cs_precedes         1
-p_sep_by_space        1
-n_cs_precedes         1
-n_sep_by_space        1
-p_sign_posn           1
-n_sign_posn           1
-%
+copy "ks_IN"
 END LC_MONETARY
 
 
 LC_NUMERIC
-% This is the POSIX Locale definition for the LC_NUMERIC  category.
-%
-decimal_point          "<U002E>"
-thousands_sep          "<U002C>"
-grouping               3
-%
+copy "ks_IN"
 END LC_NUMERIC
 
 
@@ -185,12 +154,7 @@ END LC_NAME
 
 
 LC_ADDRESS
-postal_fmt  "<U0025><U007A><U0025><U0063><U0025><U0054><U0025><U0073>/
-<U0025><U0062><U0025><U0065><U0025><U0072>"
-
-country_ab2 "<U0049><U004E>"
-country_ab3 "<U0049><U004E><U0044>"
-country_num 356
+copy "ks_IN"
 END LC_ADDRESS
 
 
diff --git a/string/stratcliff.c b/string/stratcliff.c
index 77fe2bcca9..f90616c260 100644
--- a/string/stratcliff.c
+++ b/string/stratcliff.c
@@ -1,5 +1,5 @@
 /* Test for string function add boundaries of usable memory.
-   Copyright (C) 1996,1997,1999-2002,2003,2007 Free Software Foundation, Inc.
+   Copyright (C) 1996,1997,1999-2003,2007, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -46,6 +46,7 @@
 # define STPNCPY stpncpy
 # define MEMCPY memcpy
 # define MEMPCPY mempcpy
+# define MEMCHR memchr
 #endif
 
 
@@ -205,6 +206,37 @@ do_test (void)
 	    }
         }
 
+      /* memchr test */
+      for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
+        {
+	  for (middle = MAX (outer, nchars - 64); middle < nchars; ++middle)
+	    {
+	      adr[middle] = L('V');
+
+	      CHAR *cp = MEMCHR (&adr[outer], L('V'), 3 * size);
+
+	      if (cp - &adr[outer] != middle - outer)
+		{
+		  printf ("%s flunked for outer = %d, middle = %d\n",
+			  STRINGIFY (MEMCHR), outer, middle);
+		  result = 1;
+		}
+
+	      adr[middle] = L('T');
+	    }
+        }
+      for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
+        {
+	  CHAR *cp = MEMCHR (&adr[outer], L('V'), nchars - outer);
+
+	  if (cp != NULL)
+	    {
+	      printf ("%s flunked for outer = %d\n",
+		      STRINGIFY (MEMCHR), outer);
+	      result = 1;
+	    }
+        }
+
       /* This function only exists for single-byte characters.  */
 #ifndef WCSTEST
       /* rawmemchr test */
diff --git a/sysdeps/x86_64/memchr.S b/sysdeps/x86_64/memchr.S
index 15484cb9f3..644362d565 100644
--- a/sysdeps/x86_64/memchr.S
+++ b/sysdeps/x86_64/memchr.S
@@ -37,12 +37,12 @@ ENTRY (memchr)
 	shl	%cl, %esi
 	pmovmskb %xmm0, %ecx
 	andl	%esi, %ecx
-	movl	$0, %esi
+	movl	$16, %esi
 	jnz	1f
 	cmpq	%rsi, %rdx
 	jle	3f
 
-2:	movdqa	16(%rdi,%rsi), %xmm0
+2:	movdqa	(%rdi,%rsi), %xmm0
 	leaq	16(%rsi), %rsi
 	pcmpeqb	%xmm1, %xmm0
 	pmovmskb %xmm0, %ecx
@@ -54,10 +54,10 @@ ENTRY (memchr)
 3:	xorl	%eax, %eax
 	ret
 
-1:	leaq	(%rdi,%rsi), %rax
+1:	leaq	-16(%rdi,%rsi), %rax
 	bsfl	%ecx, %ecx
 	addq	%rcx, %rax
-	addq	%rcx, %rsi
+	leaq	-16(%rsi,%rcx), %rsi
 	cmpq	%rsi, %rdx
 	jle	3b
 	ret