Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2286)

Unified Diff: runtime/vm/intrinsifier_arm.cc

Issue 17847006: Fixes integer negate intrinsic for arm and mips. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/intrinsifier_mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intrinsifier_arm.cc
===================================================================
--- runtime/vm/intrinsifier_arm.cc (revision 24478)
+++ runtime/vm/intrinsifier_arm.cc (working copy)
@@ -788,11 +788,14 @@
bool Intrinsifier::Integer_negate(Assembler* assembler) {
+ Label fall_through;
__ ldr(R0, Address(SP, + 0 * kWordSize)); // Grab first argument.
__ tst(R0, ShifterOperand(kSmiTagMask)); // Test for Smi.
- __ rsb(R0, R0, ShifterOperand(0), EQ); // R0 is a Smi. R0 <- 0 - R0.
- __ bx(LR, EQ); // Return.
+ __ b(&fall_through, NE);
+ __ rsbs(R0, R0, ShifterOperand(0)); // R0 is a Smi. R0 <- 0 - R0.
+ __ bx(LR, VC); // Return if there wasn't overflow, fall through otherwise.
// R0 is not a Smi. Fall through.
+ __ Bind(&fall_through);
return false;
}
« no previous file with comments | « no previous file | runtime/vm/intrinsifier_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698