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

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

Issue 2005723004: Fraction class prototype and test (not to be committed). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: work in progress Created 4 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
« 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 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 __ LoadObject(V0, Bool::True()); 696 __ LoadObject(V0, Bool::True());
697 __ Ret(); 697 __ Ret();
698 698
699 // At least one of the arguments was not Smi. 699 // At least one of the arguments was not Smi.
700 Label receiver_not_smi; 700 Label receiver_not_smi;
701 __ Bind(&check_for_mint); 701 __ Bind(&check_for_mint);
702 702
703 __ andi(CMPRES1, T1, Immediate(kSmiTagMask)); 703 __ andi(CMPRES1, T1, Immediate(kSmiTagMask));
704 __ bne(CMPRES1, ZR, &receiver_not_smi); // Check receiver. 704 __ bne(CMPRES1, ZR, &receiver_not_smi); // Check receiver.
705 705
706 // Left (receiver) is Smi, return false if right is not Double. 706 // Left (receiver) is Smi, return false if right is not Double or Fraction.
707 // Note that an instance of Mint or Bigint never contains a value that can be 707 // Note that an instance of Mint or Bigint never contains a value that can be
708 // represented by Smi. 708 // represented by Smi.
709 709
710 __ LoadClassId(CMPRES1, T0); 710 __ LoadClassId(CMPRES1, T0);
711 __ BranchEqual(CMPRES1, Immediate(kDoubleCid), &fall_through); 711 __ BranchEqual(CMPRES1, Immediate(kDoubleCid), &fall_through);
712 __ BranchEqual(CMPRES1, Immediate(kFractionCid), &fall_through);
712 __ LoadObject(V0, Bool::False()); // Smi == Mint -> false. 713 __ LoadObject(V0, Bool::False()); // Smi == Mint -> false.
713 __ Ret(); 714 __ Ret();
714 715
715 __ Bind(&receiver_not_smi); 716 __ Bind(&receiver_not_smi);
716 // T1:: receiver. 717 // T1:: receiver.
717 718
718 __ LoadClassId(CMPRES1, T1); 719 __ LoadClassId(CMPRES1, T1);
719 __ BranchNotEqual(CMPRES1, Immediate(kMintCid), &fall_through); 720 __ BranchNotEqual(CMPRES1, Immediate(kMintCid), &fall_through);
720 // Receiver is Mint, return false if right is Smi. 721 // Receiver is Mint, return false if right is Smi.
721 __ andi(CMPRES1, T0, Immediate(kSmiTagMask)); 722 __ andi(CMPRES1, T0, Immediate(kSmiTagMask));
(...skipping 1515 matching lines...) Expand 10 before | Expand all | Expand 10 after
2237 __ lw(T0, Address(V0, TimelineStream::enabled_offset())); 2238 __ lw(T0, Address(V0, TimelineStream::enabled_offset()));
2238 __ LoadObject(V0, Bool::True()); 2239 __ LoadObject(V0, Bool::True());
2239 __ LoadObject(V1, Bool::False()); 2240 __ LoadObject(V1, Bool::False());
2240 __ Ret(); 2241 __ Ret();
2241 __ delay_slot()->movz(V0, V1, T0); // V0 = (T0 == 0) ? V1 : V0. 2242 __ delay_slot()->movz(V0, V1, T0); // V0 = (T0 == 0) ? V1 : V0.
2242 } 2243 }
2243 2244
2244 } // namespace dart 2245 } // namespace dart
2245 2246
2246 #endif // defined TARGET_ARCH_MIPS 2247 #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