Skip to contentSkip to conversation

[4515] convert eflags manipulation insns to TCG

Qemu-devel Fabrice Bellard 1 participant 1 message May 21, 2008

lore
Share & tools
lore
#0 lore raw

Revision: 4515

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4515
Author:   bellard
Date:     2008-05-21 17:07:20 +0000 (Wed, 21 May 2008)

Log Message:
-----------
convert eflags manipulation insns to TCG

Modified Paths:
--------------

    trunk/target-i386/TODO
    trunk/target-i386/helper.c
    trunk/target-i386/helper.h
    trunk/target-i386/op.c
    trunk/target-i386/translate.c

Modified: trunk/target-i386/TODO
===================================================================

target-i386/TODO +1 -0
@@ -1,5 +1,6 @@
 Correctness issues:
 
+- some eflags manipulation incorrectly reset the bit 0x2.
 - rework eflags optimization (will be a consequence of TCG port)
 - SVM: rework the implementation: simplify code, move most intercept
   tests as dynamic, correct segment access, verify exception safety,

Modified: trunk/target-i386/helper.c
===================================================================

target-i386/helper.c +14 -0
@@ -108,6 +108,20 @@
     spin_unlock(&global_cpu_lock);
 }
 
+void helper_write_eflags(target_ulong t0, uint32_t update_mask)
+{
+    load_eflags(t0, update_mask);
+}
+
+target_ulong helper_read_eflags(void)
+{
+    uint32_t eflags;
+    eflags = cc_table[CC_OP].compute_all();
+    eflags |= (DF & DF_MASK);
+    eflags |= env->eflags & ~(VM_MASK | RF_MASK);
+    return eflags;
+}
+
 /* return non zero if error */
 static inline int load_segment(uint32_t *e1_ptr, uint32_t *e2_ptr,
                                int selector)

Modified: trunk/target-i386/helper.h
===================================================================

target-i386/helper.h +2 -0
@@ -2,6 +2,8 @@
 
 void helper_lock(void);
 void helper_unlock(void);
+void helper_write_eflags(target_ulong t0, uint32_t update_mask);
+target_ulong helper_read_eflags(void);
 void helper_divb_AL(target_ulong t0);
 void helper_idivb_AL(target_ulong t0);
 void helper_divw_AX(target_ulong t0);

Modified: trunk/target-i386/op.c
===================================================================

target-i386/op.c +0 -135

138 lines not on this page · raw message

Modified: trunk/target-i386/translate.c
===================================================================

target-i386/translate.c +29 -13

97 lines not on this page · raw message