aboutsummaryrefslogtreecommitdiff
path: root/target-i386/ops_template.h
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-12-02 22:01:31 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-12-02 22:01:31 +0000
commitd36cd60e6c8c66e0279bad4b17e2d23833eb20b9 (patch)
treeb79169496fd7c305de1e6a60bc362e0d0f5efd2d /target-i386/ops_template.h
parent5e809a80955cda9c4053fac02411edff733b4840 (diff)
P4 style multiplication eflags
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@481 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-i386/ops_template.h')
-rw-r--r--target-i386/ops_template.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/target-i386/ops_template.h b/target-i386/ops_template.h
index 064881558b..a486d20818 100644
--- a/target-i386/ops_template.h
+++ b/target-i386/ops_template.h
@@ -229,6 +229,29 @@ static int glue(compute_all_sar, SUFFIX)(void)
return cf | pf | af | zf | sf | of;
}
+#if DATA_BITS == 32
+static int glue(compute_c_mul, SUFFIX)(void)
+{
+ int cf;
+ cf = (CC_SRC != 0);
+ return cf;
+}
+#endif
+
+/* NOTE: we compute the flags like the P4. On olders CPUs, only OF and
+ CF are modified and it is slower to do that. */
+static int glue(compute_all_mul, SUFFIX)(void)
+{
+ int cf, pf, af, zf, sf, of;
+ cf = (CC_SRC != 0);
+ pf = parity_table[(uint8_t)CC_DST];
+ af = 0; /* undefined */
+ zf = ((DATA_TYPE)CC_DST == 0) << 6;
+ sf = lshift(CC_DST, 8 - DATA_BITS) & 0x80;
+ of = cf << 11;
+ return cf | pf | af | zf | sf | of;
+}
+
/* various optimized jumps cases */
void OPPROTO glue(op_jb_sub, SUFFIX)(void)