OLD | NEW |
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 Loading... |
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; |
1510 __ ldr(R0, Address(SP, 0 * kWordSize)); | 1511 __ ldr(R0, Address(SP, 0 * kWordSize)); |
1511 __ LoadDFieldFromOffset(V0, R0, Double::value_offset()); | 1512 __ LoadDFieldFromOffset(V0, R0, Double::value_offset()); |
1512 __ fcmpd(V0, V0); | 1513 __ fcmpd(V0, V0); |
1513 __ LoadObject(TMP, Bool::False()); | 1514 __ LoadObject(TMP, Bool::False()); |
1514 __ LoadObject(R0, Bool::True()); | 1515 __ LoadObject(R0, Bool::True()); |
1515 __ csel(R0, TMP, R0, VC); | 1516 __ csel(R0, TMP, R0, VC); |
1516 __ ret(); | 1517 __ ret(); |
1517 } | 1518 } |
1518 | 1519 |
1519 | 1520 |
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 | |
1534 void Intrinsifier::Double_getIsNegative(Assembler* assembler) { | 1521 void Intrinsifier::Double_getIsNegative(Assembler* assembler) { |
1535 const Register false_reg = R0; | 1522 const Register false_reg = R0; |
1536 const Register true_reg = R2; | 1523 const Register true_reg = R2; |
1537 Label is_false, is_true, is_zero; | 1524 Label is_false, is_true, is_zero; |
1538 | 1525 |
1539 __ ldr(R0, Address(SP, 0 * kWordSize)); | 1526 __ ldr(R0, Address(SP, 0 * kWordSize)); |
1540 __ LoadDFieldFromOffset(V0, R0, Double::value_offset()); | 1527 __ LoadDFieldFromOffset(V0, R0, Double::value_offset()); |
1541 __ fcmpdz(V0); | 1528 __ fcmpdz(V0); |
1542 __ LoadObject(true_reg, Bool::True()); | 1529 __ LoadObject(true_reg, Bool::True()); |
1543 __ LoadObject(false_reg, Bool::False()); | 1530 __ LoadObject(false_reg, Bool::False()); |
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2225 __ cmp(R0, Operand(0)); | 2212 __ cmp(R0, Operand(0)); |
2226 __ LoadObject(R0, Bool::False()); | 2213 __ LoadObject(R0, Bool::False()); |
2227 __ LoadObject(TMP, Bool::True()); | 2214 __ LoadObject(TMP, Bool::True()); |
2228 __ csel(R0, TMP, R0, NE); | 2215 __ csel(R0, TMP, R0, NE); |
2229 __ ret(); | 2216 __ ret(); |
2230 } | 2217 } |
2231 | 2218 |
2232 } // namespace dart | 2219 } // namespace dart |
2233 | 2220 |
2234 #endif // defined TARGET_ARCH_ARM64 | 2221 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |