Commit 791c2261d6f1d9fbb1c6d1194129828009f9025e
1 parent
163a7cb6
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
Showing
1 changed file
with
14 additions
and
9 deletions
tests/test-i386.c
@@ -33,6 +33,7 @@ | @@ -33,6 +33,7 @@ | ||
33 | #define TEST_CMOV 0 | 33 | #define TEST_CMOV 0 |
34 | #define TEST_FCOMI 0 | 34 | #define TEST_FCOMI 0 |
35 | //#define LINUX_VM86_IOPL_FIX | 35 | //#define LINUX_VM86_IOPL_FIX |
36 | +//#define TEST_P4_FLAGS | ||
36 | 37 | ||
37 | #define xglue(x, y) x ## y | 38 | #define xglue(x, y) x ## y |
38 | #define glue(x, y) xglue(x, y) | 39 | #define glue(x, y) xglue(x, y) |
@@ -352,7 +353,11 @@ void test_jcc(void) | @@ -352,7 +353,11 @@ void test_jcc(void) | ||
352 | } | 353 | } |
353 | 354 | ||
354 | #undef CC_MASK | 355 | #undef CC_MASK |
356 | +#ifdef TEST_P4_FLAGS | ||
357 | +#define CC_MASK (CC_C | CC_P | CC_Z | CC_S | CC_O | CC_A) | ||
358 | +#else | ||
355 | #define CC_MASK (CC_O | CC_C) | 359 | #define CC_MASK (CC_O | CC_C) |
360 | +#endif | ||
356 | 361 | ||
357 | #define OP mul | 362 | #define OP mul |
358 | #include "test-i386-muldiv.h" | 363 | #include "test-i386-muldiv.h" |
@@ -360,15 +365,6 @@ void test_jcc(void) | @@ -360,15 +365,6 @@ void test_jcc(void) | ||
360 | #define OP imul | 365 | #define OP imul |
361 | #include "test-i386-muldiv.h" | 366 | #include "test-i386-muldiv.h" |
362 | 367 | ||
363 | -#undef CC_MASK | ||
364 | -#define CC_MASK (0) | ||
365 | - | ||
366 | -#define OP div | ||
367 | -#include "test-i386-muldiv.h" | ||
368 | - | ||
369 | -#define OP idiv | ||
370 | -#include "test-i386-muldiv.h" | ||
371 | - | ||
372 | void test_imulw2(int op0, int op1) | 368 | void test_imulw2(int op0, int op1) |
373 | { | 369 | { |
374 | int res, s1, s0, flags; | 370 | int res, s1, s0, flags; |
@@ -405,6 +401,15 @@ void test_imull2(int op0, int op1) | @@ -405,6 +401,15 @@ void test_imull2(int op0, int op1) | ||
405 | "imull", s0, s1, res, flags & CC_MASK); | 401 | "imull", s0, s1, res, flags & CC_MASK); |
406 | } | 402 | } |
407 | 403 | ||
404 | +#undef CC_MASK | ||
405 | +#define CC_MASK (0) | ||
406 | + | ||
407 | +#define OP div | ||
408 | +#include "test-i386-muldiv.h" | ||
409 | + | ||
410 | +#define OP idiv | ||
411 | +#include "test-i386-muldiv.h" | ||
412 | + | ||
408 | void test_mul(void) | 413 | void test_mul(void) |
409 | { | 414 | { |
410 | test_imulb(0x1234561d, 4); | 415 | test_imulb(0x1234561d, 4); |