+static GenericValue executeICMP_EQ(GenericValue Src1, GenericValue Src2,
+ const Type *Ty) {
+ GenericValue Dest;
+ switch (Ty->getTypeID()) {
+ IMPLEMENT_ICMP(==, Int8, uint8_t);
+ IMPLEMENT_ICMP(==, Int16, uint16_t);
+ IMPLEMENT_ICMP(==, Int32, uint32_t);
+ IMPLEMENT_ICMP(==, Int64, uint64_t);
+ IMPLEMENT_POINTERCMP(==);
+ default:
+ cerr << "Unhandled type for ICMP_EQ predicate: " << *Ty << "\n";
+ abort();
+ }
+ return Dest;
+}
+
+static GenericValue executeICMP_NE(GenericValue Src1, GenericValue Src2,
+ const Type *Ty) {
+ GenericValue Dest;
+ switch (Ty->getTypeID()) {
+ IMPLEMENT_ICMP(!=, Int8, uint8_t);
+ IMPLEMENT_ICMP(!=, Int16, uint16_t);
+ IMPLEMENT_ICMP(!=, Int32, uint32_t);
+ IMPLEMENT_ICMP(!=, Int64, uint64_t);
+ IMPLEMENT_POINTERCMP(!=);
+ default:
+ cerr << "Unhandled type for ICMP_NE predicate: " << *Ty << "\n";
+ abort();
+ }
+ return Dest;
+}
+
+static GenericValue executeICMP_ULT(GenericValue Src1, GenericValue Src2,
+ const Type *Ty) {
+ GenericValue Dest;
+ switch (Ty->getTypeID()) {
+ IMPLEMENT_ICMP(<, Int8, uint8_t);
+ IMPLEMENT_ICMP(<, Int16, uint16_t);
+ IMPLEMENT_ICMP(<, Int32, uint32_t);
+ IMPLEMENT_ICMP(<, Int64, uint64_t);
+ IMPLEMENT_POINTERCMP(<);
+ default:
+ cerr << "Unhandled type for ICMP_ULT predicate: " << *Ty << "\n";
+ abort();
+ }
+ return Dest;
+}
+
+static GenericValue executeICMP_SLT(GenericValue Src1, GenericValue Src2,
+ const Type *Ty) {
+ GenericValue Dest;
+ switch (Ty->getTypeID()) {
+ IMPLEMENT_ICMP(<, Int8, int8_t);
+ IMPLEMENT_ICMP(<, Int16, int16_t);
+ IMPLEMENT_ICMP(<, Int32, int32_t);
+ IMPLEMENT_ICMP(<, Int64, int64_t);
+ IMPLEMENT_POINTERCMP(<);
+ default:
+ cerr << "Unhandled type for ICMP_SLT predicate: " << *Ty << "\n";
+ abort();
+ }
+ return Dest;
+}
+
+static GenericValue executeICMP_UGT(GenericValue Src1, GenericValue Src2,
+ const Type *Ty) {
+ GenericValue Dest;
+ switch (Ty->getTypeID()) {
+ IMPLEMENT_ICMP(>, Int8, uint8_t);
+ IMPLEMENT_ICMP(>, Int16, uint16_t);
+ IMPLEMENT_ICMP(>, Int32, uint32_t);
+ IMPLEMENT_ICMP(>, Int64, uint64_t);
+ IMPLEMENT_POINTERCMP(>);
+ default:
+ cerr << "Unhandled type for ICMP_UGT predicate: " << *Ty << "\n";
+ abort();
+ }
+ return Dest;
+}
+
+static GenericValue executeICMP_SGT(GenericValue Src1, GenericValue Src2,
+ const Type *Ty) {
+ GenericValue Dest;
+ switch (Ty->getTypeID()) {
+ IMPLEMENT_ICMP(>, Int8, int8_t);
+ IMPLEMENT_ICMP(>, Int16, int16_t);
+ IMPLEMENT_ICMP(>, Int32, int32_t);
+ IMPLEMENT_ICMP(>, Int64, int64_t);
+ IMPLEMENT_POINTERCMP(>);
+ default:
+ cerr << "Unhandled type for ICMP_SGT predicate: " << *Ty << "\n";
+ abort();
+ }
+ return Dest;
+}
+
+static GenericValue executeICMP_ULE(GenericValue Src1, GenericValue Src2,
+ const Type *Ty) {
+ GenericValue Dest;
+ switch (Ty->getTypeID()) {
+ IMPLEMENT_ICMP(<=, Int8, uint8_t);
+ IMPLEMENT_ICMP(<=, Int16, uint16_t);
+ IMPLEMENT_ICMP(<=, Int32, uint32_t);
+ IMPLEMENT_ICMP(<=, Int64, uint64_t);
+ IMPLEMENT_POINTERCMP(<=);
+ default:
+ cerr << "Unhandled type for ICMP_ULE predicate: " << *Ty << "\n";
+ abort();
+ }
+ return Dest;
+}
+
+static GenericValue executeICMP_SLE(GenericValue Src1, GenericValue Src2,
+ const Type *Ty) {
+ GenericValue Dest;
+ switch (Ty->getTypeID()) {
+ IMPLEMENT_ICMP(<=, Int8, int8_t);
+ IMPLEMENT_ICMP(<=, Int16, int16_t);
+ IMPLEMENT_ICMP(<=, Int32, int32_t);
+ IMPLEMENT_ICMP(<=, Int64, int64_t);
+ IMPLEMENT_POINTERCMP(<=);
+ default:
+ cerr << "Unhandled type for ICMP_SLE predicate: " << *Ty << "\n";
+ abort();
+ }
+ return Dest;
+}
+
+static GenericValue executeICMP_UGE(GenericValue Src1, GenericValue Src2,
+ const Type *Ty) {