Test a few more bits and pieces.
git-svn-id: svn://svn.valgrind.org/vex/trunk@931 8f6e269a-dfd6-0310-a8e1-e2731360e62c
diff --git a/test/test-amd64-muldiv.h b/test/test-amd64-muldiv.h
index d6976ac..f8fb2de 100644
--- a/test/test-amd64-muldiv.h
+++ b/test/test-amd64-muldiv.h
@@ -53,4 +53,22 @@
stringify(OP) "l", op0h, op0, s1, resh, res, flags & CC_MASK);
}
+void glue(glue(test_, OP), q)(int64 op0h, int64 op0, int64 op1)
+{
+ int64 res, s1, flags, resh;
+ s1 = op1;
+ resh = op0h;
+ res = op0;
+ flags = 0;
+ asm ("pushq %5\n\t"
+ "popfq\n\t"
+ stringify(OP) "q %3\n\t"
+ "pushfq\n\t"
+ "popq %1\n\t"
+ : "=a" (res), "=g" (flags), "=d" (resh)
+ : "q" (s1), "0" (res), "1" (flags), "2" (resh));
+ printf("%-10s AH=%016llx AL=%016llx B=%016llx RH=%016llx RL=%016llx CC=%04llx\n",
+ stringify(OP) "q", op0h, op0, s1, resh, res, flags & CC_MASK);
+}
+
#undef OP
diff --git a/test/test-amd64.c b/test/test-amd64.c
index f4eaa38..052dd4b 100644
--- a/test/test-amd64.c
+++ b/test/test-amd64.c
@@ -510,6 +510,11 @@
test_idivl(0, 0x80000000, -1);
test_idivl(0x12343, 0x12345678, 0x81234567);
+ test_idivq(0, 0x12345678, 12347);
+ test_idivq(0, -233223, -45);
+ test_idivq(0, 0x80000000, -1);
+ test_idivq(0x12343, 0x12345678, 0x81234567);
+
test_divb(0x12341678, 0x127e);
test_divb(0x43210123, -5);
test_divb(0x12340004, -1);
@@ -523,6 +528,11 @@
test_divl(0, -233223, -45);
test_divl(0, 0x80000000, -1);
test_divl(0x12343, 0x12345678, 0x81234567);
+
+ test_divq(0, 0x12345678, 12347);
+ test_divq(0, -233223, -45);
+ test_divq(0, 0x80000000, -1);
+ test_divq(0x12343, 0x12345678, 0x81234567);
}
#define TEST_BSX(op, size, op0)\
@@ -1666,8 +1676,6 @@
void **ptr;
void (*func)(void);
- printf("hello\n");
- printf("hello again\n");
#if 1
ptr = &call_start + 1;
while (*ptr != NULL) {
@@ -1681,7 +1689,7 @@
// test_floats(); REINSTATE64
//test_bcd();
//test_xchg(); REINSTATE64
- // test_string(); REINSTATE64 FIRST
+ test_string();
//test_misc(); // REINSTATE
test_lea();
// test_segs();