From: Julian Seward Date: Thu, 26 Aug 2004 11:27:21 +0000 (+0000) Subject: * Enable cmpxchg tests. X-Git-Tag: svn/VALGRIND_3_0_1^2~1117 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3769eda8ec42256ad2a58266e31ddcc99bf1b438;p=thirdparty%2Fvalgrind.git * Enable cmpxchg tests. * Enable long-running arithmetic test. * Run the shift/rotate test with all input flag combinations. This shows up some incorrect flag results for rotates by exact multiples of the word size. git-svn-id: svn://svn.valgrind.org/vex/trunk@217 --- diff --git a/VEX/test/test-i386-shift.h b/VEX/test/test-i386-shift.h index c3d8793b8b..e86b85f5a7 100644 --- a/VEX/test/test-i386-shift.h +++ b/VEX/test/test-i386-shift.h @@ -107,21 +107,39 @@ void exec_opb(int s0, int s1, int iflags) 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) diff --git a/VEX/test/test-i386.c b/VEX/test/test-i386.c index 2bc386a7df..97141fc91e 100644 --- a/VEX/test/test-i386.c +++ b/VEX/test/test-i386.c @@ -824,6 +824,7 @@ void test_bcd(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)\ {\ @@ -859,6 +860,7 @@ void test_xchg(void) 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"); @@ -873,7 +875,7 @@ void test_xchg(void) 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); @@ -889,7 +891,7 @@ void test_xchg(void) 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; @@ -910,8 +912,8 @@ void test_xchg(void) op0, op1, eflags & CC_Z); } } -} #endif +} /**********************************************/ /* segmentation tests */ @@ -1649,7 +1651,7 @@ int main(int argc, char **argv) test_jcc(); //------------- // test_floats(); //test_bcd(); - //test_xchg(); + test_xchg(); // test_string(); // REINSTATE // test_misc(); // REINSTATE test_lea(); //------------------ diff --git a/VEX/test/test-i386.h b/VEX/test/test-i386.h index 3c21600437..2e59737095 100644 --- a/VEX/test/test-i386.h +++ b/VEX/test/test-i386.h @@ -163,7 +163,7 @@ void glue(test_, OP)(void) exec_op(0x12348080, 1); exec_op(0x12348080, -2); - if (0) + if (1) for (i = 0; i < NVALS; i++) for (j = 0; j < NVALS; j++) exec_op(val[i], val[j]);