OLD | NEW |
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 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
716 __ cmp(R0, ShifterOperand(0)); | 716 __ cmp(R0, ShifterOperand(0)); |
717 __ sub(R0, R1, ShifterOperand(R0), LT); | 717 __ sub(R0, R1, ShifterOperand(R0), LT); |
718 __ add(R0, R1, ShifterOperand(R0), GE); | 718 __ add(R0, R1, ShifterOperand(R0), GE); |
719 __ SmiTag(R0); | 719 __ SmiTag(R0); |
720 __ Ret(); | 720 __ Ret(); |
721 | 721 |
722 __ Bind(&fall_through); | 722 __ Bind(&fall_through); |
723 } | 723 } |
724 | 724 |
725 | 725 |
726 void Intrinsifier::Integer_remainder(Assembler* assembler) { | |
727 // Check to see if we have integer division | |
728 Label fall_through; | |
729 TestBothArgumentsSmis(assembler, &fall_through); | |
730 // R1: Tagged left (dividend). | |
731 // R0: Tagged right (divisor). | |
732 // Check if modulo by zero -> exception thrown in main function. | |
733 __ cmp(R0, ShifterOperand(0)); | |
734 __ b(&fall_through, EQ); | |
735 EmitRemainderOperation(assembler); | |
736 // Untagged remainder result in R1. | |
737 __ mov(R0, ShifterOperand(R1, LSL, 1)); // Tag result and return. | |
738 __ Ret(); | |
739 | |
740 __ Bind(&fall_through); | |
741 } | |
742 | |
743 | |
744 void Intrinsifier::Integer_truncDivide(Assembler* assembler) { | 726 void Intrinsifier::Integer_truncDivide(Assembler* assembler) { |
745 // Check to see if we have integer division | 727 // Check to see if we have integer division |
746 Label fall_through; | 728 Label fall_through; |
747 | 729 |
748 TestBothArgumentsSmis(assembler, &fall_through); | 730 TestBothArgumentsSmis(assembler, &fall_through); |
749 __ cmp(R0, ShifterOperand(0)); | 731 __ cmp(R0, ShifterOperand(0)); |
750 __ b(&fall_through, EQ); // If b is 0, fall through. | 732 __ b(&fall_through, EQ); // If b is 0, fall through. |
751 | 733 |
752 __ SmiUntag(R0); | 734 __ SmiUntag(R0); |
753 __ SmiUntag(R1); | 735 __ SmiUntag(R1); |
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1729 | 1711 |
1730 | 1712 |
1731 void Intrinsifier::TwoByteString_equality(Assembler* assembler) { | 1713 void Intrinsifier::TwoByteString_equality(Assembler* assembler) { |
1732 StringEquality(assembler, kTwoByteStringCid); | 1714 StringEquality(assembler, kTwoByteStringCid); |
1733 } | 1715 } |
1734 | 1716 |
1735 | 1717 |
1736 } // namespace dart | 1718 } // namespace dart |
1737 | 1719 |
1738 #endif // defined TARGET_ARCH_ARM | 1720 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |