OLD | NEW |
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_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
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 1404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1415 __ LoadDFromOffset(D0, R0, Double::value_offset() - kHeapObjectTag); | 1415 __ LoadDFromOffset(D0, R0, Double::value_offset() - kHeapObjectTag); |
1416 __ vcmpd(D0, D0); | 1416 __ vcmpd(D0, D0); |
1417 __ vmstat(); | 1417 __ vmstat(); |
1418 __ LoadObject(R0, Bool::False(), VC); | 1418 __ LoadObject(R0, Bool::False(), VC); |
1419 __ LoadObject(R0, Bool::True(), VS); | 1419 __ LoadObject(R0, Bool::True(), VS); |
1420 __ Ret(); | 1420 __ Ret(); |
1421 } | 1421 } |
1422 } | 1422 } |
1423 | 1423 |
1424 | 1424 |
1425 void Intrinsifier::Double_getIsInfinite(Assembler* assembler) { | |
1426 if (TargetCPUFeatures::vfp_supported()) { | |
1427 __ ldr(R0, Address(SP, 0 * kWordSize)); | |
1428 // R1 <- value[0:31], R2 <- value[32:63] | |
1429 __ LoadFieldFromOffset(kWord, R1, R0, Double::value_offset()); | |
1430 __ LoadFieldFromOffset(kWord, R2, R0, Double::value_offset() + kWordSize); | |
1431 | |
1432 // If the low word isn't 0, then it isn't infinity. | |
1433 __ cmp(R1, Operand(0)); | |
1434 __ LoadObject(R0, Bool::False(), NE); | |
1435 __ bx(LR, NE); // Return if NE. | |
1436 | |
1437 // Mask off the sign bit. | |
1438 __ AndImmediate(R2, R2, 0x7FFFFFFF); | |
1439 // Compare with +infinity. | |
1440 __ CompareImmediate(R2, 0x7FF00000); | |
1441 __ LoadObject(R0, Bool::False(), NE); | |
1442 __ bx(LR, NE); | |
1443 | |
1444 __ LoadObject(R0, Bool::True()); | |
1445 __ Ret(); | |
1446 } | |
1447 } | |
1448 | |
1449 | |
1450 void Intrinsifier::Double_getIsNegative(Assembler* assembler) { | 1425 void Intrinsifier::Double_getIsNegative(Assembler* assembler) { |
1451 if (TargetCPUFeatures::vfp_supported()) { | 1426 if (TargetCPUFeatures::vfp_supported()) { |
1452 Label is_false, is_true, is_zero; | 1427 Label is_false, is_true, is_zero; |
1453 __ ldr(R0, Address(SP, 0 * kWordSize)); | 1428 __ ldr(R0, Address(SP, 0 * kWordSize)); |
1454 __ LoadDFromOffset(D0, R0, Double::value_offset() - kHeapObjectTag); | 1429 __ LoadDFromOffset(D0, R0, Double::value_offset() - kHeapObjectTag); |
1455 __ vcmpdz(D0); | 1430 __ vcmpdz(D0); |
1456 __ vmstat(); | 1431 __ vmstat(); |
1457 __ b(&is_false, VS); // NaN -> false. | 1432 __ b(&is_false, VS); // NaN -> false. |
1458 __ b(&is_zero, EQ); // Check for negative zero. | 1433 __ b(&is_zero, EQ); // Check for negative zero. |
1459 __ b(&is_false, CS); // >= 0 -> false. | 1434 __ b(&is_false, CS); // >= 0 -> false. |
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2153 __ ldr(R0, Address(R0, TimelineStream::enabled_offset())); | 2128 __ ldr(R0, Address(R0, TimelineStream::enabled_offset())); |
2154 __ cmp(R0, Operand(0)); | 2129 __ cmp(R0, Operand(0)); |
2155 __ LoadObject(R0, Bool::True(), NE); | 2130 __ LoadObject(R0, Bool::True(), NE); |
2156 __ LoadObject(R0, Bool::False(), EQ); | 2131 __ LoadObject(R0, Bool::False(), EQ); |
2157 __ Ret(); | 2132 __ Ret(); |
2158 } | 2133 } |
2159 | 2134 |
2160 } // namespace dart | 2135 } // namespace dart |
2161 | 2136 |
2162 #endif // defined TARGET_ARCH_ARM | 2137 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |