This is the mail archive of the glibc-cvs@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]

GNU C Library master sources branch master updated. glibc-2.23-538-g30e4cc5


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, master has been updated
       via  30e4cc5413f72c2c728a544389da0c48500d9904 (commit)
      from  2918b0d0ecbf781400577d63aed7eaa4498dad91 (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=30e4cc5413f72c2c728a544389da0c48500d9904

commit 30e4cc5413f72c2c728a544389da0c48500d9904
Author: Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com>
Date:   Tue Jul 5 21:20:41 2016 +0530

    powerpc: Fix return code of strcasecmp for unaligned inputs
    
    If the input values are unaligned and if there are null characters in the
    memory before the starting address of the input values, strcasecmp
    gives incorrect return code. Fixed it by adding mask the bits that
    are not part of the string.

diff --git a/ChangeLog b/ChangeLog
index 66627f1..cc875c5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-07-05  Rajalakshmi Srinivasaraghavan  <raji@linux.vnet.ibm.com>
+
+	[BZ #20327]
+	* sysdeps/powerpc/powerpc64/power8/strcasecmp.S: Mask bits that
+	are not part of the string.
+
 2016-07-05  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
 	* nptl/tst-cancel4-common.c (do_test): Add temporary fifo creation.
diff --git a/sysdeps/powerpc/powerpc64/power8/strcasecmp.S b/sysdeps/powerpc/powerpc64/power8/strcasecmp.S
index 63f6217..c83dc52 100644
--- a/sysdeps/powerpc/powerpc64/power8/strcasecmp.S
+++ b/sysdeps/powerpc/powerpc64/power8/strcasecmp.S
@@ -40,11 +40,20 @@
 	vsel	v5, v7, v5, v8; \
 	vcmpequb.	v7, v5, v4;
 
-/* Get 16 bytes for unaligned case.  */
+/*
+ * Get 16 bytes for unaligned case.
+ * reg1: Vector to hold next 16 bytes.
+ * reg2: Address to read from.
+ * reg3: Permute control vector.
+ * v8: Tmp vector used to mask unwanted bytes.
+ * v9: Tmp vector,0 when null is found on first 16 bytes
+ */
 #ifdef __LITTLE_ENDIAN__
 #define GET16BYTES(reg1, reg2, reg3) \
 	lvx	reg1, 0, reg2; \
-	vcmpequb.	v8, v0, reg1; \
+	vspltisb	v8, -1; \
+	vperm	v8, v8, reg1, reg3; \
+	vcmpequb.	v8, v0, v8; \
 	beq	cr6, 1f; \
 	vspltisb	v9, 0; \
 	b	2f; \
@@ -57,7 +66,9 @@
 #else
 #define GET16BYTES(reg1, reg2, reg3) \
 	lvx	reg1, 0, reg2; \
-	vcmpequb.	v8, v0, reg1; \
+	vspltisb	 v8, -1; \
+	vperm	v8, reg1, v8,  reg3; \
+	vcmpequb.	v8, v0, v8; \
 	beq	cr6, 1f; \
 	vspltisb	v9, 0; \
 	b	2f; \

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                     |    6 ++++++
 sysdeps/powerpc/powerpc64/power8/strcasecmp.S |   17 ++++++++++++++---
 2 files changed, 20 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


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