From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 117318 invoked by alias); 8 Nov 2018 16:46:15 -0000 Mailing-List: contact newlib-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-cvs-owner@sourceware.org Received: (qmail 117256 invoked by uid 9007); 8 Nov 2018 16:46:14 -0000 Date: Thu, 08 Nov 2018 16:46:00 -0000 Message-ID: <20181108164614.117253.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Richard Earnshaw To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] Fix issue with dst bias in memset X-Act-Checkin: newlib-cygwin X-Git-Author: Wilco Dijkstra X-Git-Refname: refs/heads/master X-Git-Oldrev: bba82041b26d21a817bdb6b25ee70c8b1212e17b X-Git-Newrev: df7824d1a465473a1901f67e26fd1485756cb446 X-SW-Source: 2018-q4/txt/msg00027.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=df7824d1a465473a1901f67e26fd1485756cb446 commit df7824d1a465473a1901f67e26fd1485756cb446 Author: Wilco Dijkstra Date: Thu Nov 8 15:50:42 2018 +0000 Fix issue with dst bias in memset This patch fixes an issue in the previous memset loop change. If the zva size is >= 256 and there are more than 64 bytes left in the tail, we could enter the loop and thus need to rebias dst by 32 as well. Since no known CPUs use this size this can't be tested natively, so I've tested it on a simulator initialized with a large zva size. -- Diff: --- newlib/libc/machine/aarch64/memset.S | 1 + 1 file changed, 1 insertion(+) diff --git a/newlib/libc/machine/aarch64/memset.S b/newlib/libc/machine/aarch64/memset.S index 7c8fe58..103e3f8 100644 --- a/newlib/libc/machine/aarch64/memset.S +++ b/newlib/libc/machine/aarch64/memset.S @@ -233,6 +233,7 @@ L(zva_other): subs count, count, zva_len b.hs 3b 4: add count, count, zva_len + sub dst, dst, 32 /* Bias dst for tail loop. */ b L(tail64) .size memset, . - memset