void exec_op(int s2, int s0, int s1)
{
- exec_opl(s2, s0, s1, 0);
+ int o,s,z,a,c,p,flags_in;
+ for (o = 0; o < 2; o++) {
+ for (s = 0; s < 2; s++) {
+ for (z = 0; z < 2; z++) {
+ for (a = 0; a < 2; a++) {
+ for (c = 0; c < 2; c++) {
+ for (p = 0; p < 2; p++) {
+
+ flags_in = (o ? CC_O : 0)
+ | (s ? CC_S : 0)
+ | (z ? CC_Z : 0)
+ | (a ? CC_A : 0)
+ | (c ? CC_C : 0)
+ | (p ? CC_P : 0);
+
+ exec_opl(s2, s0, s1, flags_in);
#ifdef OP_SHIFTD
if (s1 <= 15)
- exec_opw(s2, s0, s1, 0);
+ exec_opw(s2, s0, s1, flags_in);
#else
- exec_opw(s2, s0, s1, 0);
+ exec_opw(s2, s0, s1, flags_in);
#endif
#ifndef OP_NOBYTE
- exec_opb(s0, s1, 0);
+ exec_opb(s0, s1, flags_in);
#endif
#ifdef OP_CC
- exec_opl(s2, s0, s1, CC_C);
- exec_opw(s2, s0, s1, CC_C);
- exec_opb(s0, s1, CC_C);
+ exec_opl(s2, s0, s1, flags_in);
+ exec_opw(s2, s0, s1, flags_in);
+ exec_opb(s0, s1, flags_in);
#endif
+
+ }}}}}}
+
}
void glue(test_, OP)(void)
TEST_BCD(aam, 0x12340547, CC_A, (CC_C | CC_P | CC_Z | CC_S | CC_O | CC_A));
TEST_BCD(aad, 0x12340407, CC_A, (CC_C | CC_P | CC_Z | CC_S | CC_O | CC_A));
}
+#endif /* 0 */
#define TEST_XCHG(op, size, opconst)\
{\
TEST_XCHG(xchgw, "w", "=m");
TEST_XCHG(xchgb, "b", "=m");
+#if 0
TEST_XCHG(xaddl, "", "=q");
TEST_XCHG(xaddw, "w", "=q");
TEST_XCHG(xaddb, "b", "=q");
TEST_XCHG(xaddl, "", "=m");
TEST_XCHG(xaddw, "w", "=m");
TEST_XCHG(xaddb, "b", "=m");
-
+#endif
TEST_CMPXCHG(cmpxchgl, "", "=q", 0xfbca7654);
TEST_CMPXCHG(cmpxchgw, "w", "=q", 0xfbca7654);
TEST_CMPXCHG(cmpxchgb, "b", "=q", 0xfbca7654);
TEST_CMPXCHG(cmpxchgl, "", "=m", 0xfffefdfc);
TEST_CMPXCHG(cmpxchgw, "w", "=m", 0xfffefdfc);
TEST_CMPXCHG(cmpxchgb, "b", "=m", 0xfffefdfc);
-
+#if 0
{
uint64_t op0, op1, op2;
int i, eflags;
op0, op1, eflags & CC_Z);
}
}
-}
#endif
+}
/**********************************************/
/* segmentation tests */
test_jcc(); //-------------
// test_floats();
//test_bcd();
- //test_xchg();
+ test_xchg();
// test_string(); // REINSTATE
// test_misc(); // REINSTATE
test_lea(); //------------------