aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@cs.berkeley.edu>2014-09-27 11:18:15 -0700
committerAndrew Waterman <waterman@cs.berkeley.edu>2014-09-27 11:18:15 -0700
commit2e127592a7273ab34ef4970d183dc15bbab8257b (patch)
tree5a21c6fa36dfcce1b85301c2afacc3bd84a42d2a
parentbaa8d8be1f1a3d83caf248533fda9abaa3b0ee70 (diff)
downloadriscv-isa-sim-2e127592a7273ab34ef4970d183dc15bbab8257b.zip
riscv-isa-sim-2e127592a7273ab34ef4970d183dc15bbab8257b.tar.gz
riscv-isa-sim-2e127592a7273ab34ef4970d183dc15bbab8257b.tar.bz2
Avoid some unused variable warnings
...and also save some space by not defining the register names in a header.
-rw-r--r--riscv/disasm.h15
-rw-r--r--riscv/regnames.cc15
-rw-r--r--riscv/riscv.mk.in5
3 files changed, 20 insertions, 15 deletions
diff --git a/riscv/disasm.h b/riscv/disasm.h
index 58a518a..a8da066 100644
--- a/riscv/disasm.h
+++ b/riscv/disasm.h
@@ -8,19 +8,8 @@
#include <sstream>
#include <vector>
-static const char* xpr_name[] = {
- "zero", "ra", "s0", "s1", "s2", "s3", "s4", "s5",
- "s6", "s7", "s8", "s9", "s10", "s11", "sp", "tp",
- "v0", "v1", "a0", "a1", "a2", "a3", "a4", "a5",
- "a6", "a7", "t0", "t1", "t2", "t3", "t4", "gp"
-};
-
-static const char* fpr_name[] = {
- "fs0", "fs1", "fs2", "fs3", "fs4", "fs5", "fs6", "fs7",
- "fs8", "fs9", "fs10", "fs11", "fs12", "fs13", "fs14", "fs15",
- "fv0", "fv1", "fa0", "fa1", "fa2", "fa3", "fa4", "fa5",
- "fa6", "fa7", "ft0", "ft1", "ft2", "ft3", "ft4", "ft5"
-};
+extern const char* xpr_name[NXPR];
+extern const char* fpr_name[NFPR];
class arg_t
{
diff --git a/riscv/regnames.cc b/riscv/regnames.cc
new file mode 100644
index 0000000..93cb736
--- /dev/null
+++ b/riscv/regnames.cc
@@ -0,0 +1,15 @@
+#include "disasm.h"
+
+const char* xpr_name[] = {
+ "zero", "ra", "s0", "s1", "s2", "s3", "s4", "s5",
+ "s6", "s7", "s8", "s9", "s10", "s11", "sp", "tp",
+ "v0", "v1", "a0", "a1", "a2", "a3", "a4", "a5",
+ "a6", "a7", "t0", "t1", "t2", "t3", "t4", "gp"
+};
+
+const char* fpr_name[] = {
+ "fs0", "fs1", "fs2", "fs3", "fs4", "fs5", "fs6", "fs7",
+ "fs8", "fs9", "fs10", "fs11", "fs12", "fs13", "fs14", "fs15",
+ "fv0", "fv1", "fa0", "fa1", "fa2", "fa3", "fa4", "fa5",
+ "fa6", "fa7", "ft0", "ft1", "ft2", "ft3", "ft4", "ft5"
+};
diff --git a/riscv/riscv.mk.in b/riscv/riscv.mk.in
index e9ca63f..f916bd1 100644
--- a/riscv/riscv.mk.in
+++ b/riscv/riscv.mk.in
@@ -35,8 +35,9 @@ riscv_srcs = \
cachesim.cc \
mmu.cc \
disasm.cc \
- extension.cc \
- rocc.cc \
+ extension.cc \
+ rocc.cc \
+ regnames.cc \
$(riscv_gen_srcs) \
riscv_test_srcs =