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

Side by Side 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, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/intrinsifier_mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/intrinsifier.h" 8 #include "vm/intrinsifier.h"
9 9
10 #include "vm/assembler.h" 10 #include "vm/assembler.h"
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 // cannot tag the result. 781 // cannot tag the result.
782 __ CompareImmediate(R0, 0x40000000); 782 __ CompareImmediate(R0, 0x40000000);
783 __ SmiTag(R0, NE); // Not equal. Okay to tag and return. 783 __ SmiTag(R0, NE); // Not equal. Okay to tag and return.
784 __ bx(LR, NE); // Return. 784 __ bx(LR, NE); // Return.
785 __ Bind(&fall_through); 785 __ Bind(&fall_through);
786 return false; 786 return false;
787 } 787 }
788 788
789 789
790 bool Intrinsifier::Integer_negate(Assembler* assembler) { 790 bool Intrinsifier::Integer_negate(Assembler* assembler) {
791 Label fall_through;
791 __ ldr(R0, Address(SP, + 0 * kWordSize)); // Grab first argument. 792 __ ldr(R0, Address(SP, + 0 * kWordSize)); // Grab first argument.
792 __ tst(R0, ShifterOperand(kSmiTagMask)); // Test for Smi. 793 __ tst(R0, ShifterOperand(kSmiTagMask)); // Test for Smi.
793 __ rsb(R0, R0, ShifterOperand(0), EQ); // R0 is a Smi. R0 <- 0 - R0. 794 __ b(&fall_through, NE);
794 __ bx(LR, EQ); // Return. 795 __ rsbs(R0, R0, ShifterOperand(0)); // R0 is a Smi. R0 <- 0 - R0.
796 __ bx(LR, VC); // Return if there wasn't overflow, fall through otherwise.
795 // R0 is not a Smi. Fall through. 797 // R0 is not a Smi. Fall through.
798 __ Bind(&fall_through);
796 return false; 799 return false;
797 } 800 }
798 801
799 802
800 bool Intrinsifier::Integer_bitAndFromInteger(Assembler* assembler) { 803 bool Intrinsifier::Integer_bitAndFromInteger(Assembler* assembler) {
801 Label fall_through; 804 Label fall_through;
802 805
803 TestBothArgumentsSmis(assembler, &fall_through); // checks two smis 806 TestBothArgumentsSmis(assembler, &fall_through); // checks two smis
804 __ and_(R0, R0, ShifterOperand(R1)); 807 __ and_(R0, R0, ShifterOperand(R1));
805 808
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
1687 __ Bind(&ok); 1690 __ Bind(&ok);
1688 __ Ret(); 1691 __ Ret();
1689 1692
1690 __ Bind(&fall_through); 1693 __ Bind(&fall_through);
1691 return false; 1694 return false;
1692 } 1695 }
1693 1696
1694 } // namespace dart 1697 } // namespace dart
1695 1698
1696 #endif // defined TARGET_ARCH_ARM 1699 #endif // defined TARGET_ARCH_ARM
OLDNEW
« 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