31 #ifndef __BASE_CONDCODE_HH__
32 #define __BASE_CONDCODE_HH__
44 int shift = width - 1;
45 return ((~(dest >> shift) & 1) +
46 ((src1 >> shift) & 1) +
47 ((src2 >> shift) & 1)) & 0x2;
56 int shift = width - 1;
57 return ((src1 ^ ~src2) & (src1 ^ dest)) & (1
ULL <<
shift);
82 return bits(dest, width - 1, width - 1);
91 return !(dest &
mask(width));
94 #endif // __BASE_CONDCODE_HH__
bool findNegative(int width, uint64_t dest)
Calculate the negative flag.
bool findZero(int width, uint64_t dest)
Calculate the zero flag.
#define ULL(N)
uint64_t constant
bool findParity(int width, uint64_t dest)
Calculate the parity of a value.
T bits(T val, int first, int last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it...
bool findCarry(int width, uint64_t dest, uint64_t src1, uint64_t src2)
Calculate the carry flag from an addition.
bool findOverflow(int width, uint64_t dest, uint64_t src1, uint64_t src2)
Calculate the overflow flag from an addition.