aboutsummaryrefslogtreecommitdiff
path: root/tests/test-i386-muldiv.h
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-03-02 22:19:12 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-03-02 22:19:12 +0000
commit776f2227f6244003a5bcb20ea77c49427e6af023 (patch)
tree8949fa9ed46cd0fe2b7006f2249c50191532d400 /tests/test-i386-muldiv.h
parentd785e6be4d85d08ae34f7942da139493be28ec6b (diff)
x86_64 test program
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1321 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'tests/test-i386-muldiv.h')
-rw-r--r--tests/test-i386-muldiv.h46
1 files changed, 33 insertions, 13 deletions
diff --git a/tests/test-i386-muldiv.h b/tests/test-i386-muldiv.h
index 5dba315c24..fd0d991341 100644
--- a/tests/test-i386-muldiv.h
+++ b/tests/test-i386-muldiv.h
@@ -1,7 +1,7 @@
-void glue(glue(test_, OP), b)(int op0, int op1)
+void glue(glue(test_, OP), b)(long op0, long op1)
{
- int res, s1, s0, flags;
+ long res, s1, s0, flags;
s0 = op0;
s1 = op1;
res = s0;
@@ -10,16 +10,16 @@ void glue(glue(test_, OP), b)(int op0, int op1)
"popf\n\t"
stringify(OP)"b %b2\n\t"
"pushf\n\t"
- "popl %1\n\t"
+ "pop %1\n\t"
: "=a" (res), "=g" (flags)
: "q" (s1), "0" (res), "1" (flags));
- printf("%-10s A=%08x B=%08x R=%08x CC=%04x\n",
+ printf("%-10s A=" FMTLX " B=" FMTLX " R=" FMTLX " CC=%04lx\n",
stringify(OP) "b", s0, s1, res, flags & CC_MASK);
}
-void glue(glue(test_, OP), w)(int op0h, int op0, int op1)
+void glue(glue(test_, OP), w)(long op0h, long op0, long op1)
{
- int res, s1, flags, resh;
+ long res, s1, flags, resh;
s1 = op1;
resh = op0h;
res = op0;
@@ -28,29 +28,49 @@ void glue(glue(test_, OP), w)(int op0h, int op0, int op1)
"popf\n\t"
stringify(OP) "w %w3\n\t"
"pushf\n\t"
- "popl %1\n\t"
+ "pop %1\n\t"
: "=a" (res), "=g" (flags), "=d" (resh)
: "q" (s1), "0" (res), "1" (flags), "2" (resh));
- printf("%-10s AH=%08x AL=%08x B=%08x RH=%08x RL=%08x CC=%04x\n",
+ printf("%-10s AH=" FMTLX " AL=" FMTLX " B=" FMTLX " RH=" FMTLX " RL=" FMTLX " CC=%04lx\n",
stringify(OP) "w", op0h, op0, s1, resh, res, flags & CC_MASK);
}
-void glue(glue(test_, OP), l)(int op0h, int op0, int op1)
+void glue(glue(test_, OP), l)(long op0h, long op0, long op1)
{
- int res, s1, flags, resh;
+ long res, s1, flags, resh;
s1 = op1;
resh = op0h;
res = op0;
flags = 0;
asm ("push %5\n\t"
"popf\n\t"
- stringify(OP) "l %3\n\t"
+ stringify(OP) "l %k3\n\t"
"pushf\n\t"
- "popl %1\n\t"
+ "pop %1\n\t"
: "=a" (res), "=g" (flags), "=d" (resh)
: "q" (s1), "0" (res), "1" (flags), "2" (resh));
- printf("%-10s AH=%08x AL=%08x B=%08x RH=%08x RL=%08x CC=%04x\n",
+ printf("%-10s AH=" FMTLX " AL=" FMTLX " B=" FMTLX " RH=" FMTLX " RL=" FMTLX " CC=%04lx\n",
stringify(OP) "l", op0h, op0, s1, resh, res, flags & CC_MASK);
}
+#if defined(__x86_64__)
+void glue(glue(test_, OP), q)(long op0h, long op0, long op1)
+{
+ long res, s1, flags, resh;
+ s1 = op1;
+ resh = op0h;
+ res = op0;
+ flags = 0;
+ asm ("push %5\n\t"
+ "popf\n\t"
+ stringify(OP) "q %3\n\t"
+ "pushf\n\t"
+ "pop %1\n\t"
+ : "=a" (res), "=g" (flags), "=d" (resh)
+ : "q" (s1), "0" (res), "1" (flags), "2" (resh));
+ printf("%-10s AH=" FMTLX " AL=" FMTLX " B=" FMTLX " RH=" FMTLX " RL=" FMTLX " CC=%04lx\n",
+ stringify(OP) "q", op0h, op0, s1, resh, res, flags & CC_MASK);
+}
+#endif
+
#undef OP