bugfix for x86-64 mode

This commit is contained in:
Stanislav Shwartsman 2010-11-23 15:42:26 +00:00
parent 9aa503cb9d
commit 4a8d69caf6
3 changed files with 14 additions and 20 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: i387.h,v 1.41 2010-09-26 20:35:24 sshwarts Exp $
// $Id: i387.h,v 1.42 2010-11-23 15:42:26 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2004-2009 Stanislav Shwartsman
@ -29,7 +29,7 @@
#include "fpu/softfloat.h"
#define BX_FPU_REG(index) \
(BX_CPU_THIS_PTR the_i387.st_space[index])
(BX_CPU_THIS_PTR the_i387.st_space[index & 0x7])
#if defined(NEED_CPU_REG_SHORTCUTS)
#define FPU_PARTIAL_STATUS (BX_CPU_THIS_PTR the_i387.swd)

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: dis_groups.cc,v 1.54 2010-11-23 14:59:36 sshwarts Exp $
// $Id: dis_groups.cc,v 1.55 2010-11-23 15:42:26 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2005-2009 Stanislav Shwartsman
@ -330,9 +330,9 @@ void disassembler::ST0(const x86_insn *insn)
void disassembler::STi(const x86_insn *insn)
{
if (intel_mode)
dis_sprintf ("st(%d)", insn->rm);
dis_sprintf ("st(%d)", insn->rm & 7);
else
dis_sprintf("%%st(%d)", insn->rm);
dis_sprintf("%%st(%d)", insn->rm & 7);
}
// 16-bit general purpose register
@ -363,17 +363,17 @@ void disassembler::Ry(const x86_insn *insn)
void disassembler::Pq(const x86_insn *insn)
{
if (intel_mode)
dis_sprintf ("mm%d", insn->nnn);
dis_sprintf ("mm%d", insn->nnn & 0x7);
else
dis_sprintf("%%mm%d", insn->nnn);
dis_sprintf("%%mm%d", insn->nnn & 0x7);
}
void disassembler::Nq(const x86_insn *insn)
{
if (intel_mode)
dis_sprintf ("mm%d", insn->rm);
dis_sprintf ("mm%d", insn->rm & 0x7);
else
dis_sprintf("%%mm%d", insn->rm);
dis_sprintf("%%mm%d", insn->rm & 0x7);
}
void disassembler::Qd(const x86_insn *insn)
@ -381,9 +381,9 @@ void disassembler::Qd(const x86_insn *insn)
if (insn->mod == 3)
{
if (intel_mode)
dis_sprintf ("mm%d", insn->rm);
dis_sprintf ("mm%d", insn->rm & 0x7);
else
dis_sprintf("%%mm%d", insn->rm);
dis_sprintf("%%mm%d", insn->rm & 0x7);
}
else
(this->*resolve_modrm)(insn, D_SIZE);
@ -394,9 +394,9 @@ void disassembler::Qq(const x86_insn *insn)
if (insn->mod == 3)
{
if (intel_mode)
dis_sprintf ("mm%d", insn->rm);
dis_sprintf ("mm%d", insn->rm & 0x7);
else
dis_sprintf("%%mm%d", insn->rm);
dis_sprintf("%%mm%d", insn->rm & 0x7);
}
else
(this->*resolve_modrm)(insn, Q_SIZE);

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: fpu.cc,v 1.65 2010-11-11 15:48:56 sshwarts Exp $
// $Id: fpu.cc,v 1.66 2010-11-23 15:42:26 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2003-2009 Stanislav Shwartsman
@ -51,12 +51,6 @@ void BX_CPU_C::FPU_update_last_instruction(bxInstruction_c *i)
BX_CPU_THIS_PTR the_i387.fds = BX_CPU_THIS_PTR sregs[i->seg()].selector.value;
BX_CPU_THIS_PTR the_i387.fdp = RMAddr(i);
}
#if BX_SUPPORT_X86_64
else {
// it is possible that rm() register was extended by REX prefix
i->setRm(i->rm() & 7);
}
#endif
}
void BX_CPU_C::FPU_check_pending_exceptions(void)