29 #include <gtest/gtest.h> 37 TEST(CondCodes, FindCarryWithNoCarryIn8Bit)
46 TEST(CondCodes, FindNoCarryWithNoCarryIn8Bit)
55 TEST(CondCodes, FindCarryWithCarryIn8Bit)
64 TEST(CondCodes, FindNoCarryWithCarryIn8Bit)
73 TEST(CondCodes, FindCarryWithNoCarryIn32Bit)
82 TEST(CondCodes, FindNoCarryWithNoCarryIn32Bit)
87 TEST(CondCodes, FindCarryWithCarryIn32Bit)
102 TEST(CondCodes, FindCarryWithNoCarryIn64Bit)
108 0x8000000000000000));
117 0x0000000000000000));
124 0x7fffffffffffffff));
131 0x00000000ffffffff));
134 TEST(CondCodes, FindCarryWithCarryIn64Bit)
142 0x7fffffffffffffff));
151 0x0000000000000000));
159 0x7fffffffffffffff));
167 0x0000000000000001));
170 TEST(CondCodes, FindOverflow8Bit)
184 TEST(CondCodes, FindOverflow32Bit)
198 TEST(CondCodes, FindOverflow64Bit)
207 0x0000000000000001));
214 0x3fffffffffffffff));
227 TEST(CondCodes, OddParityOverflow)
232 TEST(CondCodes, EvenParityOverflow)
257 TEST(CondCodes, IsZeroOverflow)
TEST(CondCodes, FindCarryWithNoCarryIn8Bit)
static bool findCarry(int width, uint64_t dest, uint64_t src1, uint64_t src2)
Calculate the carry flag from an addition.
#define EXPECT_TRUE(expr)
A macro which verifies that expr evaluates to true.
static bool findNegative(int width, uint64_t dest)
Calculate the negative flag.
#define EXPECT_FALSE(expr)
A macro which verifies that expr evaluates to false.
static bool findOverflow(int width, uint64_t dest, uint64_t src1, uint64_t src2)
Calculate the overflow flag from an addition.
static bool findParity(int width, uint64_t dest)
Calculate the parity of a value.
static bool findZero(int width, uint64_t dest)
Calculate the zero flag.
#define EXPECT_EQ(lhs, rhs)
A macro which verifies that lhs and rhs are equal to each other.