Commit 07be379fb1d4d919384001a6732e1fa81b2212a2

Authored by bellard
1 parent 9d0763c4

converted INTO/CMPXCHG8B to TCG

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4510 c046a42c-6fe2-441c-8c8c-71466251a162
target-i386/helper.c
@@ -1849,6 +1849,15 @@ void helper_das(void) @@ -1849,6 +1849,15 @@ void helper_das(void)
1849 FORCE_RET(); 1849 FORCE_RET();
1850 } 1850 }
1851 1851
  1852 +void helper_into(int next_eip_addend)
  1853 +{
  1854 + int eflags;
  1855 + eflags = cc_table[CC_OP].compute_all();
  1856 + if (eflags & CC_O) {
  1857 + raise_interrupt(EXCP04_INTO, 1, 0, next_eip_addend);
  1858 + }
  1859 +}
  1860 +
1852 void helper_cmpxchg8b(target_ulong a0) 1861 void helper_cmpxchg8b(target_ulong a0)
1853 { 1862 {
1854 uint64_t d; 1863 uint64_t d;
target-i386/helper.h
@@ -71,6 +71,7 @@ void helper_reset_inhibit_irq(void); @@ -71,6 +71,7 @@ void helper_reset_inhibit_irq(void);
71 void helper_boundw(target_ulong a0, int v); 71 void helper_boundw(target_ulong a0, int v);
72 void helper_boundl(target_ulong a0, int v); 72 void helper_boundl(target_ulong a0, int v);
73 void helper_rsm(void); 73 void helper_rsm(void);
  74 +void helper_into(int next_eip_addend);
74 void helper_cmpxchg8b(target_ulong a0); 75 void helper_cmpxchg8b(target_ulong a0);
75 void helper_single_step(void); 76 void helper_single_step(void);
76 void helper_cpuid(void); 77 void helper_cpuid(void);
target-i386/op.c
@@ -123,24 +123,6 @@ @@ -123,24 +123,6 @@
123 123
124 #endif 124 #endif
125 125
126 -/* constant load & misc op */  
127 -  
128 -/* XXX: consistent names */  
129 -void OPPROTO op_into(void)  
130 -{  
131 - int eflags;  
132 - eflags = cc_table[CC_OP].compute_all();  
133 - if (eflags & CC_O) {  
134 - raise_interrupt(EXCP04_INTO, 1, 0, PARAM1);  
135 - }  
136 - FORCE_RET();  
137 -}  
138 -  
139 -void OPPROTO op_cmpxchg8b(void)  
140 -{  
141 - helper_cmpxchg8b(A0);  
142 -}  
143 -  
144 /* multiple size ops */ 126 /* multiple size ops */
145 127
146 #define ldul ldl 128 #define ldul ldl
target-i386/translate.c
@@ -4308,7 +4308,7 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start) @@ -4308,7 +4308,7 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
4308 if (s->cc_op != CC_OP_DYNAMIC) 4308 if (s->cc_op != CC_OP_DYNAMIC)
4309 gen_op_set_cc_op(s->cc_op); 4309 gen_op_set_cc_op(s->cc_op);
4310 gen_lea_modrm(s, modrm, &reg_addr, &offset_addr); 4310 gen_lea_modrm(s, modrm, &reg_addr, &offset_addr);
4311 - gen_op_cmpxchg8b(); 4311 + tcg_gen_helper_0_1(helper_cmpxchg8b, cpu_A0);
4312 s->cc_op = CC_OP_EFLAGS; 4312 s->cc_op = CC_OP_EFLAGS;
4313 break; 4313 break;
4314 4314
@@ -6016,7 +6016,7 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start) @@ -6016,7 +6016,7 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
6016 if (s->cc_op != CC_OP_DYNAMIC) 6016 if (s->cc_op != CC_OP_DYNAMIC)
6017 gen_op_set_cc_op(s->cc_op); 6017 gen_op_set_cc_op(s->cc_op);
6018 gen_jmp_im(pc_start - s->cs_base); 6018 gen_jmp_im(pc_start - s->cs_base);
6019 - gen_op_into(s->pc - pc_start); 6019 + tcg_gen_helper_0_1(helper_into, tcg_const_i32(s->pc - pc_start));
6020 break; 6020 break;
6021 case 0xf1: /* icebp (undocumented, exits to external debugger) */ 6021 case 0xf1: /* icebp (undocumented, exits to external debugger) */
6022 if (gen_svm_check_intercept(s, pc_start, SVM_EXIT_ICEBP)) 6022 if (gen_svm_check_intercept(s, pc_start, SVM_EXIT_ICEBP))