aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHoward Mao <zhehao.mao@gmail.com>2016-11-08 12:43:48 -0800
committerHoward Mao <zhehao.mao@gmail.com>2016-11-10 11:39:02 -0800
commitf27b4fd0045d6a8c438f7676886bb371987bc321 (patch)
treeb503bf1a546d6d709877d7af5cbb62bfe16c5d67
parent2e288c728cf5b993fce8d1d331803509c6b65d88 (diff)
downloadriscv-tests-f27b4fd0045d6a8c438f7676886bb371987bc321.zip
riscv-tests-f27b4fd0045d6a8c438f7676886bb371987bc321.tar.gz
riscv-tests-f27b4fd0045d6a8c438f7676886bb371987bc321.tar.bz2
fixes to memcpy() benchmarks
-rw-r--r--benchmarks/dma-memcpy/dma_memcpy_main.c4
-rw-r--r--benchmarks/memcpy/memcpy.c16
-rw-r--r--benchmarks/memcpy/memcpy_main.c4
3 files changed, 16 insertions, 8 deletions
diff --git a/benchmarks/dma-memcpy/dma_memcpy_main.c b/benchmarks/dma-memcpy/dma_memcpy_main.c
index 820775a..029b22c 100644
--- a/benchmarks/dma-memcpy/dma_memcpy_main.c
+++ b/benchmarks/dma-memcpy/dma_memcpy_main.c
@@ -3,8 +3,8 @@
#include "util.h"
#include "dma_memcpy.h"
-#define MAX_SIZE 4 * 4096
-#define START_SIZE 256
+#define MAX_SIZE 256 * 1024
+#define START_SIZE 1024
int a[MAX_SIZE / sizeof(int)];
int b[MAX_SIZE / sizeof(int)];
diff --git a/benchmarks/memcpy/memcpy.c b/benchmarks/memcpy/memcpy.c
index b2511d5..37e5821 100644
--- a/benchmarks/memcpy/memcpy.c
+++ b/benchmarks/memcpy/memcpy.c
@@ -9,9 +9,9 @@ void fill(int *arr, size_t n)
}
}
-#pragma GCC optimize ("unroll-loops")
+//#pragma GCC optimize ("unroll-loops")
-#define UNROLL 4
+#define UNROLL 8
void fast_memcpy(void *dst, void *src, size_t len)
{
@@ -23,8 +23,16 @@ void fast_memcpy(void *dst, void *src, size_t len)
size_t lenu = ((n / UNROLL) * UNROLL) * sizeof(uintptr_t);
while (d < (uintptr_t *)(dst + lenu)) {
- for (int i = 0; i < UNROLL; i++)
- d[i] = s[i];
+ //for (int i = 0; i < UNROLL; i++)
+ // d[i] = s[i];
+ d[0] = s[0];
+ d[1] = s[1];
+ d[2] = s[2];
+ d[3] = s[3];
+ d[4] = s[4];
+ d[5] = s[5];
+ d[6] = s[6];
+ d[7] = s[7];
d += UNROLL;
s += UNROLL;
}
diff --git a/benchmarks/memcpy/memcpy_main.c b/benchmarks/memcpy/memcpy_main.c
index 430788a..2284530 100644
--- a/benchmarks/memcpy/memcpy_main.c
+++ b/benchmarks/memcpy/memcpy_main.c
@@ -3,8 +3,8 @@
#include "util.h"
#include "memcpy.h"
-#define MAX_SIZE 4 * 4096
-#define START_SIZE 256
+#define MAX_SIZE 256 * 1024
+#define START_SIZE 1024
int a[MAX_SIZE / sizeof(int)];
int b[MAX_SIZE / sizeof(int)];