Assembler fix
Unlike pc-relative loads and branches, arithmetic operations using
the program counter do not implicitly word-align pc+4, but rather use
(current pc + 4) without alignment as the source.
Change-Id: If9a7eee8614c04f513fa5593fe9d58dd429f9023
diff --git a/src/compiler/codegen/arm/Assemble.cc b/src/compiler/codegen/arm/Assemble.cc
index 475f096..62706a7 100644
--- a/src/compiler/codegen/arm/Assemble.cc
+++ b/src/compiler/codegen/arm/Assemble.cc
@@ -1295,13 +1295,13 @@
ArmLIR *addPCInst = (ArmLIR*)lir->operands[2];
SwitchTable *tabRec = (SwitchTable*)lir->operands[3];
lir->operands[1] = (tabRec->offset -
- ((addPCInst->generic.offset + 4) & ~3)) & 0xffff;
+ (addPCInst->generic.offset + 4)) & 0xffff;
} else if (lir->opcode == kThumb2MovImm16HST) {
// operands[1] should hold disp, [2] has add, [3] has tabRec
ArmLIR *addPCInst = (ArmLIR*)lir->operands[2];
SwitchTable *tabRec = (SwitchTable*)lir->operands[3];
lir->operands[1] = ((tabRec->offset -
- ((addPCInst->generic.offset + 4) & ~3)) >> 16) & 0xffff;
+ (addPCInst->generic.offset + 4)) >> 16) & 0xffff;
}
ArmEncodingMap *encoder = &EncodingMap[lir->opcode];
u4 bits = encoder->skeleton;