Reduce metaInfo initialization in fetchDecode

This commit is contained in:
Stanislav Shwartsman 2005-03-01 21:44:01 +00:00
parent 23e2895f8e
commit 709b218c10
3 changed files with 13 additions and 19 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: cpu.h,v 1.200 2005-02-28 18:56:03 sshwarts Exp $
// $Id: cpu.h,v 1.201 2005-03-01 21:44:00 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -780,10 +780,9 @@ public:
// code, when a strict 0 or 1 is not necessary.
BX_CPP_INLINE void initMetaInfo(unsigned seg,
unsigned os32, unsigned as32,
unsigned os64, unsigned as64,
unsigned extend8bit, unsigned repUsed) {
metaInfo = seg | (os32<<4) | (as32<<5) |
(os64<<6) | (as64<<7) | (extend8bit<<8) | (repUsed<<9);
unsigned os64, unsigned as64)
{
metaInfo = seg | (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.76 2005-02-16 21:26:51 sshwarts Exp $
// $Id: fetchdecode.cc,v 1.77 2005-03-01 21:44:00 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -1509,11 +1509,9 @@ BX_CPU_C::fetchDecode(Bit8u *iptr, bxInstruction_c *instruction,
BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].cache.u.segment.d_b;
instruction->ResolveModrm = NULL;
instruction->initMetaInfo(
BX_SEG_REG_NULL,
instruction->initMetaInfo(BX_SEG_REG_NULL,
/*os32*/ is_32, /*as32*/ is_32,
/*os64*/ 0, /*as64*/ 0,
/*extend8bit*/ 0, /*repUsed*/ 0);
/*os64*/ 0, /*as64*/ 0);
sse_prefix = SSE_PREFIX_NONE;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: fetchdecode64.cc,v 1.71 2005-02-16 21:27:01 sshwarts Exp $
// $Id: fetchdecode64.cc,v 1.72 2005-03-01 21:44:01 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -2097,14 +2097,11 @@ BX_CPU_C::fetchDecode64(Bit8u *iptr, bxInstruction_c *instruction,
rex_x = 0;
rex_b = 0;
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
/*extend8bit*/ 0,
/*repUsed*/ 0);
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
sse_prefix = SSE_PREFIX_NONE;