This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch hjl/x86/optimize updated. glibc-2.25-311-g1127eac
- From: hjl at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 11 May 2017 16:02:05 -0000
- Subject: GNU C Library master sources branch hjl/x86/optimize updated. glibc-2.25-311-g1127eac
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/x86/optimize has been updated
via 1127eac3db2f2b2c25e4fe82622294b150bc8858 (commit)
from a1235ffcf2833b5eda1d86f1a99c4f0fe084cc8b (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=1127eac3db2f2b2c25e4fe82622294b150bc8858
commit 1127eac3db2f2b2c25e4fe82622294b150bc8858
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu May 11 09:01:15 2017 -0700
Print alignments of source and destination
diff --git a/benchtests/memcpy_benchmark.cc b/benchtests/memcpy_benchmark.cc
index 979373c..e92f6af 100644
--- a/benchtests/memcpy_benchmark.cc
+++ b/benchtests/memcpy_benchmark.cc
@@ -35,6 +35,9 @@ std::chrono::time_point<std::chrono::high_resolution_clock> start;
std::chrono::time_point<std::chrono::high_resolution_clock> stop;
size_t bytes;
+#define MAX_ALIGN 128
+uintptr_t src_align, dest_align;
+
void start_timing() { start = std::chrono::high_resolution_clock::now(); }
void stop_timing() { stop = std::chrono::high_resolution_clock::now(); }
@@ -46,6 +49,9 @@ void BM_memcpy_readwritecache(impl_t *impl, int iters, int size) {
unsigned char * buf1 = new unsigned char [size];
unsigned char * buf2 = new unsigned char [size];
+ src_align = ((uintptr_t) buf1) & (MAX_ALIGN - 1);
+ dest_align = ((uintptr_t) buf2) & (MAX_ALIGN - 1);
+
memset (buf1, 0xa5, size); memset (buf2, 0x5a, size);
start_timing();
@@ -61,6 +67,9 @@ void BM_memcpy_nocache(impl_t *impl, int iters, int size) {
unsigned char * buf1 = new unsigned char [buffer_size];
unsigned char * buf2 = new unsigned char [buffer_size];
+ src_align = ((uintptr_t) buf1) & (MAX_ALIGN - 1);
+ dest_align = ((uintptr_t) buf2) & (MAX_ALIGN - 1);
+
memset (buf1, 0xa5, buffer_size); memset (buf2, 0x5a, buffer_size);
size_t offset = 0;
@@ -79,6 +88,9 @@ void BM_memcpy_readcache(impl_t *impl, int iters, int size) {
unsigned char * buf1 = new unsigned char [size];
unsigned char * buf2 = new unsigned char [buffer_size];
+ src_align = ((uintptr_t) buf1) & (MAX_ALIGN - 1);
+ dest_align = ((uintptr_t) buf2) & (MAX_ALIGN - 1);
+
memset (buf1, 0xa5, size); memset (buf2, 0x5a, buffer_size);
size_t offset = 0;
@@ -110,12 +122,14 @@ std::map<std::string, std::function<void(impl_t *, int, int)>> schemes =
{"Read Cache", BM_memcpy_readcache}};
void test(impl_t *impl) {
- std::cout << " Size (bytes) Time (msec) BW (Gbytes/sec)" << std::endl;
+ std::cout << " Size (bytes) Alignment (src/dest) Time (msec) BW (Gbytes/sec)" << std::endl;
for (auto scheme : schemes) {
std::cout << scheme.first << std::endl;
for (auto size : size_list) {
int time = do_timing(scheme.second, impl, size);
- printf("%12d %10d %10.2f\n", size, time, (bytes * 1000L / time) / 1e9);
+ printf("%12d %15d/%-7d %10d %10.2f\n",
+ size, src_align, dest_align, time,
+ (bytes * 1000L / time) / 1e9);
}
std::cout << "----------------\n";
}
-----------------------------------------------------------------------
Summary of changes:
benchtests/memcpy_benchmark.cc | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
hooks/post-receive
--
GNU C Library master sources