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

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

Issue 1089003002: Implement bigint shift intrinsics on IA32. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 8 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
« no previous file with comments | « runtime/vm/assembler_x64.cc ('k') | runtime/vm/intermediate_language_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) 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" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/os.h" 9 #include "vm/os.h"
10 #include "vm/unit_test.h" 10 #include "vm/unit_test.h"
(...skipping 1342 matching lines...) Expand 10 before | Expand all | Expand 10 after
1353 __ movl(RAX, Immediate(0)); 1353 __ movl(RAX, Immediate(0));
1354 __ movl(Address(RAX, 0), RAX); 1354 __ movl(Address(RAX, 0), RAX);
1355 __ Bind(&donetest13a); 1355 __ Bind(&donetest13a);
1356 1356
1357 { 1357 {
1358 Label donetest15a; 1358 Label donetest15a;
1359 const int32_t left = 0xff000000; 1359 const int32_t left = 0xff000000;
1360 const int32_t right = 0xffffffff; 1360 const int32_t right = 0xffffffff;
1361 const int32_t shifted = 0xf0000003; 1361 const int32_t shifted = 0xf0000003;
1362 __ movl(RDX, Immediate(left)); 1362 __ movl(RDX, Immediate(left));
1363 __ movl(RAX, Immediate(right)); 1363 __ movl(R8, Immediate(right));
1364 __ movl(RCX, Immediate(2)); 1364 __ movl(RCX, Immediate(2));
1365 __ shll(RDX, RCX); // RDX = 0xff000000 << 2 == 0xfc000000 1365 __ shll(RDX, RCX); // RDX = 0xff000000 << 2 == 0xfc000000
1366 __ shldl(RDX, RAX, Immediate(2)); 1366 __ shldl(RDX, R8, Immediate(2));
1367 // RDX = high32(0xfc000000:0xffffffff << 2) == 0xf0000003 1367 // RDX = high32(0xfc000000:0xffffffff << 2) == 0xf0000003
1368 __ cmpl(RDX, Immediate(shifted)); 1368 __ cmpl(RDX, Immediate(shifted));
1369 __ j(EQUAL, &donetest15a); 1369 __ j(EQUAL, &donetest15a);
1370 __ int3(); 1370 __ int3();
1371 __ Bind(&donetest15a); 1371 __ Bind(&donetest15a);
1372 } 1372 }
1373 1373
1374 { 1374 {
1375 Label donetest15b; 1375 Label donetest15b;
1376 const int64_t left = 0xff00000000000000; 1376 const int64_t left = 0xff00000000000000;
1377 const int64_t right = 0xffffffffffffffff; 1377 const int64_t right = 0xffffffffffffffff;
1378 const int64_t shifted = 0xf000000000000003; 1378 const int64_t shifted = 0xf000000000000003;
1379 __ movq(RDX, Immediate(left)); 1379 __ movq(RDX, Immediate(left));
1380 __ movq(RAX, Immediate(right)); 1380 __ movq(R8, Immediate(right));
1381 __ movq(RCX, Immediate(2)); 1381 __ movq(RCX, Immediate(2));
1382 __ shlq(RDX, RCX); // RDX = 0xff00000000000000 << 2 == 0xfc00000000000000 1382 __ shlq(RDX, RCX); // RDX = 0xff00000000000000 << 2 == 0xfc00000000000000
1383 __ shldq(RDX, RAX, Immediate(2)); 1383 __ shldq(RDX, R8, Immediate(2));
1384 // RDX = high64(0xfc00000000000000:0xffffffffffffffff << 2) 1384 // RDX = high64(0xfc00000000000000:0xffffffffffffffff << 2)
1385 // == 0xf000000000000003 1385 // == 0xf000000000000003
1386 __ cmpq(RDX, Immediate(shifted)); 1386 __ cmpq(RDX, Immediate(shifted));
1387 __ j(EQUAL, &donetest15b); 1387 __ j(EQUAL, &donetest15b);
1388 __ int3(); 1388 __ int3();
1389 __ Bind(&donetest15b); 1389 __ Bind(&donetest15b);
1390 } 1390 }
1391 1391
1392 { 1392 {
1393 Label donetest15c; 1393 Label donetest15c;
1394 const int64_t left = 0xff00000000000000; 1394 const int64_t left = 0xff00000000000000;
1395 const int64_t right = 0xffffffffffffffff; 1395 const int64_t right = 0xffffffffffffffff;
1396 const int64_t shifted = 0xf000000000000003; 1396 const int64_t shifted = 0xf000000000000003;
1397 __ movq(RDX, Immediate(left)); 1397 __ movq(RDX, Immediate(left));
1398 __ movq(RAX, Immediate(right)); 1398 __ movq(R8, Immediate(right));
1399 __ movq(RCX, Immediate(2)); 1399 __ movq(RCX, Immediate(2));
1400 __ shlq(RDX, RCX); // RDX = 0xff00000000000000 << 2 == 0xfc00000000000000 1400 __ shlq(RDX, RCX); // RDX = 0xff00000000000000 << 2 == 0xfc00000000000000
1401 __ shldq(RDX, RAX, RCX); 1401 __ shldq(RDX, R8, RCX);
1402 // RDX = high64(0xfc00000000000000:0xffffffffffffffff << 2) 1402 // RDX = high64(0xfc00000000000000:0xffffffffffffffff << 2)
1403 // == 0xf000000000000003 1403 // == 0xf000000000000003
1404 __ cmpq(RDX, Immediate(shifted)); 1404 __ cmpq(RDX, Immediate(shifted));
1405 __ j(EQUAL, &donetest15c); 1405 __ j(EQUAL, &donetest15c);
1406 __ int3(); 1406 __ int3();
1407 __ Bind(&donetest15c); 1407 __ Bind(&donetest15c);
1408 } 1408 }
1409 1409
1410 { 1410 {
1411 Label donetest15d; 1411 Label donetest15d;
1412 const int64_t left = 0xff00000000000000; 1412 const int64_t left = 0xff00000000000000;
1413 const int64_t right = 0xffffffffffffffff; 1413 const int64_t right = 0xffffffffffffffff;
1414 const int64_t shifted = 0xcff0000000000000; 1414 const int64_t shifted = 0xcff0000000000000;
1415 __ movq(RDX, Immediate(left)); 1415 __ movq(RDX, Immediate(left));
1416 __ movq(RAX, Immediate(right)); 1416 __ movq(R8, Immediate(right));
1417 __ movq(RCX, Immediate(2)); 1417 __ movq(RCX, Immediate(2));
1418 __ shrq(RDX, RCX); // RDX = 0xff00000000000000 >> 2 == 0x3fc0000000000000 1418 __ shrq(RDX, RCX); // RDX = 0xff00000000000000 >> 2 == 0x3fc0000000000000
1419 __ shrdq(RDX, RAX, RCX); 1419 __ shrdq(RDX, R8, RCX);
1420 // RDX = low64(0xffffffffffffffff:0x3fc0000000000000 >> 2) 1420 // RDX = low64(0xffffffffffffffff:0x3fc0000000000000 >> 2)
1421 // == 0xcff0000000000000 1421 // == 0xcff0000000000000
1422 __ cmpq(RDX, Immediate(shifted)); 1422 __ cmpq(RDX, Immediate(shifted));
1423 __ j(EQUAL, &donetest15d); 1423 __ j(EQUAL, &donetest15d);
1424 __ int3(); 1424 __ int3();
1425 __ Bind(&donetest15d); 1425 __ Bind(&donetest15d);
1426 } 1426 }
1427 1427
1428 __ movl(RAX, Immediate(0)); 1428 __ movl(RAX, Immediate(0));
1429 __ ret(); 1429 __ ret();
(...skipping 2209 matching lines...) Expand 10 before | Expand all | Expand 10 after
3639 EXPECT_EQ(ICData::kInt64RangeBit, range_of(Integer::New(kMaxInt64))); 3639 EXPECT_EQ(ICData::kInt64RangeBit, range_of(Integer::New(kMaxInt64)));
3640 EXPECT_EQ(ICData::kInt64RangeBit, range_of(Integer::New(kMinInt64))); 3640 EXPECT_EQ(ICData::kInt64RangeBit, range_of(Integer::New(kMinInt64)));
3641 3641
3642 EXPECT_EQ(0, range_of(Bool::True().raw())); 3642 EXPECT_EQ(0, range_of(Bool::True().raw()));
3643 } 3643 }
3644 3644
3645 3645
3646 } // namespace dart 3646 } // namespace dart
3647 3647
3648 #endif // defined TARGET_ARCH_X64 3648 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/assembler_x64.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698