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

Side by Side Diff: runtime/vm/intrinsifier_arm64.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_arm.cc ('k') | runtime/vm/intrinsifier_ia32.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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_ARM64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64.
6 #if defined(TARGET_ARCH_ARM64) 6 #if defined(TARGET_ARCH_ARM64)
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 1489 matching lines...) Expand 10 before | Expand all | Expand 10 after
1500 const Class& double_class = Class::Handle( 1500 const Class& double_class = Class::Handle(
1501 Isolate::Current()->object_store()->double_class()); 1501 Isolate::Current()->object_store()->double_class());
1502 __ TryAllocate(double_class, &fall_through, R0, R1); 1502 __ TryAllocate(double_class, &fall_through, R0, R1);
1503 __ StoreDFieldToOffset(V0, R0, Double::value_offset()); 1503 __ StoreDFieldToOffset(V0, R0, Double::value_offset());
1504 __ ret(); 1504 __ ret();
1505 __ Bind(&fall_through); 1505 __ Bind(&fall_through);
1506 } 1506 }
1507 1507
1508 1508
1509 void Intrinsifier::Double_getIsNaN(Assembler* assembler) { 1509 void Intrinsifier::Double_getIsNaN(Assembler* assembler) {
1510 Label is_true;
1511 __ ldr(R0, Address(SP, 0 * kWordSize)); 1510 __ ldr(R0, Address(SP, 0 * kWordSize));
1512 __ LoadDFieldFromOffset(V0, R0, Double::value_offset()); 1511 __ LoadDFieldFromOffset(V0, R0, Double::value_offset());
1513 __ fcmpd(V0, V0); 1512 __ fcmpd(V0, V0);
1514 __ LoadObject(TMP, Bool::False()); 1513 __ LoadObject(TMP, Bool::False());
1515 __ LoadObject(R0, Bool::True()); 1514 __ LoadObject(R0, Bool::True());
1516 __ csel(R0, TMP, R0, VC); 1515 __ csel(R0, TMP, R0, VC);
1517 __ ret(); 1516 __ ret();
1518 } 1517 }
1519 1518
1520 1519
1520 void Intrinsifier::Double_getIsInfinite(Assembler* assembler) {
1521 __ ldr(R0, Address(SP, 0 * kWordSize));
1522 __ LoadFieldFromOffset(R0, R0, Double::value_offset());
1523 // Mask off the sign.
1524 __ AndImmediate(R0, R0, 0x7FFFFFFFFFFFFFFFLL);
1525 // Compare with +infinity.
1526 __ CompareImmediate(R0, 0x7FF0000000000000LL);
1527 __ LoadObject(R0, Bool::False());
1528 __ LoadObject(TMP, Bool::True());
1529 __ csel(R0, TMP, R0, EQ);
1530 __ ret();
1531 }
1532
1533
1521 void Intrinsifier::Double_getIsNegative(Assembler* assembler) { 1534 void Intrinsifier::Double_getIsNegative(Assembler* assembler) {
1522 const Register false_reg = R0; 1535 const Register false_reg = R0;
1523 const Register true_reg = R2; 1536 const Register true_reg = R2;
1524 Label is_false, is_true, is_zero; 1537 Label is_false, is_true, is_zero;
1525 1538
1526 __ ldr(R0, Address(SP, 0 * kWordSize)); 1539 __ ldr(R0, Address(SP, 0 * kWordSize));
1527 __ LoadDFieldFromOffset(V0, R0, Double::value_offset()); 1540 __ LoadDFieldFromOffset(V0, R0, Double::value_offset());
1528 __ fcmpdz(V0); 1541 __ fcmpdz(V0);
1529 __ LoadObject(true_reg, Bool::True()); 1542 __ LoadObject(true_reg, Bool::True());
1530 __ LoadObject(false_reg, Bool::False()); 1543 __ LoadObject(false_reg, Bool::False());
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after
2212 __ cmp(R0, Operand(0)); 2225 __ cmp(R0, Operand(0));
2213 __ LoadObject(R0, Bool::False()); 2226 __ LoadObject(R0, Bool::False());
2214 __ LoadObject(TMP, Bool::True()); 2227 __ LoadObject(TMP, Bool::True());
2215 __ csel(R0, TMP, R0, NE); 2228 __ csel(R0, TMP, R0, NE);
2216 __ ret(); 2229 __ ret();
2217 } 2230 }
2218 2231
2219 } // namespace dart 2232 } // namespace dart
2220 2233
2221 #endif // defined TARGET_ARCH_ARM64 2234 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier_arm.cc ('k') | runtime/vm/intrinsifier_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698