small simplification for fetchdecode

This commit is contained in:
Stanislav Shwartsman 2007-11-11 20:56:22 +00:00
parent 9dc471bbe5
commit eea5023da8
3 changed files with 11 additions and 14 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: cpu.h,v 1.350 2007-11-11 20:44:07 sshwarts Exp $
// $Id: cpu.h,v 1.351 2007-11-11 20:56:22 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -757,11 +757,10 @@ public:
// is for Logical comparisons, eg if (i->os32L() && i->as32L()). If you
// want a bx_bool value, use os32B() etc. This makes for smaller
// code, when a strict 0 or 1 is not necessary.
BX_CPP_INLINE void initMetaInfo(unsigned seg,
unsigned os32, unsigned as32,
BX_CPP_INLINE void initMetaInfo(unsigned os32, unsigned as32,
unsigned os64, unsigned as64)
{
metaInfo = seg | (os32<<4) | (as32<<5) | (os64<<6) | (as64<<7);
metaInfo = BX_SEG_REG_NULL | (os32<<4) | (as32<<5) | (os64<<6) | (as64<<7);
}
BX_CPP_INLINE unsigned seg(void) {
return metaInfo & 7;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: fetchdecode.cc,v 1.115 2007-11-08 18:21:37 sshwarts Exp $
// $Id: fetchdecode.cc,v 1.116 2007-11-11 20:56:22 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -1550,9 +1550,8 @@ BX_CPU_C::fetchDecode32(Bit8u *iptr, bxInstruction_c *instruction, unsigned rema
BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].cache.u.segment.d_b;
instruction->ResolveModrm = NULL;
instruction->initMetaInfo(BX_SEG_REG_NULL,
/*os32*/ is_32, /*as32*/ is_32,
/*os64*/ 0, /*as64*/ 0);
instruction->initMetaInfo(/*os32*/ is_32, /*as32*/ is_32,
/*os64*/ 0, /*as64*/ 0);
offset = os_32 << 9; // * 512

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: fetchdecode64.cc,v 1.120 2007-11-08 18:21:37 sshwarts Exp $
// $Id: fetchdecode64.cc,v 1.121 2007-11-11 20:56:22 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -2163,11 +2163,10 @@ BX_CPU_C::fetchDecode64(Bit8u *iptr, bxInstruction_c *instruction, unsigned rema
offset = 512*1;
instruction->ResolveModrm = NULL;
instruction->initMetaInfo(BX_SEG_REG_NULL,
/*os32*/ 1, // operand size 32 override defaults to 1
/*as32*/ 1, // address size 32 override defaults to 1
/*os64*/ 0, // operand size 64 override defaults to 0
/*as64*/ 1); // address size 64 override defaults to 1
instruction->initMetaInfo(/*os32*/ 1, // operand size 32 override defaults to 1
/*as32*/ 1, // address size 32 override defaults to 1
/*os64*/ 0, // operand size 64 override defaults to 0
/*as64*/ 1); // address size 64 override defaults to 1
fetch_b1:
b1 = *iptr++;