aboutsummaryrefslogtreecommitdiff
path: root/benchmarks/common
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@cs.berkeley.edu>2014-12-12 18:17:31 -0800
committerAndrew Waterman <waterman@cs.berkeley.edu>2014-12-12 18:17:31 -0800
commit984abbe6e67503c93dbb13d9a305960f11c4ba7b (patch)
treef5e5ad55b5e39b1a960d689b93ad3fda35b75283 /benchmarks/common
parent1d8e02859be502647b52a71623f543712c869b2f (diff)
downloadriscv-tests-984abbe6e67503c93dbb13d9a305960f11c4ba7b.zip
riscv-tests-984abbe6e67503c93dbb13d9a305960f11c4ba7b.tar.gz
riscv-tests-984abbe6e67503c93dbb13d9a305960f11c4ba7b.tar.bz2
Add more entropy to matrix multiplication input
This will exercise the floating-point units more thoroughly.
Diffstat (limited to 'benchmarks/common')
-rw-r--r--benchmarks/common/util.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/benchmarks/common/util.h b/benchmarks/common/util.h
index 638f024..24a1cad 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
+#include <stdint.h>
+
extern int have_vec;
#define static_assert(cond) switch(0) { case 0: case !!(long)(cond): ; }
@@ -109,6 +111,12 @@ static void __attribute__((noinline)) barrier(int ncores)
__sync_synchronize();
}
+static uint64_t lfsr(uint64_t x)
+{
+ uint64_t bit = (x ^ (x >> 1)) & 1;
+ return (x >> 1) | (bit << 62);
+}
+
#ifdef __riscv
#include "encoding.h"
#endif