Skip to content

Commit

Permalink
armjit: Fix ANDI2R() clearing low bits incorrectly.
Browse files Browse the repository at this point in the history
  • Loading branch information
unknownbrackets committed Nov 12, 2013
1 parent d50b01a commit 1a98691
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Common/ArmEmitter.cpp
Expand Up @@ -189,7 +189,7 @@ void ARMXEmitter::ANDI2R(ARMReg rd, ARMReg rs, u32 val, ARMReg scratch)
} else {
int ops = 0;
for (int i = 0; i < 32; i += 2) {
u8 bits = (val >> i) & 0xFF;
u8 bits = RotR(val, i) & 0xFF;
// If either low bit is not set, we need to use a BIC for them.
if ((bits & 3) != 3) {
++ops;
Expand All @@ -201,7 +201,7 @@ void ARMXEmitter::ANDI2R(ARMReg rd, ARMReg rs, u32 val, ARMReg scratch)
if (ops <= 3 || !cpu_info.bArmV7) {
bool first = true;
for (int i = 0; i < 32; i += 2) {
u8 bits = (val >> i) & 0xFF;
u8 bits = RotR(val, i) & 0xFF;
if ((bits & 3) != 3) {
u8 rotation = i == 0 ? 0 : 16 - i / 2;
if (first) {
Expand Down Expand Up @@ -255,7 +255,7 @@ void ARMXEmitter::ORI2R(ARMReg rd, ARMReg rs, u32 val, ARMReg scratch)
} else {
int ops = 0;
for (int i = 0; i < 32; i += 2) {
u8 bits = (val >> i) & 0xFF;
u8 bits = RotR(val, i) & 0xFF;
// If either low bit is set, we need to use a ORR for them.
if ((bits & 3) != 0) {
++ops;
Expand All @@ -271,7 +271,7 @@ void ARMXEmitter::ORI2R(ARMReg rd, ARMReg rs, u32 val, ARMReg scratch)
} else if (ops <= 3 || !cpu_info.bArmV7) {
bool first = true;
for (int i = 0; i < 32; i += 2) {
u8 bits = (val >> i) & 0xFF;
u8 bits = RotR(val, i) & 0xFF;
if ((bits & 3) != 0) {
u8 rotation = i == 0 ? 0 : 16 - i / 2;
if (first) {
Expand Down

0 comments on commit 1a98691

Please sign in to comment.