small fetchdecode optimization

This commit is contained in:
Stanislav Shwartsman 2010-09-07 19:54:50 +00:00
parent c7dba3525a
commit 1107ce138e
4 changed files with 11 additions and 37 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: cpu.h,v 1.683 2010-07-22 20:19:00 sshwarts Exp $
// $Id: cpu.h,v 1.684 2010-09-07 19:54:49 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001-2010 The Bochs Project
@ -3835,13 +3835,13 @@ enum {
#define BxImmediate_IdIw 0x0008 // call_Ap, not encodable in 64-bit mode
#define BxImmediate_Id 0x0009 // 32 bit
#define BxImmediate_O 0x000A // MOV_ALOd, mov_OdAL, mov_eAXOv, mov_OveAX
#define BxImmediate_BrOff8 0x000B // Relative branch offset byte
#if BX_SUPPORT_X86_64
#define BxImmediate_Iq 0x000C // 64 bit override
#define BxImmediate_Iq 0x000B // 64 bit override
#endif
#define BxImmediate_BrOff16 BxImmediate_Iw // Relative branch offset word, not encodable in 64-bit mode
#define BxImmediate_BrOff32 BxImmediate_Id // Relative branch offset dword
#define BxImmediate_BrOff8 BxImmediate_Ib_SE // Relative branch offset byte
#define BxImmediate_BrOff16 BxImmediate_Iw // Relative branch offset word, not encodable in 64-bit mode
#define BxImmediate_BrOff32 BxImmediate_Id // Relative branch offset dword
// Lookup for opcode and attributes in another opcode tables
// Totally 15 opcode groups supported

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: fetchdecode.cc,v 1.275 2010-07-22 20:12:25 sshwarts Exp $
// $Id: fetchdecode.cc,v 1.276 2010-09-07 19:54:49 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001-2010 The Bochs Project
@ -2696,11 +2696,7 @@ modrm_done:
break;
case BxImmediate_Ib_SE: // Sign extend to OS size
if (remain != 0) {
Bit8s temp8s = *iptr;
if (i->os32L())
i->modRMForm.Id = (Bit32s) temp8s;
else
i->modRMForm.Iw = (Bit16s) temp8s;
i->modRMForm.Id = (Bit8s) (*iptr);
remain--;
}
else {
@ -2725,15 +2721,6 @@ modrm_done:
return(-1);
}
break;
case BxImmediate_BrOff8:
if (remain != 0) {
i->modRMForm.Id = (Bit8s) (*iptr);
remain--;
}
else {
return(-1);
}
break;
case BxImmediate_IwIb:
if (remain > 1) {
i->IxIxForm.Iw = FetchWORD(iptr);

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: fetchdecode64.cc,v 1.271 2010-07-22 20:12:25 sshwarts Exp $
// $Id: fetchdecode64.cc,v 1.272 2010-09-07 19:54:50 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001-2010 The Bochs Project
@ -3636,11 +3636,7 @@ modrm_done:
break;
case BxImmediate_Ib_SE: // Sign extend to OS size
if (remain != 0) {
Bit8s temp8s = *iptr;
if (i->os32L())
i->modRMForm.Id = (Bit32s) temp8s;
else
i->modRMForm.Iw = (Bit16s) temp8s;
i->modRMForm.Id = (Bit8s) (*iptr);
remain--;
}
else {
@ -3674,15 +3670,6 @@ modrm_done:
return(-1);
}
break;
case BxImmediate_BrOff8:
if (remain != 0) {
i->modRMForm.Id = (Bit8s) (*iptr);
remain--;
}
else {
return(-1);
}
break;
case BxImmediate_IwIb:
if (remain > 2) {
i->IxIxForm.Iw = FetchWORD(iptr);

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: proc_ctrl.cc,v 1.336 2010-07-22 20:12:25 sshwarts Exp $
// $Id: proc_ctrl.cc,v 1.337 2010-09-07 19:54:50 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001-2010 The Bochs Project
@ -878,7 +878,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SYSENTER(bxInstruction_c *i)
updateFetchModeMask(/* CS reloaded */);
#endif
#if BX_CPU_LEVEL >= 4 && BX_SUPPORT_ALIGNMENT_CHECK
#if BX_SUPPORT_ALIGNMENT_CHECK
BX_CPU_THIS_PTR alignment_check_mask = 0; // CPL=0
#endif