mirror of https://github.com/stella-emu/stella.git
another small unsafe optimization
This commit is contained in:
parent
d716f42b5c
commit
a251ccf3d6
|
@ -1688,7 +1688,11 @@ int Thumbulator::execute()
|
|||
rb = (inst >> 6) & 0x1F;
|
||||
DO_DISS(statusMsg << "ldrb r" << dec << rd << ",[r" << dec << rn << ",#0x" << Base::HEX2 << rb << "]" << endl);
|
||||
rb = read_register(rn) + rb;
|
||||
#ifndef UNSAFE_OPTIMIZATIONS
|
||||
rc = read16(rb & (~1u));
|
||||
#else
|
||||
rc = read16(rb);
|
||||
#endif
|
||||
if(rb & 1)
|
||||
{
|
||||
rc >>= 8;
|
||||
|
@ -1707,14 +1711,15 @@ int Thumbulator::execute()
|
|||
rm = (inst >> 6) & 0x7;
|
||||
DO_DISS(statusMsg << "ldrb r" << dec << rd << ",[r" << dec << rn << ",r" << dec << rm << "]" << endl);
|
||||
rb = read_register(rn) + read_register(rm);
|
||||
#ifndef UNSAFE_OPTIMIZATIONS
|
||||
rc = read16(rb & (~1u));
|
||||
#else
|
||||
rc = read16(rb);
|
||||
#endif
|
||||
if(rb & 1)
|
||||
{
|
||||
rc >>= 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
write_register(rd, rc & 0xFF);
|
||||
return 0;
|
||||
}
|
||||
|
@ -1751,14 +1756,15 @@ int Thumbulator::execute()
|
|||
rm = (inst >> 6) & 0x7;
|
||||
DO_DISS(statusMsg << "ldrsb r" << dec << rd << ",[r" << dec << rn << ",r" << dec << rm << "]" << endl);
|
||||
rb = read_register(rn) + read_register(rm);
|
||||
#ifndef UNSAFE_OPTIMIZATIONS
|
||||
rc = read16(rb & (~1u));
|
||||
#else
|
||||
rc = read16(rb);
|
||||
#endif
|
||||
if(rb & 1)
|
||||
{
|
||||
rc >>= 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
rc &= 0xFF;
|
||||
if(rc & 0x80)
|
||||
rc |= ((~0u) << 8);
|
||||
|
@ -2275,7 +2281,11 @@ int Thumbulator::execute()
|
|||
DO_DISS(statusMsg << "strb r" << dec << rd << ",[r" << dec << rn << ",#0x" << Base::HEX8 << rb << "]" << endl);
|
||||
rb = read_register(rn) + rb;
|
||||
rc = read_register(rd);
|
||||
#ifndef UNSAFE_OPTIMIZATIONS
|
||||
ra = read16(rb & (~1u));
|
||||
#else
|
||||
ra = read16(rb);
|
||||
#endif
|
||||
if(rb & 1)
|
||||
{
|
||||
ra &= 0x00FF;
|
||||
|
@ -2298,7 +2308,11 @@ int Thumbulator::execute()
|
|||
DO_DISS(statusMsg << "strb r" << dec << rd << ",[r" << dec << rn << ",r" << rm << "]" << endl);
|
||||
rb = read_register(rn) + read_register(rm);
|
||||
rc = read_register(rd);
|
||||
#ifndef UNSAFE_OPTIMIZATIONS
|
||||
ra = read16(rb & (~1u));
|
||||
#else
|
||||
ra = read16(rb);
|
||||
#endif
|
||||
if(rb & 1)
|
||||
{
|
||||
ra &= 0x00FF;
|
||||
|
|
Loading…
Reference in New Issue