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

Side by Side Diff: runtime/vm/intrinsifier_mips.cc

Issue 59933004: In preparation of inlining remainder and modulo binary Smi operations: (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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 | « runtime/vm/intrinsifier_ia32.cc ('k') | runtime/vm/intrinsifier_x64.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_MIPS. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS.
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
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 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 __ delay_slot()->SmiTag(V0); 729 __ delay_slot()->SmiTag(V0);
730 730
731 __ Bind(&done); 731 __ Bind(&done);
732 __ Ret(); 732 __ Ret();
733 __ delay_slot()->SmiTag(V0); 733 __ delay_slot()->SmiTag(V0);
734 734
735 __ Bind(&fall_through); 735 __ Bind(&fall_through);
736 } 736 }
737 737
738 738
739 void Intrinsifier::Integer_remainder(Assembler* assembler) {
740 Label fall_through;
741
742 TestBothArgumentsSmis(assembler, &fall_through);
743 // T1: Tagged left (dividend).
744 // T0: Tagged right (divisor).
745 // Check if modulo by zero -> exception thrown in main function.
746 __ beq(T0, ZR, &fall_through);
747 EmitRemainderOperation(assembler);
748 // Untagged right in T0. Untagged remainder result in V0.
749
750 __ Ret();
751 __ delay_slot()->SmiTag(V0);
752
753 __ Bind(&fall_through);
754 }
755
756
757 void Intrinsifier::Integer_truncDivide(Assembler* assembler) { 739 void Intrinsifier::Integer_truncDivide(Assembler* assembler) {
758 Label fall_through; 740 Label fall_through;
759 741
760 TestBothArgumentsSmis(assembler, &fall_through); 742 TestBothArgumentsSmis(assembler, &fall_through);
761 __ beq(T0, ZR, &fall_through); // If b is 0, fall through. 743 __ beq(T0, ZR, &fall_through); // If b is 0, fall through.
762 744
763 __ SmiUntag(T0); 745 __ SmiUntag(T0);
764 __ SmiUntag(T1); 746 __ SmiUntag(T1);
765 __ div(T1, T0); // LO <- T1 / T0 747 __ div(T1, T0); // LO <- T1 / T0
766 __ mflo(V0); // V0 <- LO 748 __ mflo(V0); // V0 <- LO
(...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after
1801 } 1783 }
1802 1784
1803 1785
1804 void Intrinsifier::TwoByteString_equality(Assembler* assembler) { 1786 void Intrinsifier::TwoByteString_equality(Assembler* assembler) {
1805 StringEquality(assembler, kTwoByteStringCid); 1787 StringEquality(assembler, kTwoByteStringCid);
1806 } 1788 }
1807 1789
1808 } // namespace dart 1790 } // namespace dart
1809 1791
1810 #endif // defined TARGET_ARCH_MIPS 1792 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier_ia32.cc ('k') | runtime/vm/intrinsifier_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698