aboutsummaryrefslogtreecommitdiff
path: root/benchmarks/common
diff options
context:
space:
mode:
authorYunsup Lee <yunsup@cs.berkeley.edu>2014-04-14 21:15:15 -0700
committerYunsup Lee <yunsup@cs.berkeley.edu>2014-04-14 21:15:15 -0700
commit83ed3f519de9929b6551b98677047228a8ab4d0c (patch)
tree186fe4ed156de7b588d0dac720d544df771fe60f /benchmarks/common
parent8f6e2420926471a7bd9a660305ab3d6a22f22dc9 (diff)
downloadriscv-tests-83ed3f519de9929b6551b98677047228a8ab4d0c.zip
riscv-tests-83ed3f519de9929b6551b98677047228a8ab4d0c.tar.gz
riscv-tests-83ed3f519de9929b6551b98677047228a8ab4d0c.tar.bz2
commit high-performance mm (scalar and vector versions)
Diffstat (limited to 'benchmarks/common')
-rw-r--r--benchmarks/common/crt.S17
-rw-r--r--benchmarks/common/syscalls.c7
-rw-r--r--benchmarks/common/util.h8
3 files changed, 14 insertions, 18 deletions
diff --git a/benchmarks/common/crt.S b/benchmarks/common/crt.S
index b273900..82cad93 100644
--- a/benchmarks/common/crt.S
+++ b/benchmarks/common/crt.S
@@ -8,14 +8,6 @@
# define SREG sw
#endif
- .data
- .globl _heapend
- .globl environ
-_heapend:
- .word 0
-environ:
- .word 0
-
.text
.globl _start
@@ -62,10 +54,13 @@ _start:
li a0, SR_EF | SR_EA
csrs status, a0
- ## if that didn't stick, we don't have an FPU, so don't initialize it
csrr t0, status
- and t0, t0, SR_EF
- beqz t0, 1f
+ and t1, t0, SR_EA
+ sw t1, have_vec, t2
+
+ ## if that didn't stick, we don't have an FPU, so don't initialize it
+ and t1, t0, SR_EF
+ beqz t1, 1f
fssr x0
fmv.s.x f0, x0
diff --git a/benchmarks/common/syscalls.c b/benchmarks/common/syscalls.c
index a168ebf..e9f04e2 100644
--- a/benchmarks/common/syscalls.c
+++ b/benchmarks/common/syscalls.c
@@ -8,6 +8,9 @@
#define SYS_stats 1234
+// initialized in crt.S
+int have_vec;
+
static long handle_frontend_syscall(long which, long arg0, long arg1, long arg2)
{
volatile uint64_t magic_mem[8] __attribute__((aligned(64)));
@@ -150,8 +153,8 @@ void _init(int cid, int nc)
#undef putchar
int putchar(int ch)
{
- static char buf[64] __attribute__((aligned(64)));
- static int buflen = 0;
+ static __thread char buf[64] __attribute__((aligned(64)));
+ static __thread int buflen = 0;
buf[buflen++] = ch;
diff --git a/benchmarks/common/util.h b/benchmarks/common/util.h
index 7c2a048..6c4f963 100644
--- a/benchmarks/common/util.h
+++ b/benchmarks/common/util.h
@@ -31,6 +31,8 @@ static void setStats(int enable) {}
extern void setStats(int enable);
#endif
+extern int have_vec;
+
#define static_assert(cond) switch(0) { case 0: case !!(long)(cond): ; }
static void printArray(const char name[], int n, const int arr[])
@@ -87,11 +89,7 @@ static int verifyDouble(int n, const volatile double* test, const double* verify
return 0;
}
-#ifndef ncores
-#define ncores 1
-#endif
-
-static void __attribute__((noinline)) barrier()
+static void __attribute__((noinline)) barrier(int ncores)
{
static volatile int sense;
static volatile int count;