changeset 66eb324d4de1 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=66eb324d4de1
description:
        base: add some mathematical operators to Cycles class

diffstat:

 src/base/types.hh |  12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diffs (22 lines):

diff -r 2759161b9d7f -r 66eb324d4de1 src/base/types.hh
--- a/src/base/types.hh Sun Feb 10 21:26:22 2013 -0600
+++ b/src/base/types.hh Sun Feb 10 21:26:23 2013 -0600
@@ -113,6 +113,18 @@
     bool operator>(const Cycles& cc) const
     { return c > cc.c; }
 
+    const Cycles operator +(const Cycles& b) const
+    { return Cycles(c + b.c); }
+
+    const Cycles operator -(const Cycles& b) const
+    { assert(c >= b.c); return Cycles(c - b.c); }
+
+    const Cycles operator <<(const int32_t shift)
+    { return Cycles(c << shift); }
+
+    const Cycles operator >>(const int32_t shift)
+    { return Cycles(c >> shift); }
+
 #endif // SWIG not touching operators
 
 };
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to