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

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

Issue 2433813002: Reland "Add DoubleTestOp instruction" (Closed)
Patch Set: Created 4 years, 2 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 1512 matching lines...) Expand 10 before | Expand all | Expand 10 after
1523 __ cund(D0, D0); // Check for NaN. 1523 __ cund(D0, D0); // Check for NaN.
1524 __ bc1t(&is_true); 1524 __ bc1t(&is_true);
1525 __ LoadObject(V0, Bool::False()); // Return false if either is NaN. 1525 __ LoadObject(V0, Bool::False()); // Return false if either is NaN.
1526 __ Ret(); 1526 __ Ret();
1527 __ Bind(&is_true); 1527 __ Bind(&is_true);
1528 __ LoadObject(V0, Bool::True()); 1528 __ LoadObject(V0, Bool::True());
1529 __ Ret(); 1529 __ Ret();
1530 } 1530 }
1531 1531
1532 1532
1533 void Intrinsifier::Double_getIsInfinite(Assembler* assembler) {
1534 Label not_inf;
1535 __ lw(T0, Address(SP, 0 * kWordSize));
1536 __ lw(T1, FieldAddress(T0, Double::value_offset()));
1537 __ lw(T2, FieldAddress(T0, Double::value_offset() + kWordSize));
1538 // If the low word isn't zero, then it isn't infinity.
1539 __ bne(T1, ZR, &not_inf);
1540 // Mask off the sign bit.
1541 __ AndImmediate(T2, T2, 0x7FFFFFFF);
1542 // Compare with +infinity.
1543 __ BranchNotEqual(T2, Immediate(0x7FF00000), &not_inf);
1544
1545 __ LoadObject(V0, Bool::True());
1546 __ Ret();
1547
1548 __ Bind(&not_inf);
1549 __ LoadObject(V0, Bool::False());
1550 __ Ret();
1551 }
1552
1553
1533 void Intrinsifier::Double_getIsNegative(Assembler* assembler) { 1554 void Intrinsifier::Double_getIsNegative(Assembler* assembler) {
1534 Label is_false, is_true, is_zero; 1555 Label is_false, is_true, is_zero;
1535 __ lw(T0, Address(SP, 0 * kWordSize)); 1556 __ lw(T0, Address(SP, 0 * kWordSize));
1536 __ LoadDFromOffset(D0, T0, Double::value_offset() - kHeapObjectTag); 1557 __ LoadDFromOffset(D0, T0, Double::value_offset() - kHeapObjectTag);
1537 1558
1538 __ cund(D0, D0); 1559 __ cund(D0, D0);
1539 __ bc1t(&is_false); // NaN -> false. 1560 __ bc1t(&is_false); // NaN -> false.
1540 1561
1541 __ LoadImmediate(D1, 0.0); 1562 __ LoadImmediate(D1, 0.0);
1542 __ ceqd(D0, D1); 1563 __ ceqd(D0, D1);
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
2237 __ lw(T0, Address(V0, TimelineStream::enabled_offset())); 2258 __ lw(T0, Address(V0, TimelineStream::enabled_offset()));
2238 __ LoadObject(V0, Bool::True()); 2259 __ LoadObject(V0, Bool::True());
2239 __ LoadObject(V1, Bool::False()); 2260 __ LoadObject(V1, Bool::False());
2240 __ Ret(); 2261 __ Ret();
2241 __ delay_slot()->movz(V0, V1, T0); // V0 = (T0 == 0) ? V1 : V0. 2262 __ delay_slot()->movz(V0, V1, T0); // V0 = (T0 == 0) ? V1 : V0.
2242 } 2263 }
2243 2264
2244 } // namespace dart 2265 } // namespace dart
2245 2266
2246 #endif // defined TARGET_ARCH_MIPS 2267 #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