From patchwork Fri Apr 17 17:27:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Miller X-Patchwork-Id: 462165 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3CCD7140293 for ; Sat, 18 Apr 2015 03:27:28 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=sourceware.org header.i=@sourceware.org header.b=ZBYUp62s; dkim-adsp=none (unprotected policy); dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:message-id:to:subject:from:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=pKD wU8Qs8FAQ8E85y537rATFvqT4RX/A6DbvMCAqYxUtK6IdUguQL6oEyuP/F2kRFZh ueyKx/o/sn6856pS8WW9yDdgQJYd6+yTdi1nsElRmoquEt6W105dfxcNWFwwKoLX nHiFNJXzpXkO4V50leIo5hl9zZUDE60a2rXv4ULM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:message-id:to:subject:from:mime-version :content-type:content-transfer-encoding; s=default; bh=PTLM7SasY YPb+PxS7fhCbcvOxxI=; b=ZBYUp62s+JwFuAU/9BAu2bZV+UoPEmQXxp6F+635V 8gHaTTH/NMLhwA/YNgZaakTgCe3pzFZfj70u/2YvbU2KzV4fx9qQ7cnLzYWFyut4 Jy07jQk78++sHDGSkD2l6yhbOfoNUsZe5675oNURztQwiDfq5qWmtksNG/STU6zU YE= Received: (qmail 129109 invoked by alias); 17 Apr 2015 17:27:22 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 129099 invoked by uid 89); 17 Apr 2015 17:27:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.2 required=5.0 tests=AWL, BAYES_50, KAM_BODY_URIBL_PCCC, KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 X-HELO: shards.monkeyblade.net Date: Fri, 17 Apr 2015 13:27:16 -0400 (EDT) Message-Id: <20150417.132716.2222341333915566706.davem@davemloft.net> To: libc-alpha@sourceware.org Subject: [PATCH COMMITTED] Sparc memchr/memcmp/strncmp fixes from Il'ya Malakhov. From: David Miller Mime-Version: 1.0 [BZ #17825] * sysdeps/sparc/sparc64/memchr.S: Fix signedness handling of length. * sysdeps/sparc/sparc64/memcmp.S: Likewise. * sysdeps/sparc/sparc64/strncmp.S: Likewise. --- ChangeLog | 7 +++++++ sysdeps/sparc/sparc64/memchr.S | 3 ++- sysdeps/sparc/sparc64/memcmp.S | 4 ++-- sysdeps/sparc/sparc64/strncmp.S | 4 ++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 215fd11..d8580ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2015-04-16 Il'ya Malakhov + + [BZ #17825] + * sysdeps/sparc/sparc64/memchr.S: Fix signedness handling of length. + * sysdeps/sparc/sparc64/memcmp.S: Likewise. + * sysdeps/sparc/sparc64/strncmp.S: Likewise. + 2015-04-16 David S. Miller * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Make use of diff --git a/sysdeps/sparc/sparc64/memchr.S b/sysdeps/sparc/sparc64/memchr.S index 23ed62e..d92bad1 100644 --- a/sysdeps/sparc/sparc64/memchr.S +++ b/sysdeps/sparc/sparc64/memchr.S @@ -63,7 +63,8 @@ ENTRY(__memchr) be,pn %XCC, 12f /* CTI */ #endif sll %o1, 8, %g3 /* IEU0 Group */ - add %o0, %o2, %o2 /* IEU1 */ + addcc %o0, %o2, %o2 /* IEU1 */ + movcs %XCC, -1, %o2 /* IEU0 Group */ sethi %hi(0x01010101), %g1 /* IEU0 Group */ or %g3, %o1, %g3 /* IEU1 */ diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S index 18ed0ce..552307e 100644 --- a/sysdeps/sparc/sparc64/memcmp.S +++ b/sysdeps/sparc/sparc64/memcmp.S @@ -51,7 +51,7 @@ ENTRY(memcmp) 2: mov %g1, %o3 /* IEU0 Group */ subcc %o2, 8, %o2 /* IEU1 */ - bl,pn %XCC, 5f /* CTI */ + bcs,pn %XCC, 5f /* CTI */ ldxa [%o0] ASI_PNF, %g1 /* Load Group */ mov %g2, %o4 /* IEU0 */ ldxa [%o0 + %o1] ASI_PNF, %g2 /* Load Group */ @@ -125,7 +125,7 @@ ENTRY(memcmp) ldxa [%o0] ASI_PNF, %g5 /* Load */ subcc %o2, 8, %o2 /* IEU1 Group */ - bl,pn %XCC, 6b /* CTI */ + bcs,pn %XCC, 6b /* CTI */ or %o4, %o5, %o4 /* IEU0 */ cmp %o3, %o4 /* IEU1 Group */ diff --git a/sysdeps/sparc/sparc64/strncmp.S b/sysdeps/sparc/sparc64/strncmp.S index cf8f56e..233b62b 100644 --- a/sysdeps/sparc/sparc64/strncmp.S +++ b/sysdeps/sparc/sparc64/strncmp.S @@ -72,7 +72,7 @@ ENTRY(strncmp) add %o0, 8, %o0 /* IEU1 */ 2: subcc %o2, 8, %o2 /* IEU1 Group */ - bl,pn %XCC, 5f /* CTI */ + bcs,pn %XCC, 5f /* CTI */ add %o1, 8, %o1 /* IEU0 */ sub %g4, %g1, %g3 /* IEU0 Group */ @@ -310,7 +310,7 @@ ENTRY(strncmp) addcc %o0, 8, %o0 /* IEU1 */ srlx %o4, %g6, %o5 /* IEU0 */ subcc %o2, 8, %o2 /* IEU1 Group */ - bl,pn %XCC, 5b /* CTI */ + bcs,pn %XCC, 5b /* CTI */ or %o3, %o5, %o3 /* IEU0 */ cmp %g4, %o3 /* IEU1 Group */