summaryrefslogtreecommitdiff
path: root/src/base
diff options
context:
space:
mode:
Diffstat (limited to 'src/base')
-rw-r--r--src/base/SConscript3
-rw-r--r--src/base/fenv.c2
-rw-r--r--src/base/loader/elf_object.cc11
-rw-r--r--src/base/statistics.hh20
4 files changed, 18 insertions, 18 deletions
diff --git a/src/base/SConscript b/src/base/SConscript
index cc9d06a0e..ca68bfb60 100644
--- a/src/base/SConscript
+++ b/src/base/SConscript
@@ -57,7 +57,8 @@ Source('circlebuf.cc')
Source('cprintf.cc')
Source('crc.cc')
Source('fast_alloc.cc')
-Source('fenv.c')
+if env['USE_FENV']:
+ Source('fenv.c')
Source('fifo_buffer.cc')
Source('hostinfo.cc')
Source('hybrid_pred.cc')
diff --git a/src/base/fenv.c b/src/base/fenv.c
index 269913a60..2ec2f796f 100644
--- a/src/base/fenv.c
+++ b/src/base/fenv.c
@@ -39,7 +39,7 @@ static const int m5_round_ops[] = {FE_DOWNWARD, FE_TONEAREST, FE_TOWARDZERO, FE
void m5_fesetround(int rm)
{
- assert(rm > 0 && rm < 4);
+ assert(rm >= 0 && rm < 4);
fesetround(m5_round_ops[rm]);
}
diff --git a/src/base/loader/elf_object.cc b/src/base/loader/elf_object.cc
index 8f157da28..f76ea593b 100644
--- a/src/base/loader/elf_object.cc
+++ b/src/base/loader/elf_object.cc
@@ -31,23 +31,14 @@
#include <string>
-// Because of the -Wundef flag we have to do this
-#define __LIBELF_INTERNAL__ 0
-#define __LIBELF_NEED_LINK_H 0
-#define __LIBELF_SYMBOL_VERSIONS 0
-
#include "gelf.h"
#include "base/loader/elf_object.hh"
-#include "base/misc.hh"
-
#include "base/loader/symtab.hh"
-
+#include "base/misc.hh"
#include "base/trace.hh" // for DPRINTF
-
#include "sim/byteswap.hh"
-
using namespace std;
ObjectFile *
diff --git a/src/base/statistics.hh b/src/base/statistics.hh
index 761b30c2b..8d3f53d4c 100644
--- a/src/base/statistics.hh
+++ b/src/base/statistics.hh
@@ -2094,9 +2094,13 @@ class UnaryNode : public Node
return vresult;
}
- Result total() const {
- Op op;
- return op(l->total());
+ Result total() const
+ {
+ const VResult &vec = this->result();
+ Result total = 0;
+ for (int i = 0; i < size(); i++)
+ total += vec[i];
+ return total;
}
virtual size_t size() const { return l->size(); }
@@ -2149,9 +2153,13 @@ class BinaryNode : public Node
return vresult;
}
- Result total() const {
- Op op;
- return op(l->total(), r->total());
+ Result total() const
+ {
+ const VResult &vec = this->result();
+ Result total = 0;
+ for (int i = 0; i < size(); i++)
+ total += vec[i];
+ return total;
}
virtual size_t size() const {