| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 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 1374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1385 } | 1385 } |
| 1386 | 1386 |
| 1387 | 1387 |
| 1388 bool Intrinsifier::Double_toInt(Assembler* assembler) { | 1388 bool Intrinsifier::Double_toInt(Assembler* assembler) { |
| 1389 __ movq(RAX, Address(RSP, +1 * kWordSize)); | 1389 __ movq(RAX, Address(RSP, +1 * kWordSize)); |
| 1390 __ movsd(XMM0, FieldAddress(RAX, Double::value_offset())); | 1390 __ movsd(XMM0, FieldAddress(RAX, Double::value_offset())); |
| 1391 __ cvttsd2siq(RAX, XMM0); | 1391 __ cvttsd2siq(RAX, XMM0); |
| 1392 // Overflow is signalled with minint. | 1392 // Overflow is signalled with minint. |
| 1393 Label fall_through; | 1393 Label fall_through; |
| 1394 // Check for overflow and that it fits into Smi. | 1394 // Check for overflow and that it fits into Smi. |
| 1395 __ cmpq(RAX, Immediate(0xC000000000000000)); | 1395 __ movq(RCX, RAX); |
| 1396 __ j(NEGATIVE, &fall_through, Assembler::kNearJump); | 1396 __ shlq(RCX, Immediate(1)); |
| 1397 __ j(OVERFLOW, &fall_through, Assembler::kNearJump); |
| 1397 __ SmiTag(RAX); | 1398 __ SmiTag(RAX); |
| 1398 __ ret(); | 1399 __ ret(); |
| 1399 __ Bind(&fall_through); | 1400 __ Bind(&fall_through); |
| 1400 return false; | 1401 return false; |
| 1401 } | 1402 } |
| 1402 | 1403 |
| 1403 | 1404 |
| 1404 bool Intrinsifier::Math_sqrt(Assembler* assembler) { | 1405 bool Intrinsifier::Math_sqrt(Assembler* assembler) { |
| 1405 Label fall_through, is_smi, double_op; | 1406 Label fall_through, is_smi, double_op; |
| 1406 TestLastArgumentIsDouble(assembler, &is_smi, &fall_through); | 1407 TestLastArgumentIsDouble(assembler, &is_smi, &fall_through); |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1607 __ LoadObject(RAX, bool_true); | 1608 __ LoadObject(RAX, bool_true); |
| 1608 __ ret(); | 1609 __ ret(); |
| 1609 return true; | 1610 return true; |
| 1610 } | 1611 } |
| 1611 | 1612 |
| 1612 #undef __ | 1613 #undef __ |
| 1613 | 1614 |
| 1614 } // namespace dart | 1615 } // namespace dart |
| 1615 | 1616 |
| 1616 #endif // defined TARGET_ARCH_X64 | 1617 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |