more complete eflags testing for multiplication (P4 case only)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@479 c046a42c-6fe2-441c-8c8c-71466251a162
diff --git a/tests/test-i386.c b/tests/test-i386.c
index 821b79b..0718f5a 100644
--- a/tests/test-i386.c
+++ b/tests/test-i386.c
@@ -33,6 +33,7 @@
#define TEST_CMOV 0
#define TEST_FCOMI 0
//#define LINUX_VM86_IOPL_FIX
+//#define TEST_P4_FLAGS
#define xglue(x, y) x ## y
#define glue(x, y) xglue(x, y)
@@ -352,7 +353,11 @@
}
#undef CC_MASK
+#ifdef TEST_P4_FLAGS
+#define CC_MASK (CC_C | CC_P | CC_Z | CC_S | CC_O | CC_A)
+#else
#define CC_MASK (CC_O | CC_C)
+#endif
#define OP mul
#include "test-i386-muldiv.h"
@@ -360,15 +365,6 @@
#define OP imul
#include "test-i386-muldiv.h"
-#undef CC_MASK
-#define CC_MASK (0)
-
-#define OP div
-#include "test-i386-muldiv.h"
-
-#define OP idiv
-#include "test-i386-muldiv.h"
-
void test_imulw2(int op0, int op1)
{
int res, s1, s0, flags;
@@ -405,6 +401,15 @@
"imull", s0, s1, res, flags & CC_MASK);
}
+#undef CC_MASK
+#define CC_MASK (0)
+
+#define OP div
+#include "test-i386-muldiv.h"
+
+#define OP idiv
+#include "test-i386-muldiv.h"
+
void test_mul(void)
{
test_imulb(0x1234561d, 4);