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

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

Issue 11748016: Make ~/, round, ceil, floor, truncate return ints. Remove toInt. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: Checked mode fixes. Created 7 years, 11 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 | Annotate | Revision Log
OLDNEW
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 1367 matching lines...) Expand 10 before | Expand all | Expand 10 after
1378 __ jmp(&double_op); 1378 __ jmp(&double_op);
1379 1379
1380 __ Bind(&alloc_failed); 1380 __ Bind(&alloc_failed);
1381 __ ffree(0); 1381 __ ffree(0);
1382 __ fincstp(); 1382 __ fincstp();
1383 1383
1384 __ Bind(&fall_through); 1384 __ Bind(&fall_through);
1385 } 1385 }
1386 1386
1387 1387
1388 bool Intrinsifier::Double_toInt(Assembler* assembler) { 1388 bool Intrinsifier::Double_truncate(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 __ movq(RCX, RAX); 1395 __ movq(RCX, RAX);
1396 __ shlq(RCX, Immediate(1)); 1396 __ shlq(RCX, Immediate(1));
1397 __ j(OVERFLOW, &fall_through, Assembler::kNearJump); 1397 __ j(OVERFLOW, &fall_through, Assembler::kNearJump);
1398 __ SmiTag(RAX); 1398 __ SmiTag(RAX);
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
1514 __ LoadObject(RAX, bool_true); 1514 __ LoadObject(RAX, bool_true);
1515 __ ret(); 1515 __ ret();
1516 return true; 1516 return true;
1517 } 1517 }
1518 1518
1519 #undef __ 1519 #undef __
1520 1520
1521 } // namespace dart 1521 } // namespace dart
1522 1522
1523 #endif // defined TARGET_ARCH_X64 1523 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698