Implemented another block lookup method.

Fixed an unused instruction in the emitter.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@913 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
sudonim1 2009-04-05 14:19:13 +00:00
parent 87412c8d5d
commit 4d8769ecc5
3 changed files with 22 additions and 5 deletions

View File

@ -70,10 +70,27 @@ int BaseBlocks::LastIndex(u32 startpc) const
return imin;
}
BASEBLOCKEX* BaseBlocks::GetByX86(uptr ip) const
BASEBLOCKEX* BaseBlocks::GetByX86(uptr ip)
{
// TODO
if (0 == blocks.size())
return 0;
int imin = 0, imax = blocks.size() - 1, imid;
while(imin != imax) {
imid = (imin+imax+1)>>1;
if (blocks[imid].fnptr > ip)
imax = imid - 1;
else
imin = imid;
}
if (ip < blocks[imin].fnptr ||
ip >= blocks[imin].fnptr + blocks[imin].x86size)
return 0;
return &blocks[imin];
}
void BaseBlocks::Link(u32 pc, uptr jumpptr)

View File

@ -73,7 +73,7 @@ public:
BASEBLOCKEX* New(u32 startpc, uptr fnptr);
int LastIndex (u32 startpc) const;
BASEBLOCKEX* GetByX86(uptr ip) const;
BASEBLOCKEX* GetByX86(uptr ip);
inline int Index (u32 startpc) const
{

View File

@ -2356,7 +2356,7 @@ emitterT void eAND32RmtoR( x86IntRegType to, x86IntRegType from )
emitterT void eAND32RmtoROffset( x86IntRegType to, x86IntRegType from, int offset )
{
RexRB(0,to,from);
write16<I>( 0x23 );
write8<I>( 0x23 );
WriteRmOffsetFrom<I>(to,from,offset);
}