This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
PATCH: PR libc/10162: Use a simple loop on data shorter thansoftware pipeline
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 9 Nov 2009 11:57:07 -0800
- Subject: PATCH: PR libc/10162: Use a simple loop on data shorter thansoftware pipeline
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
When data is shorter than software pipeline, recovery may fail. This
patch avoids it by using a simple loop on data shorter than software
pipeline.
H.J.
---
2009-11-09 H.J. Lu <hongjiu.lu@intel.com>
PR libc/10162
* sysdeps/ia64/memchr.S: Use a simple loop on data shorter than
software pipeline.
diff --git a/sysdeps/ia64/memchr.S b/sysdeps/ia64/memchr.S
index cd062b2..e721e17 100644
--- a/sysdeps/ia64/memchr.S
+++ b/sysdeps/ia64/memchr.S
@@ -71,7 +71,8 @@ ENTRY(__memchr)
cmp.ne p7, p0 = r0, r0 // clear p7
extr.u chr = in1, 0, 8 // chr = (unsigned char) in1
mov len = in2
- cmp.gtu p6, p0 = 16, in2 // use a simple loop for short
+ // use a simple loop on data shorter than software pipeline
+ cmp.gtu p6, p0 = ((MEMLAT + 1) * 8), in2
(p6) br.cond.spnt .srchfew ;; // searches
sub loopcnt = 8, tmp // loopcnt = 8 - tmp
cmp.eq p6, p0 = tmp, r0