mirror of https://github.com/PCSX2/pcsx2.git
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:
parent
87412c8d5d
commit
4d8769ecc5
|
@ -70,10 +70,27 @@ int BaseBlocks::LastIndex(u32 startpc) const
|
||||||
return imin;
|
return imin;
|
||||||
}
|
}
|
||||||
|
|
||||||
BASEBLOCKEX* BaseBlocks::GetByX86(uptr ip) const
|
BASEBLOCKEX* BaseBlocks::GetByX86(uptr ip)
|
||||||
{
|
{
|
||||||
// TODO
|
if (0 == blocks.size())
|
||||||
return 0;
|
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)
|
void BaseBlocks::Link(u32 pc, uptr jumpptr)
|
||||||
|
|
|
@ -73,7 +73,7 @@ public:
|
||||||
|
|
||||||
BASEBLOCKEX* New(u32 startpc, uptr fnptr);
|
BASEBLOCKEX* New(u32 startpc, uptr fnptr);
|
||||||
int LastIndex (u32 startpc) const;
|
int LastIndex (u32 startpc) const;
|
||||||
BASEBLOCKEX* GetByX86(uptr ip) const;
|
BASEBLOCKEX* GetByX86(uptr ip);
|
||||||
|
|
||||||
inline int Index (u32 startpc) const
|
inline int Index (u32 startpc) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -2356,7 +2356,7 @@ emitterT void eAND32RmtoR( x86IntRegType to, x86IntRegType from )
|
||||||
emitterT void eAND32RmtoROffset( x86IntRegType to, x86IntRegType from, int offset )
|
emitterT void eAND32RmtoROffset( x86IntRegType to, x86IntRegType from, int offset )
|
||||||
{
|
{
|
||||||
RexRB(0,to,from);
|
RexRB(0,to,from);
|
||||||
write16<I>( 0x23 );
|
write8<I>( 0x23 );
|
||||||
WriteRmOffsetFrom<I>(to,from,offset);
|
WriteRmOffsetFrom<I>(to,from,offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue