aboutsummaryrefslogtreecommitdiff
path: root/benchmarks/common/util.h
diff options
context:
space:
mode:
authorAndrew Waterman <andrew@sifive.com>2017-03-22 03:43:15 -0700
committerAndrew Waterman <andrew@sifive.com>2017-03-22 03:43:15 -0700
commit3f1859129af6d26a3357cc1120c75e89d2aa8aaf (patch)
tree0db00d0f6d90b20ba76f7350fff14dbfcfbb4238 /benchmarks/common/util.h
parenta83e3b9243e57a50de283fc07d5b6c81c0443b3d (diff)
downloadriscv-tests-3f1859129af6d26a3357cc1120c75e89d2aa8aaf.zip
riscv-tests-3f1859129af6d26a3357cc1120c75e89d2aa8aaf.tar.gz
riscv-tests-3f1859129af6d26a3357cc1120c75e89d2aa8aaf.tar.bz2
Clean up benchmarks build
Diffstat (limited to 'benchmarks/common/util.h')
-rw-r--r--benchmarks/common/util.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/benchmarks/common/util.h b/benchmarks/common/util.h
index a3e2e8c..081cfd6 100644
--- a/benchmarks/common/util.h
+++ b/benchmarks/common/util.h
@@ -67,6 +67,11 @@ static uint64_t lfsr(uint64_t x)
return (x >> 1) | (bit << 62);
}
+static uintptr_t insn_len(uintptr_t pc)
+{
+ return (*(unsigned short*)pc & 3) ? 4 : 2;
+}
+
#ifdef __riscv
#include "encoding.h"
#endif