#include <ostream>
#include <stdexcept>
-#include "base/refcnt.hh"
-/* Hide the fact that this enum is generated by Python */
-#include "enums/ByteOrder.hh"
-
/** uint64_t constant */
#define ULL(N) ((uint64_t)N##ULL)
/** int64_t constant */
constexpr operator uint64_t() const { return c; }
/** Prefix increment operator. */
- Cycles& operator++()
- { ++c; return *this; }
+ Cycles& operator++() { ++c; return *this; }
/** Prefix decrement operator. Is only temporarily used in the O3 CPU. */
- Cycles& operator--()
- { assert(c != 0); --c; return *this; }
+ Cycles& operator--() { assert(c != 0); --c; return *this; }
/** In-place addition of cycles. */
- Cycles& operator+=(const Cycles& cc)
- { c += cc.c; return *this; }
+ Cycles& operator+=(const Cycles& cc) { c += cc.c; return *this; }
/** Greater than comparison used for > Cycles(0). */
- constexpr bool operator>(const Cycles& cc) const
- { return c > cc.c; }
+ constexpr bool
+ operator>(const Cycles& cc) const
+ {
+ return c > cc.c;
+ }
- constexpr Cycles operator +(const Cycles& b) const
- { return Cycles(c + b.c); }
+ constexpr Cycles
+ operator+(const Cycles& b) const
+ {
+ return Cycles(c + b.c);
+ }
- constexpr Cycles operator -(const Cycles& b) const
+ constexpr Cycles
+ operator-(const Cycles& b) const
{
return c >= b.c ? Cycles(c - b.c) :
throw std::invalid_argument("RHS cycle value larger than LHS");
}
- constexpr Cycles operator <<(const int32_t shift) const
- { return Cycles(c << shift); }
+ constexpr Cycles
+ operator <<(const int32_t shift) const
+ {
+ return Cycles(c << shift);
+ }
- constexpr Cycles operator >>(const int32_t shift) const
- { return Cycles(c >> shift); }
+ constexpr Cycles
+ operator >>(const int32_t shift) const
+ {
+ return Cycles(c >> shift);
+ }
friend std::ostream& operator<<(std::ostream &out, const Cycles & cycles);
};