mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 13:30:02 +00:00
Avoid any possible shifts by 32.
This commit is contained in:
parent
cd842ac21f
commit
9262ddfc13
@ -533,7 +533,7 @@ namespace MIPSComp
|
||||
|
||||
int pos = _POS;
|
||||
int size = _SIZE + 1;
|
||||
u32 mask = (1 << size) - 1;
|
||||
u32 mask = 0xFFFFFFFFUL >> (32 - size);
|
||||
|
||||
// Don't change $zr.
|
||||
if (rt == 0)
|
||||
|
@ -431,8 +431,7 @@ void Arm64Jit::Comp_Special3(MIPSOpcode op) {
|
||||
|
||||
int pos = _POS;
|
||||
int size = _SIZE + 1;
|
||||
// Workaround for a compiler bug.
|
||||
u32 mask = size == 32 ? 0xFFFFFFFF : (1 << size) - 1;
|
||||
u32 mask = 0xFFFFFFFFUL >> (32 - size);
|
||||
|
||||
// Don't change $zr.
|
||||
if (rt == 0)
|
||||
|
@ -866,14 +866,15 @@ namespace MIPSInt
|
||||
case 0x0: //ext
|
||||
{
|
||||
int size = _SIZE + 1;
|
||||
R(rt) = (R(rs) >> pos) & ((1<<size) - 1);
|
||||
u32 sourcemask = 0xFFFFFFFFUL >> (32 - size);
|
||||
R(rt) = (R(rs) >> pos) & sourcemask;
|
||||
}
|
||||
break;
|
||||
case 0x4: //ins
|
||||
{
|
||||
int size = (_SIZE + 1) - pos;
|
||||
int sourcemask = (1 << size) - 1;
|
||||
int destmask = sourcemask << pos;
|
||||
u32 sourcemask = 0xFFFFFFFFUL >> (32 - size);
|
||||
u32 destmask = sourcemask << pos;
|
||||
R(rt) = (R(rt) & ~destmask) | ((R(rs)&sourcemask) << pos);
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user