diff --git a/src/base/condcodes.hh b/src/base/condcodes.hh index 2980a1478f..5de2daa773 100644 --- a/src/base/condcodes.hh +++ b/src/base/condcodes.hh @@ -30,7 +30,6 @@ #define __BASE_CONDCODE_HH__ #include "base/bitfield.hh" -#include "base/trace.hh" /** * Calculate the carry flag from an addition. This should work even when @@ -76,9 +75,9 @@ * src1 and src2 can neither be 1. So the overall result bit is 1. Hence: * ~1 + 0 + 0 => 0. We return false. */ -inline -bool -findCarry(int width, uint64_t dest, uint64_t src1, uint64_t src2) { +static inline bool +findCarry(int width, uint64_t dest, uint64_t src1, uint64_t src2) +{ int shift = width - 1; return ((~(dest >> shift) & 1) + ((src1 >> shift) & 1) + @@ -88,9 +87,9 @@ findCarry(int width, uint64_t dest, uint64_t src1, uint64_t src2) { /** * Calculate the overflow flag from an addition. */ -inline -bool -findOverflow(int width, uint64_t dest, uint64_t src1, uint64_t src2) { +static inline bool +findOverflow(int width, uint64_t dest, uint64_t src1, uint64_t src2) +{ int shift = width - 1; return ((src1 ^ ~src2) & (src1 ^ dest)) & (1ULL << shift); } @@ -111,9 +110,9 @@ findOverflow(int width, uint64_t dest, uint64_t src1, uint64_t src2) { * which does not have a corresponding high bit. Therefore, the value must * have odd parity, and we return 1 accordingly. Otherwise we return 0. */ -inline -bool -findParity(int width, uint64_t dest) { +static inline bool +findParity(int width, uint64_t dest) +{ dest &= mask(width); dest ^= (dest >> 32); dest ^= (dest >> 16); @@ -127,18 +126,18 @@ findParity(int width, uint64_t dest) { /** * Calculate the negative flag. */ -inline -bool -findNegative(int width, uint64_t dest) { - return bits(dest, width - 1, width - 1); +static inline bool +findNegative(int width, uint64_t dest) +{ + return bits(dest, width - 1); } /** * Calculate the zero flag. */ -inline -bool -findZero(int width, uint64_t dest) { +static inline bool +findZero(int width, uint64_t dest) +{ return !(dest & mask(width)); }