Chromium Code Reviews| Index: runtime/vm/assembler_arm.cc |
| =================================================================== |
| --- runtime/vm/assembler_arm.cc (revision 36182) |
| +++ runtime/vm/assembler_arm.cc (working copy) |
| @@ -2228,14 +2228,6 @@ |
| } |
| -void Assembler::BranchLinkStore(const ExternalLabel* label, Address ad) { |
| - // TODO(regis): Revisit this code sequence. |
| - LoadImmediate(IP, label->address()); // Target address is never patched. |
| - str(PC, ad); |
| - blx(IP); // Use blx instruction so that the return branch prediction works. |
| -} |
| - |
| - |
| void Assembler::BranchLinkOffset(Register base, int32_t offset) { |
| ASSERT(base != PC); |
| ASSERT(base != IP); |
| @@ -2305,7 +2297,6 @@ |
| double value, |
| Register scratch, |
| Condition cond) { |
| - // TODO(regis): Revisit this code sequence. |
| ASSERT(scratch != PC); |
| ASSERT(scratch != IP); |
| if (!vmovd(dd, value, cond)) { |
| @@ -2510,6 +2501,7 @@ |
| if (ShifterOperand::CanHold(value, &shifter_op)) { |
|
zra
2014/05/14 19:40:55
Maybe add a comment that value == kMinInt32 will b
regis
2014/05/14 19:54:53
Done.
|
| adds(rd, rn, shifter_op, cond); |
| } else if (ShifterOperand::CanHold(-value, &shifter_op)) { |
| + ASSERT(value != kMinInt32); // Would cause erroneous overflow detection. |
| subs(rd, rn, shifter_op, cond); |
| } else { |
| ASSERT(rn != IP); |
| @@ -2517,6 +2509,7 @@ |
| mvn(IP, shifter_op, cond); |
| adds(rd, rn, ShifterOperand(IP), cond); |
| } else if (ShifterOperand::CanHold(~(-value), &shifter_op)) { |
| + ASSERT(value != kMinInt32); // Would cause erroneous overflow detection. |
| mvn(IP, shifter_op, cond); |
| subs(rd, rn, ShifterOperand(IP), cond); |
| } else { |
| @@ -2527,24 +2520,26 @@ |
| } |
| -void Assembler::AddImmediateWithCarry(Register rd, Register rn, int32_t value, |
| - Condition cond) { |
| +void Assembler::SubImmediateSetFlags(Register rd, Register rn, int32_t value, |
| + Condition cond) { |
| ShifterOperand shifter_op; |
| if (ShifterOperand::CanHold(value, &shifter_op)) { |
|
zra
2014/05/14 19:40:55
ditto
regis
2014/05/14 19:54:53
Done.
|
| - adc(rd, rn, shifter_op, cond); |
| - } else if (ShifterOperand::CanHold(-value - 1, &shifter_op)) { |
| - sbc(rd, rn, shifter_op, cond); |
| + subs(rd, rn, shifter_op, cond); |
| + } else if (ShifterOperand::CanHold(-value, &shifter_op)) { |
| + ASSERT(value != kMinInt32); // Would cause erroneous overflow detection. |
| + adds(rd, rn, shifter_op, cond); |
| } else { |
| ASSERT(rn != IP); |
| if (ShifterOperand::CanHold(~value, &shifter_op)) { |
| mvn(IP, shifter_op, cond); |
| - adc(rd, rn, ShifterOperand(IP), cond); |
| - } else if (ShifterOperand::CanHold(~(-value - 1), &shifter_op)) { |
| + subs(rd, rn, ShifterOperand(IP), cond); |
| + } else if (ShifterOperand::CanHold(~(-value), &shifter_op)) { |
| + ASSERT(value != kMinInt32); // Would cause erroneous overflow detection. |
| mvn(IP, shifter_op, cond); |
| - sbc(rd, rn, ShifterOperand(IP), cond); |
| + adds(rd, rn, ShifterOperand(IP), cond); |
| } else { |
| LoadDecodableImmediate(IP, value, cond); |
| - adc(rd, rn, ShifterOperand(IP), cond); |
| + subs(rd, rn, ShifterOperand(IP), cond); |
| } |
| } |
| } |