This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch hjl/memcmp/avx2 updated. glibc-2.25-537-g3f422f5
- From: hjl at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 21 Jun 2017 17:16:33 -0000
- Subject: GNU C Library master sources branch hjl/memcmp/avx2 updated. glibc-2.25-537-g3f422f5
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, hjl/memcmp/avx2 has been updated
via 3f422f51cbcae44360f99b386661ab974a8246cf (commit)
from 04a4c8ed54e0f5c987bb90c1d9bb4f9d036c1f09 (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=3f422f51cbcae44360f99b386661ab974a8246cf
commit 3f422f51cbcae44360f99b386661ab974a8246cf
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Wed Jun 21 10:16:07 2017 -0700
Add do_test2
diff --git a/benchtests/bench-memcmp.c b/benchtests/bench-memcmp.c
index 84cba9a..a159cf4 100644
--- a/benchtests/bench-memcmp.c
+++ b/benchtests/bench-memcmp.c
@@ -120,7 +120,48 @@ do_test (size_t align1, size_t align2, size_t len, int exp_result)
s2[len] = align2;
s2[len - 1] -= exp_result;
- printf ("Length %4zd, alignment %2zd/%2zd:", len, align1, align2);
+ printf ("Length %4zd, Diff %4zd, alignment %2zd/%2zd:",
+ len, len, align1, align2);
+
+ FOR_EACH_IMPL (impl, 0)
+ do_one_test (impl, s1, s2, len, exp_result);
+
+ putchar ('\n');
+}
+
+static void
+do_test2 (size_t align1, size_t align2, size_t len, size_t diff,
+ int exp_result)
+{
+ size_t i;
+ CHAR *s1, *s2;
+
+ if (len == 0)
+ return;
+
+ if (diff > len)
+ return;
+
+ align1 &= 63;
+ if (align1 + (len + 1) * CHARBYTES >= page_size)
+ return;
+
+ align2 &= 63;
+ if (align2 + (len + 1) * CHARBYTES >= page_size)
+ return;
+
+ s1 = (CHAR *) (buf1 + align1);
+ s2 = (CHAR *) (buf2 + align2);
+
+ for (i = 0; i < len; i++)
+ s1[i] = s2[i] = 1 + (23 << ((CHARBYTES - 1) * 8)) * i % CHAR__MAX;
+
+ s1[len] = align1;
+ s2[len] = align2;
+ s2[diff - 1] -= exp_result;
+
+ printf ("Length %4zd, Diff %4zd, alignment %2zd/%2zd:",
+ len, diff, align1, align2);
FOR_EACH_IMPL (impl, 0)
do_one_test (impl, s1, s2, len, exp_result);
@@ -140,6 +181,13 @@ test_main (void)
printf ("\t%s", impl->name);
putchar ('\n');
+ for (i = 32; i < 64; ++i)
+ {
+ do_test2 (0, 0, i, 31, 1);
+ do_test2 (0, 0, i, 31, -1);
+ do_test2 (0, 0, i, 31, 0);
+ }
+
for (i = 1; i < 16; ++i)
{
do_test (i * CHARBYTES, i * CHARBYTES, i, 0);
-----------------------------------------------------------------------
Summary of changes:
benchtests/bench-memcmp.c | 50 ++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 49 insertions(+), 1 deletions(-)
hooks/post-receive
--
GNU C Library master sources