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

Side by Side Diff: test/cctest/test-macro-assembler-x64.cc

Issue 205343013: Introduce andp, notp, orp and xorp for x64 port (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased with bleeding_edge Created 6 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 | « test/cctest/test-disasm-x64.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 TestMoveSmi(masm, &exit, 4, Smi::FromInt(255)); 174 TestMoveSmi(masm, &exit, 4, Smi::FromInt(255));
175 TestMoveSmi(masm, &exit, 5, Smi::FromInt(256)); 175 TestMoveSmi(masm, &exit, 5, Smi::FromInt(256));
176 TestMoveSmi(masm, &exit, 6, Smi::FromInt(Smi::kMaxValue)); 176 TestMoveSmi(masm, &exit, 6, Smi::FromInt(Smi::kMaxValue));
177 TestMoveSmi(masm, &exit, 7, Smi::FromInt(-1)); 177 TestMoveSmi(masm, &exit, 7, Smi::FromInt(-1));
178 TestMoveSmi(masm, &exit, 8, Smi::FromInt(-128)); 178 TestMoveSmi(masm, &exit, 8, Smi::FromInt(-128));
179 TestMoveSmi(masm, &exit, 9, Smi::FromInt(-129)); 179 TestMoveSmi(masm, &exit, 9, Smi::FromInt(-129));
180 TestMoveSmi(masm, &exit, 10, Smi::FromInt(-256)); 180 TestMoveSmi(masm, &exit, 10, Smi::FromInt(-256));
181 TestMoveSmi(masm, &exit, 11, Smi::FromInt(-257)); 181 TestMoveSmi(masm, &exit, 11, Smi::FromInt(-257));
182 TestMoveSmi(masm, &exit, 12, Smi::FromInt(Smi::kMinValue)); 182 TestMoveSmi(masm, &exit, 12, Smi::FromInt(Smi::kMinValue));
183 183
184 __ xor_(rax, rax); // Success. 184 __ xorq(rax, rax); // Success.
185 __ bind(&exit); 185 __ bind(&exit);
186 ExitCode(masm); 186 ExitCode(masm);
187 __ ret(0); 187 __ ret(0);
188 188
189 CodeDesc desc; 189 CodeDesc desc;
190 masm->GetCode(&desc); 190 masm->GetCode(&desc);
191 // Call the function from C++. 191 // Call the function from C++.
192 int result = FUNCTION_CAST<F0>(buffer)(); 192 int result = FUNCTION_CAST<F0>(buffer)();
193 CHECK_EQ(0, result); 193 CHECK_EQ(0, result);
194 } 194 }
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 TestSmiCompare(masm, &exit, 0xB0, Smi::kMaxValue, 0); 270 TestSmiCompare(masm, &exit, 0xB0, Smi::kMaxValue, 0);
271 TestSmiCompare(masm, &exit, 0xC0, -1, Smi::kMinValue); 271 TestSmiCompare(masm, &exit, 0xC0, -1, Smi::kMinValue);
272 TestSmiCompare(masm, &exit, 0xD0, Smi::kMinValue, -1); 272 TestSmiCompare(masm, &exit, 0xD0, Smi::kMinValue, -1);
273 TestSmiCompare(masm, &exit, 0xE0, -1, Smi::kMaxValue); 273 TestSmiCompare(masm, &exit, 0xE0, -1, Smi::kMaxValue);
274 TestSmiCompare(masm, &exit, 0xF0, Smi::kMaxValue, -1); 274 TestSmiCompare(masm, &exit, 0xF0, Smi::kMaxValue, -1);
275 TestSmiCompare(masm, &exit, 0x100, Smi::kMinValue, Smi::kMinValue); 275 TestSmiCompare(masm, &exit, 0x100, Smi::kMinValue, Smi::kMinValue);
276 TestSmiCompare(masm, &exit, 0x110, Smi::kMinValue, Smi::kMaxValue); 276 TestSmiCompare(masm, &exit, 0x110, Smi::kMinValue, Smi::kMaxValue);
277 TestSmiCompare(masm, &exit, 0x120, Smi::kMaxValue, Smi::kMinValue); 277 TestSmiCompare(masm, &exit, 0x120, Smi::kMaxValue, Smi::kMinValue);
278 TestSmiCompare(masm, &exit, 0x130, Smi::kMaxValue, Smi::kMaxValue); 278 TestSmiCompare(masm, &exit, 0x130, Smi::kMaxValue, Smi::kMaxValue);
279 279
280 __ xor_(rax, rax); // Success. 280 __ xorq(rax, rax); // Success.
281 __ bind(&exit); 281 __ bind(&exit);
282 ExitCode(masm); 282 ExitCode(masm);
283 __ ret(0); 283 __ ret(0);
284 284
285 CodeDesc desc; 285 CodeDesc desc;
286 masm->GetCode(&desc); 286 masm->GetCode(&desc);
287 // Call the function from C++. 287 // Call the function from C++.
288 int result = FUNCTION_CAST<F0>(buffer)(); 288 int result = FUNCTION_CAST<F0>(buffer)();
289 CHECK_EQ(0, result); 289 CHECK_EQ(0, result);
290 } 290 }
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 __ j(not_equal, &exit); 373 __ j(not_equal, &exit);
374 374
375 __ movq(rax, Immediate(10)); // Test number. 375 __ movq(rax, Immediate(10)); // Test number.
376 __ movl(rcx, Immediate(Smi::kMinValue)); 376 __ movl(rcx, Immediate(Smi::kMinValue));
377 __ Integer32ToSmi(r8, rcx); 377 __ Integer32ToSmi(r8, rcx);
378 __ Set(rdx, reinterpret_cast<intptr_t>(Smi::FromInt(Smi::kMinValue))); 378 __ Set(rdx, reinterpret_cast<intptr_t>(Smi::FromInt(Smi::kMinValue)));
379 __ cmpq(r8, rdx); 379 __ cmpq(r8, rdx);
380 __ j(not_equal, &exit); 380 __ j(not_equal, &exit);
381 381
382 382
383 __ xor_(rax, rax); // Success. 383 __ xorq(rax, rax); // Success.
384 __ bind(&exit); 384 __ bind(&exit);
385 ExitCode(masm); 385 ExitCode(masm);
386 __ ret(0); 386 __ ret(0);
387 387
388 CodeDesc desc; 388 CodeDesc desc;
389 masm->GetCode(&desc); 389 masm->GetCode(&desc);
390 // Call the function from C++. 390 // Call the function from C++.
391 int result = FUNCTION_CAST<F0>(buffer)(); 391 int result = FUNCTION_CAST<F0>(buffer)();
392 CHECK_EQ(0, result); 392 CHECK_EQ(0, result);
393 } 393 }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 TestI64PlusConstantToSmi(masm, &exit, 0x40, Smi::kMaxValue - 5, 5); 443 TestI64PlusConstantToSmi(masm, &exit, 0x40, Smi::kMaxValue - 5, 5);
444 TestI64PlusConstantToSmi(masm, &exit, 0x50, Smi::kMinValue + 5, 5); 444 TestI64PlusConstantToSmi(masm, &exit, 0x50, Smi::kMinValue + 5, 5);
445 TestI64PlusConstantToSmi(masm, &exit, 0x60, twice_max, -Smi::kMaxValue); 445 TestI64PlusConstantToSmi(masm, &exit, 0x60, twice_max, -Smi::kMaxValue);
446 TestI64PlusConstantToSmi(masm, &exit, 0x70, -twice_max, Smi::kMaxValue); 446 TestI64PlusConstantToSmi(masm, &exit, 0x70, -twice_max, Smi::kMaxValue);
447 TestI64PlusConstantToSmi(masm, &exit, 0x80, 0, Smi::kMinValue); 447 TestI64PlusConstantToSmi(masm, &exit, 0x80, 0, Smi::kMinValue);
448 TestI64PlusConstantToSmi(masm, &exit, 0x90, 0, Smi::kMaxValue); 448 TestI64PlusConstantToSmi(masm, &exit, 0x90, 0, Smi::kMaxValue);
449 TestI64PlusConstantToSmi(masm, &exit, 0xA0, Smi::kMinValue, 0); 449 TestI64PlusConstantToSmi(masm, &exit, 0xA0, Smi::kMinValue, 0);
450 TestI64PlusConstantToSmi(masm, &exit, 0xB0, Smi::kMaxValue, 0); 450 TestI64PlusConstantToSmi(masm, &exit, 0xB0, Smi::kMaxValue, 0);
451 TestI64PlusConstantToSmi(masm, &exit, 0xC0, twice_max, Smi::kMinValue); 451 TestI64PlusConstantToSmi(masm, &exit, 0xC0, twice_max, Smi::kMinValue);
452 452
453 __ xor_(rax, rax); // Success. 453 __ xorq(rax, rax); // Success.
454 __ bind(&exit); 454 __ bind(&exit);
455 ExitCode(masm); 455 ExitCode(masm);
456 __ ret(0); 456 __ ret(0);
457 457
458 CodeDesc desc; 458 CodeDesc desc;
459 masm->GetCode(&desc); 459 masm->GetCode(&desc);
460 // Call the function from C++. 460 // Call the function from C++.
461 int result = FUNCTION_CAST<F0>(buffer)(); 461 int result = FUNCTION_CAST<F0>(buffer)();
462 CHECK_EQ(0, result); 462 CHECK_EQ(0, result);
463 } 463 }
(...skipping 19 matching lines...) Expand all
483 __ movl(rax, Immediate(1)); // Test number. 483 __ movl(rax, Immediate(1)); // Test number.
484 484
485 // CheckSmi 485 // CheckSmi
486 486
487 __ movl(rcx, Immediate(0)); 487 __ movl(rcx, Immediate(0));
488 __ Integer32ToSmi(rcx, rcx); 488 __ Integer32ToSmi(rcx, rcx);
489 cond = masm->CheckSmi(rcx); 489 cond = masm->CheckSmi(rcx);
490 __ j(NegateCondition(cond), &exit); 490 __ j(NegateCondition(cond), &exit);
491 491
492 __ incq(rax); 492 __ incq(rax);
493 __ xor_(rcx, Immediate(kSmiTagMask)); 493 __ xorq(rcx, Immediate(kSmiTagMask));
494 cond = masm->CheckSmi(rcx); 494 cond = masm->CheckSmi(rcx);
495 __ j(cond, &exit); 495 __ j(cond, &exit);
496 496
497 __ incq(rax); 497 __ incq(rax);
498 __ movl(rcx, Immediate(-1)); 498 __ movl(rcx, Immediate(-1));
499 __ Integer32ToSmi(rcx, rcx); 499 __ Integer32ToSmi(rcx, rcx);
500 cond = masm->CheckSmi(rcx); 500 cond = masm->CheckSmi(rcx);
501 __ j(NegateCondition(cond), &exit); 501 __ j(NegateCondition(cond), &exit);
502 502
503 __ incq(rax); 503 __ incq(rax);
504 __ xor_(rcx, Immediate(kSmiTagMask)); 504 __ xorq(rcx, Immediate(kSmiTagMask));
505 cond = masm->CheckSmi(rcx); 505 cond = masm->CheckSmi(rcx);
506 __ j(cond, &exit); 506 __ j(cond, &exit);
507 507
508 __ incq(rax); 508 __ incq(rax);
509 __ movl(rcx, Immediate(Smi::kMaxValue)); 509 __ movl(rcx, Immediate(Smi::kMaxValue));
510 __ Integer32ToSmi(rcx, rcx); 510 __ Integer32ToSmi(rcx, rcx);
511 cond = masm->CheckSmi(rcx); 511 cond = masm->CheckSmi(rcx);
512 __ j(NegateCondition(cond), &exit); 512 __ j(NegateCondition(cond), &exit);
513 513
514 __ incq(rax); 514 __ incq(rax);
515 __ xor_(rcx, Immediate(kSmiTagMask)); 515 __ xorq(rcx, Immediate(kSmiTagMask));
516 cond = masm->CheckSmi(rcx); 516 cond = masm->CheckSmi(rcx);
517 __ j(cond, &exit); 517 __ j(cond, &exit);
518 518
519 __ incq(rax); 519 __ incq(rax);
520 __ movl(rcx, Immediate(Smi::kMinValue)); 520 __ movl(rcx, Immediate(Smi::kMinValue));
521 __ Integer32ToSmi(rcx, rcx); 521 __ Integer32ToSmi(rcx, rcx);
522 cond = masm->CheckSmi(rcx); 522 cond = masm->CheckSmi(rcx);
523 __ j(NegateCondition(cond), &exit); 523 __ j(NegateCondition(cond), &exit);
524 524
525 __ incq(rax); 525 __ incq(rax);
526 __ xor_(rcx, Immediate(kSmiTagMask)); 526 __ xorq(rcx, Immediate(kSmiTagMask));
527 cond = masm->CheckSmi(rcx); 527 cond = masm->CheckSmi(rcx);
528 __ j(cond, &exit); 528 __ j(cond, &exit);
529 529
530 // CheckPositiveSmi 530 // CheckPositiveSmi
531 531
532 __ incq(rax); 532 __ incq(rax);
533 __ movl(rcx, Immediate(0)); 533 __ movl(rcx, Immediate(0));
534 __ Integer32ToSmi(rcx, rcx); 534 __ Integer32ToSmi(rcx, rcx);
535 cond = masm->CheckNonNegativeSmi(rcx); 535 cond = masm->CheckNonNegativeSmi(rcx);
536 __ j(NegateCondition(cond), &exit); 536 __ j(NegateCondition(cond), &exit);
537 537
538 __ incq(rax); 538 __ incq(rax);
539 __ xor_(rcx, Immediate(kSmiTagMask)); 539 __ xorq(rcx, Immediate(kSmiTagMask));
540 cond = masm->CheckNonNegativeSmi(rcx); // "zero" non-smi. 540 cond = masm->CheckNonNegativeSmi(rcx); // "zero" non-smi.
541 __ j(cond, &exit); 541 __ j(cond, &exit);
542 542
543 __ incq(rax); 543 __ incq(rax);
544 __ movq(rcx, Immediate(-1)); 544 __ movq(rcx, Immediate(-1));
545 __ Integer32ToSmi(rcx, rcx); 545 __ Integer32ToSmi(rcx, rcx);
546 cond = masm->CheckNonNegativeSmi(rcx); // Negative smis are not positive. 546 cond = masm->CheckNonNegativeSmi(rcx); // Negative smis are not positive.
547 __ j(cond, &exit); 547 __ j(cond, &exit);
548 548
549 __ incq(rax); 549 __ incq(rax);
550 __ movq(rcx, Immediate(Smi::kMinValue)); 550 __ movq(rcx, Immediate(Smi::kMinValue));
551 __ Integer32ToSmi(rcx, rcx); 551 __ Integer32ToSmi(rcx, rcx);
552 cond = masm->CheckNonNegativeSmi(rcx); // Most negative smi is not positive. 552 cond = masm->CheckNonNegativeSmi(rcx); // Most negative smi is not positive.
553 __ j(cond, &exit); 553 __ j(cond, &exit);
554 554
555 __ incq(rax); 555 __ incq(rax);
556 __ xor_(rcx, Immediate(kSmiTagMask)); 556 __ xorq(rcx, Immediate(kSmiTagMask));
557 cond = masm->CheckNonNegativeSmi(rcx); // "Negative" non-smi. 557 cond = masm->CheckNonNegativeSmi(rcx); // "Negative" non-smi.
558 __ j(cond, &exit); 558 __ j(cond, &exit);
559 559
560 __ incq(rax); 560 __ incq(rax);
561 __ movq(rcx, Immediate(Smi::kMaxValue)); 561 __ movq(rcx, Immediate(Smi::kMaxValue));
562 __ Integer32ToSmi(rcx, rcx); 562 __ Integer32ToSmi(rcx, rcx);
563 cond = masm->CheckNonNegativeSmi(rcx); // Most positive smi is positive. 563 cond = masm->CheckNonNegativeSmi(rcx); // Most positive smi is positive.
564 __ j(NegateCondition(cond), &exit); 564 __ j(NegateCondition(cond), &exit);
565 565
566 __ incq(rax); 566 __ incq(rax);
567 __ xor_(rcx, Immediate(kSmiTagMask)); 567 __ xorq(rcx, Immediate(kSmiTagMask));
568 cond = masm->CheckNonNegativeSmi(rcx); // "Positive" non-smi. 568 cond = masm->CheckNonNegativeSmi(rcx); // "Positive" non-smi.
569 __ j(cond, &exit); 569 __ j(cond, &exit);
570 570
571 // CheckIsMinSmi 571 // CheckIsMinSmi
572 572
573 __ incq(rax); 573 __ incq(rax);
574 __ movq(rcx, Immediate(Smi::kMaxValue)); 574 __ movq(rcx, Immediate(Smi::kMaxValue));
575 __ Integer32ToSmi(rcx, rcx); 575 __ Integer32ToSmi(rcx, rcx);
576 cond = masm->CheckIsMinSmi(rcx); 576 cond = masm->CheckIsMinSmi(rcx);
577 __ j(cond, &exit); 577 __ j(cond, &exit);
(...skipping 20 matching lines...) Expand all
598 598
599 __ incq(rax); 599 __ incq(rax);
600 __ movq(rcx, Immediate(Smi::kMaxValue)); 600 __ movq(rcx, Immediate(Smi::kMaxValue));
601 __ Integer32ToSmi(rcx, rcx); 601 __ Integer32ToSmi(rcx, rcx);
602 __ movq(rdx, Immediate(Smi::kMinValue)); 602 __ movq(rdx, Immediate(Smi::kMinValue));
603 __ Integer32ToSmi(rdx, rdx); 603 __ Integer32ToSmi(rdx, rdx);
604 cond = masm->CheckBothSmi(rcx, rdx); 604 cond = masm->CheckBothSmi(rcx, rdx);
605 __ j(NegateCondition(cond), &exit); 605 __ j(NegateCondition(cond), &exit);
606 606
607 __ incq(rax); 607 __ incq(rax);
608 __ xor_(rcx, Immediate(kSmiTagMask)); 608 __ xorq(rcx, Immediate(kSmiTagMask));
609 cond = masm->CheckBothSmi(rcx, rdx); 609 cond = masm->CheckBothSmi(rcx, rdx);
610 __ j(cond, &exit); 610 __ j(cond, &exit);
611 611
612 __ incq(rax); 612 __ incq(rax);
613 __ xor_(rdx, Immediate(kSmiTagMask)); 613 __ xorq(rdx, Immediate(kSmiTagMask));
614 cond = masm->CheckBothSmi(rcx, rdx); 614 cond = masm->CheckBothSmi(rcx, rdx);
615 __ j(cond, &exit); 615 __ j(cond, &exit);
616 616
617 __ incq(rax); 617 __ incq(rax);
618 __ xor_(rcx, Immediate(kSmiTagMask)); 618 __ xorq(rcx, Immediate(kSmiTagMask));
619 cond = masm->CheckBothSmi(rcx, rdx); 619 cond = masm->CheckBothSmi(rcx, rdx);
620 __ j(cond, &exit); 620 __ j(cond, &exit);
621 621
622 __ incq(rax); 622 __ incq(rax);
623 cond = masm->CheckBothSmi(rcx, rcx); 623 cond = masm->CheckBothSmi(rcx, rcx);
624 __ j(NegateCondition(cond), &exit); 624 __ j(NegateCondition(cond), &exit);
625 625
626 __ incq(rax); 626 __ incq(rax);
627 cond = masm->CheckBothSmi(rdx, rdx); 627 cond = masm->CheckBothSmi(rdx, rdx);
628 __ j(cond, &exit); 628 __ j(cond, &exit);
(...skipping 13 matching lines...) Expand all
642 __ movq(rcx, Immediate(Smi::kMaxValue)); 642 __ movq(rcx, Immediate(Smi::kMaxValue));
643 cond = masm->CheckInteger32ValidSmiValue(rax); 643 cond = masm->CheckInteger32ValidSmiValue(rax);
644 __ j(NegateCondition(cond), &exit); 644 __ j(NegateCondition(cond), &exit);
645 645
646 __ incq(rax); 646 __ incq(rax);
647 __ movq(rcx, Immediate(Smi::kMinValue)); 647 __ movq(rcx, Immediate(Smi::kMinValue));
648 cond = masm->CheckInteger32ValidSmiValue(rax); 648 cond = masm->CheckInteger32ValidSmiValue(rax);
649 __ j(NegateCondition(cond), &exit); 649 __ j(NegateCondition(cond), &exit);
650 650
651 // Success 651 // Success
652 __ xor_(rax, rax); 652 __ xorq(rax, rax);
653 653
654 __ bind(&exit); 654 __ bind(&exit);
655 ExitCode(masm); 655 ExitCode(masm);
656 __ ret(0); 656 __ ret(0);
657 657
658 CodeDesc desc; 658 CodeDesc desc;
659 masm->GetCode(&desc); 659 masm->GetCode(&desc);
660 // Call the function from C++. 660 // Call the function from C++.
661 int result = FUNCTION_CAST<F0>(buffer)(); 661 int result = FUNCTION_CAST<F0>(buffer)();
662 CHECK_EQ(0, result); 662 CHECK_EQ(0, result);
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 729
730 TestSmiNeg(masm, &exit, 0x10, 0); 730 TestSmiNeg(masm, &exit, 0x10, 0);
731 TestSmiNeg(masm, &exit, 0x20, 1); 731 TestSmiNeg(masm, &exit, 0x20, 1);
732 TestSmiNeg(masm, &exit, 0x30, -1); 732 TestSmiNeg(masm, &exit, 0x30, -1);
733 TestSmiNeg(masm, &exit, 0x40, 127); 733 TestSmiNeg(masm, &exit, 0x40, 127);
734 TestSmiNeg(masm, &exit, 0x50, 65535); 734 TestSmiNeg(masm, &exit, 0x50, 65535);
735 TestSmiNeg(masm, &exit, 0x60, Smi::kMinValue); 735 TestSmiNeg(masm, &exit, 0x60, Smi::kMinValue);
736 TestSmiNeg(masm, &exit, 0x70, Smi::kMaxValue); 736 TestSmiNeg(masm, &exit, 0x70, Smi::kMaxValue);
737 TestSmiNeg(masm, &exit, 0x80, -Smi::kMaxValue); 737 TestSmiNeg(masm, &exit, 0x80, -Smi::kMaxValue);
738 738
739 __ xor_(rax, rax); // Success. 739 __ xorq(rax, rax); // Success.
740 __ bind(&exit); 740 __ bind(&exit);
741 ExitCode(masm); 741 ExitCode(masm);
742 __ ret(0); 742 __ ret(0);
743 743
744 CodeDesc desc; 744 CodeDesc desc;
745 masm->GetCode(&desc); 745 masm->GetCode(&desc);
746 // Call the function from C++. 746 // Call the function from C++.
747 int result = FUNCTION_CAST<F0>(buffer)(); 747 int result = FUNCTION_CAST<F0>(buffer)();
748 CHECK_EQ(0, result); 748 CHECK_EQ(0, result);
749 } 749 }
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
954 SmiAddTest(masm, &exit, 0x80, Smi::kMaxValue, Smi::kMinValue); 954 SmiAddTest(masm, &exit, 0x80, Smi::kMaxValue, Smi::kMinValue);
955 955
956 SmiAddOverflowTest(masm, &exit, 0x90, -1); 956 SmiAddOverflowTest(masm, &exit, 0x90, -1);
957 SmiAddOverflowTest(masm, &exit, 0xA0, 1); 957 SmiAddOverflowTest(masm, &exit, 0xA0, 1);
958 SmiAddOverflowTest(masm, &exit, 0xB0, 1024); 958 SmiAddOverflowTest(masm, &exit, 0xB0, 1024);
959 SmiAddOverflowTest(masm, &exit, 0xC0, Smi::kMaxValue); 959 SmiAddOverflowTest(masm, &exit, 0xC0, Smi::kMaxValue);
960 SmiAddOverflowTest(masm, &exit, 0xD0, -2); 960 SmiAddOverflowTest(masm, &exit, 0xD0, -2);
961 SmiAddOverflowTest(masm, &exit, 0xE0, -42000); 961 SmiAddOverflowTest(masm, &exit, 0xE0, -42000);
962 SmiAddOverflowTest(masm, &exit, 0xF0, Smi::kMinValue); 962 SmiAddOverflowTest(masm, &exit, 0xF0, Smi::kMinValue);
963 963
964 __ xor_(rax, rax); // Success. 964 __ xorq(rax, rax); // Success.
965 __ bind(&exit); 965 __ bind(&exit);
966 ExitCode(masm); 966 ExitCode(masm);
967 __ ret(0); 967 __ ret(0);
968 968
969 CodeDesc desc; 969 CodeDesc desc;
970 masm->GetCode(&desc); 970 masm->GetCode(&desc);
971 // Call the function from C++. 971 // Call the function from C++.
972 int result = FUNCTION_CAST<F0>(buffer)(); 972 int result = FUNCTION_CAST<F0>(buffer)();
973 CHECK_EQ(0, result); 973 CHECK_EQ(0, result);
974 } 974 }
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
1175 SmiSubTest(masm, &exit, 0x90, 0, Smi::kMaxValue); 1175 SmiSubTest(masm, &exit, 0x90, 0, Smi::kMaxValue);
1176 1176
1177 SmiSubOverflowTest(masm, &exit, 0xA0, 1); 1177 SmiSubOverflowTest(masm, &exit, 0xA0, 1);
1178 SmiSubOverflowTest(masm, &exit, 0xB0, 1024); 1178 SmiSubOverflowTest(masm, &exit, 0xB0, 1024);
1179 SmiSubOverflowTest(masm, &exit, 0xC0, Smi::kMaxValue); 1179 SmiSubOverflowTest(masm, &exit, 0xC0, Smi::kMaxValue);
1180 SmiSubOverflowTest(masm, &exit, 0xD0, -2); 1180 SmiSubOverflowTest(masm, &exit, 0xD0, -2);
1181 SmiSubOverflowTest(masm, &exit, 0xE0, -42000); 1181 SmiSubOverflowTest(masm, &exit, 0xE0, -42000);
1182 SmiSubOverflowTest(masm, &exit, 0xF0, Smi::kMinValue); 1182 SmiSubOverflowTest(masm, &exit, 0xF0, Smi::kMinValue);
1183 SmiSubOverflowTest(masm, &exit, 0x100, 0); 1183 SmiSubOverflowTest(masm, &exit, 0x100, 0);
1184 1184
1185 __ xor_(rax, rax); // Success. 1185 __ xorq(rax, rax); // Success.
1186 __ bind(&exit); 1186 __ bind(&exit);
1187 ExitCode(masm); 1187 ExitCode(masm);
1188 __ ret(0); 1188 __ ret(0);
1189 1189
1190 CodeDesc desc; 1190 CodeDesc desc;
1191 masm->GetCode(&desc); 1191 masm->GetCode(&desc);
1192 // Call the function from C++. 1192 // Call the function from C++.
1193 int result = FUNCTION_CAST<F0>(buffer)(); 1193 int result = FUNCTION_CAST<F0>(buffer)();
1194 CHECK_EQ(0, result); 1194 CHECK_EQ(0, result);
1195 } 1195 }
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
1262 TestSmiMul(masm, &exit, 0x60, 0x10000, 0xffff); 1262 TestSmiMul(masm, &exit, 0x60, 0x10000, 0xffff);
1263 TestSmiMul(masm, &exit, 0x70, 0x10000, 0xffff); 1263 TestSmiMul(masm, &exit, 0x70, 0x10000, 0xffff);
1264 TestSmiMul(masm, &exit, 0x80, Smi::kMaxValue, -1); 1264 TestSmiMul(masm, &exit, 0x80, Smi::kMaxValue, -1);
1265 TestSmiMul(masm, &exit, 0x90, Smi::kMaxValue, -2); 1265 TestSmiMul(masm, &exit, 0x90, Smi::kMaxValue, -2);
1266 TestSmiMul(masm, &exit, 0xa0, Smi::kMaxValue, 2); 1266 TestSmiMul(masm, &exit, 0xa0, Smi::kMaxValue, 2);
1267 TestSmiMul(masm, &exit, 0xb0, (Smi::kMaxValue / 2), 2); 1267 TestSmiMul(masm, &exit, 0xb0, (Smi::kMaxValue / 2), 2);
1268 TestSmiMul(masm, &exit, 0xc0, (Smi::kMaxValue / 2) + 1, 2); 1268 TestSmiMul(masm, &exit, 0xc0, (Smi::kMaxValue / 2) + 1, 2);
1269 TestSmiMul(masm, &exit, 0xd0, (Smi::kMinValue / 2), 2); 1269 TestSmiMul(masm, &exit, 0xd0, (Smi::kMinValue / 2), 2);
1270 TestSmiMul(masm, &exit, 0xe0, (Smi::kMinValue / 2) - 1, 2); 1270 TestSmiMul(masm, &exit, 0xe0, (Smi::kMinValue / 2) - 1, 2);
1271 1271
1272 __ xor_(rax, rax); // Success. 1272 __ xorq(rax, rax); // Success.
1273 __ bind(&exit); 1273 __ bind(&exit);
1274 ExitCode(masm); 1274 ExitCode(masm);
1275 __ ret(0); 1275 __ ret(0);
1276 1276
1277 CodeDesc desc; 1277 CodeDesc desc;
1278 masm->GetCode(&desc); 1278 masm->GetCode(&desc);
1279 // Call the function from C++. 1279 // Call the function from C++.
1280 int result = FUNCTION_CAST<F0>(buffer)(); 1280 int result = FUNCTION_CAST<F0>(buffer)();
1281 CHECK_EQ(0, result); 1281 CHECK_EQ(0, result);
1282 } 1282 }
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
1376 TestSmiDiv(masm, &exit, 0xc0, 1, Smi::kMaxValue); 1376 TestSmiDiv(masm, &exit, 0xc0, 1, Smi::kMaxValue);
1377 TestSmiDiv(masm, &exit, 0xd0, -1, Smi::kMaxValue); 1377 TestSmiDiv(masm, &exit, 0xd0, -1, Smi::kMaxValue);
1378 TestSmiDiv(masm, &exit, 0xe0, Smi::kMaxValue, 1); 1378 TestSmiDiv(masm, &exit, 0xe0, Smi::kMaxValue, 1);
1379 TestSmiDiv(masm, &exit, 0xf0, Smi::kMaxValue, Smi::kMaxValue); 1379 TestSmiDiv(masm, &exit, 0xf0, Smi::kMaxValue, Smi::kMaxValue);
1380 TestSmiDiv(masm, &exit, 0x100, Smi::kMaxValue, -Smi::kMaxValue); 1380 TestSmiDiv(masm, &exit, 0x100, Smi::kMaxValue, -Smi::kMaxValue);
1381 TestSmiDiv(masm, &exit, 0x110, Smi::kMaxValue, -1); 1381 TestSmiDiv(masm, &exit, 0x110, Smi::kMaxValue, -1);
1382 TestSmiDiv(masm, &exit, 0x120, Smi::kMinValue, 1); 1382 TestSmiDiv(masm, &exit, 0x120, Smi::kMinValue, 1);
1383 TestSmiDiv(masm, &exit, 0x130, Smi::kMinValue, Smi::kMinValue); 1383 TestSmiDiv(masm, &exit, 0x130, Smi::kMinValue, Smi::kMinValue);
1384 TestSmiDiv(masm, &exit, 0x140, Smi::kMinValue, -1); 1384 TestSmiDiv(masm, &exit, 0x140, Smi::kMinValue, -1);
1385 1385
1386 __ xor_(r15, r15); // Success. 1386 __ xorq(r15, r15); // Success.
1387 __ bind(&exit); 1387 __ bind(&exit);
1388 __ movq(rax, r15); 1388 __ movq(rax, r15);
1389 __ popq(r15); 1389 __ popq(r15);
1390 __ popq(r14); 1390 __ popq(r14);
1391 ExitCode(masm); 1391 ExitCode(masm);
1392 __ ret(0); 1392 __ ret(0);
1393 1393
1394 CodeDesc desc; 1394 CodeDesc desc;
1395 masm->GetCode(&desc); 1395 masm->GetCode(&desc);
1396 // Call the function from C++. 1396 // Call the function from C++.
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
1486 TestSmiMod(masm, &exit, 0xc0, 1, Smi::kMaxValue); 1486 TestSmiMod(masm, &exit, 0xc0, 1, Smi::kMaxValue);
1487 TestSmiMod(masm, &exit, 0xd0, -1, Smi::kMaxValue); 1487 TestSmiMod(masm, &exit, 0xd0, -1, Smi::kMaxValue);
1488 TestSmiMod(masm, &exit, 0xe0, Smi::kMaxValue, 1); 1488 TestSmiMod(masm, &exit, 0xe0, Smi::kMaxValue, 1);
1489 TestSmiMod(masm, &exit, 0xf0, Smi::kMaxValue, Smi::kMaxValue); 1489 TestSmiMod(masm, &exit, 0xf0, Smi::kMaxValue, Smi::kMaxValue);
1490 TestSmiMod(masm, &exit, 0x100, Smi::kMaxValue, -Smi::kMaxValue); 1490 TestSmiMod(masm, &exit, 0x100, Smi::kMaxValue, -Smi::kMaxValue);
1491 TestSmiMod(masm, &exit, 0x110, Smi::kMaxValue, -1); 1491 TestSmiMod(masm, &exit, 0x110, Smi::kMaxValue, -1);
1492 TestSmiMod(masm, &exit, 0x120, Smi::kMinValue, 1); 1492 TestSmiMod(masm, &exit, 0x120, Smi::kMinValue, 1);
1493 TestSmiMod(masm, &exit, 0x130, Smi::kMinValue, Smi::kMinValue); 1493 TestSmiMod(masm, &exit, 0x130, Smi::kMinValue, Smi::kMinValue);
1494 TestSmiMod(masm, &exit, 0x140, Smi::kMinValue, -1); 1494 TestSmiMod(masm, &exit, 0x140, Smi::kMinValue, -1);
1495 1495
1496 __ xor_(r15, r15); // Success. 1496 __ xorq(r15, r15); // Success.
1497 __ bind(&exit); 1497 __ bind(&exit);
1498 __ movq(rax, r15); 1498 __ movq(rax, r15);
1499 __ popq(r15); 1499 __ popq(r15);
1500 __ popq(r14); 1500 __ popq(r14);
1501 ExitCode(masm); 1501 ExitCode(masm);
1502 __ ret(0); 1502 __ ret(0);
1503 1503
1504 CodeDesc desc; 1504 CodeDesc desc;
1505 masm->GetCode(&desc); 1505 masm->GetCode(&desc);
1506 // Call the function from C++. 1506 // Call the function from C++.
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
1566 MacroAssembler* masm = &assembler; 1566 MacroAssembler* masm = &assembler;
1567 EntryCode(masm); 1567 EntryCode(masm);
1568 Label exit; 1568 Label exit;
1569 1569
1570 TestSmiIndex(masm, &exit, 0x10, 0); 1570 TestSmiIndex(masm, &exit, 0x10, 0);
1571 TestSmiIndex(masm, &exit, 0x20, 1); 1571 TestSmiIndex(masm, &exit, 0x20, 1);
1572 TestSmiIndex(masm, &exit, 0x30, 100); 1572 TestSmiIndex(masm, &exit, 0x30, 100);
1573 TestSmiIndex(masm, &exit, 0x40, 1000); 1573 TestSmiIndex(masm, &exit, 0x40, 1000);
1574 TestSmiIndex(masm, &exit, 0x50, Smi::kMaxValue); 1574 TestSmiIndex(masm, &exit, 0x50, Smi::kMaxValue);
1575 1575
1576 __ xor_(rax, rax); // Success. 1576 __ xorq(rax, rax); // Success.
1577 __ bind(&exit); 1577 __ bind(&exit);
1578 ExitCode(masm); 1578 ExitCode(masm);
1579 __ ret(0); 1579 __ ret(0);
1580 1580
1581 CodeDesc desc; 1581 CodeDesc desc;
1582 masm->GetCode(&desc); 1582 masm->GetCode(&desc);
1583 // Call the function from C++. 1583 // Call the function from C++.
1584 int result = FUNCTION_CAST<F0>(buffer)(); 1584 int result = FUNCTION_CAST<F0>(buffer)();
1585 CHECK_EQ(0, result); 1585 CHECK_EQ(0, result);
1586 } 1586 }
1587 1587
1588 1588
1589 void TestSelectNonSmi(MacroAssembler* masm, Label* exit, int id, int x, int y) { 1589 void TestSelectNonSmi(MacroAssembler* masm, Label* exit, int id, int x, int y) {
1590 __ movl(rax, Immediate(id)); 1590 __ movl(rax, Immediate(id));
1591 __ Move(rcx, Smi::FromInt(x)); 1591 __ Move(rcx, Smi::FromInt(x));
1592 __ Move(rdx, Smi::FromInt(y)); 1592 __ Move(rdx, Smi::FromInt(y));
1593 __ xor_(rdx, Immediate(kSmiTagMask)); 1593 __ xorq(rdx, Immediate(kSmiTagMask));
1594 __ SelectNonSmi(r9, rcx, rdx, exit); 1594 __ SelectNonSmi(r9, rcx, rdx, exit);
1595 1595
1596 __ incq(rax); 1596 __ incq(rax);
1597 __ cmpq(r9, rdx); 1597 __ cmpq(r9, rdx);
1598 __ j(not_equal, exit); 1598 __ j(not_equal, exit);
1599 1599
1600 __ incq(rax); 1600 __ incq(rax);
1601 __ Move(rcx, Smi::FromInt(x)); 1601 __ Move(rcx, Smi::FromInt(x));
1602 __ Move(rdx, Smi::FromInt(y)); 1602 __ Move(rdx, Smi::FromInt(y));
1603 __ xor_(rcx, Immediate(kSmiTagMask)); 1603 __ xorq(rcx, Immediate(kSmiTagMask));
1604 __ SelectNonSmi(r9, rcx, rdx, exit); 1604 __ SelectNonSmi(r9, rcx, rdx, exit);
1605 1605
1606 __ incq(rax); 1606 __ incq(rax);
1607 __ cmpq(r9, rcx); 1607 __ cmpq(r9, rcx);
1608 __ j(not_equal, exit); 1608 __ j(not_equal, exit);
1609 1609
1610 __ incq(rax); 1610 __ incq(rax);
1611 Label fail_ok; 1611 Label fail_ok;
1612 __ Move(rcx, Smi::FromInt(x)); 1612 __ Move(rcx, Smi::FromInt(x));
1613 __ Move(rdx, Smi::FromInt(y)); 1613 __ Move(rdx, Smi::FromInt(y));
1614 __ xor_(rcx, Immediate(kSmiTagMask)); 1614 __ xorq(rcx, Immediate(kSmiTagMask));
1615 __ xor_(rdx, Immediate(kSmiTagMask)); 1615 __ xorq(rdx, Immediate(kSmiTagMask));
1616 __ SelectNonSmi(r9, rcx, rdx, &fail_ok); 1616 __ SelectNonSmi(r9, rcx, rdx, &fail_ok);
1617 __ jmp(exit); 1617 __ jmp(exit);
1618 __ bind(&fail_ok); 1618 __ bind(&fail_ok);
1619 } 1619 }
1620 1620
1621 1621
1622 TEST(SmiSelectNonSmi) { 1622 TEST(SmiSelectNonSmi) {
1623 i::V8::Initialize(NULL); 1623 i::V8::Initialize(NULL);
1624 // Allocate an executable page of memory. 1624 // Allocate an executable page of memory.
1625 size_t actual_size; 1625 size_t actual_size;
(...skipping 13 matching lines...) Expand all
1639 TestSelectNonSmi(masm, &exit, 0x10, 0, 0); 1639 TestSelectNonSmi(masm, &exit, 0x10, 0, 0);
1640 TestSelectNonSmi(masm, &exit, 0x20, 0, 1); 1640 TestSelectNonSmi(masm, &exit, 0x20, 0, 1);
1641 TestSelectNonSmi(masm, &exit, 0x30, 1, 0); 1641 TestSelectNonSmi(masm, &exit, 0x30, 1, 0);
1642 TestSelectNonSmi(masm, &exit, 0x40, 0, -1); 1642 TestSelectNonSmi(masm, &exit, 0x40, 0, -1);
1643 TestSelectNonSmi(masm, &exit, 0x50, -1, 0); 1643 TestSelectNonSmi(masm, &exit, 0x50, -1, 0);
1644 TestSelectNonSmi(masm, &exit, 0x60, -1, -1); 1644 TestSelectNonSmi(masm, &exit, 0x60, -1, -1);
1645 TestSelectNonSmi(masm, &exit, 0x70, 1, 1); 1645 TestSelectNonSmi(masm, &exit, 0x70, 1, 1);
1646 TestSelectNonSmi(masm, &exit, 0x80, Smi::kMinValue, Smi::kMaxValue); 1646 TestSelectNonSmi(masm, &exit, 0x80, Smi::kMinValue, Smi::kMaxValue);
1647 TestSelectNonSmi(masm, &exit, 0x90, Smi::kMinValue, Smi::kMinValue); 1647 TestSelectNonSmi(masm, &exit, 0x90, Smi::kMinValue, Smi::kMinValue);
1648 1648
1649 __ xor_(rax, rax); // Success. 1649 __ xorq(rax, rax); // Success.
1650 __ bind(&exit); 1650 __ bind(&exit);
1651 ExitCode(masm); 1651 ExitCode(masm);
1652 __ ret(0); 1652 __ ret(0);
1653 1653
1654 CodeDesc desc; 1654 CodeDesc desc;
1655 masm->GetCode(&desc); 1655 masm->GetCode(&desc);
1656 // Call the function from C++. 1656 // Call the function from C++.
1657 int result = FUNCTION_CAST<F0>(buffer)(); 1657 int result = FUNCTION_CAST<F0>(buffer)();
1658 CHECK_EQ(0, result); 1658 CHECK_EQ(0, result);
1659 } 1659 }
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1720 TestSmiAnd(masm, &exit, 0x30, 1, 0); 1720 TestSmiAnd(masm, &exit, 0x30, 1, 0);
1721 TestSmiAnd(masm, &exit, 0x40, 0, -1); 1721 TestSmiAnd(masm, &exit, 0x40, 0, -1);
1722 TestSmiAnd(masm, &exit, 0x50, -1, 0); 1722 TestSmiAnd(masm, &exit, 0x50, -1, 0);
1723 TestSmiAnd(masm, &exit, 0x60, -1, -1); 1723 TestSmiAnd(masm, &exit, 0x60, -1, -1);
1724 TestSmiAnd(masm, &exit, 0x70, 1, 1); 1724 TestSmiAnd(masm, &exit, 0x70, 1, 1);
1725 TestSmiAnd(masm, &exit, 0x80, Smi::kMinValue, Smi::kMaxValue); 1725 TestSmiAnd(masm, &exit, 0x80, Smi::kMinValue, Smi::kMaxValue);
1726 TestSmiAnd(masm, &exit, 0x90, Smi::kMinValue, Smi::kMinValue); 1726 TestSmiAnd(masm, &exit, 0x90, Smi::kMinValue, Smi::kMinValue);
1727 TestSmiAnd(masm, &exit, 0xA0, Smi::kMinValue, -1); 1727 TestSmiAnd(masm, &exit, 0xA0, Smi::kMinValue, -1);
1728 TestSmiAnd(masm, &exit, 0xB0, Smi::kMinValue, -1); 1728 TestSmiAnd(masm, &exit, 0xB0, Smi::kMinValue, -1);
1729 1729
1730 __ xor_(rax, rax); // Success. 1730 __ xorq(rax, rax); // Success.
1731 __ bind(&exit); 1731 __ bind(&exit);
1732 ExitCode(masm); 1732 ExitCode(masm);
1733 __ ret(0); 1733 __ ret(0);
1734 1734
1735 CodeDesc desc; 1735 CodeDesc desc;
1736 masm->GetCode(&desc); 1736 masm->GetCode(&desc);
1737 // Call the function from C++. 1737 // Call the function from C++.
1738 int result = FUNCTION_CAST<F0>(buffer)(); 1738 int result = FUNCTION_CAST<F0>(buffer)();
1739 CHECK_EQ(0, result); 1739 CHECK_EQ(0, result);
1740 } 1740 }
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
1803 TestSmiOr(masm, &exit, 0x50, -1, 0); 1803 TestSmiOr(masm, &exit, 0x50, -1, 0);
1804 TestSmiOr(masm, &exit, 0x60, -1, -1); 1804 TestSmiOr(masm, &exit, 0x60, -1, -1);
1805 TestSmiOr(masm, &exit, 0x70, 1, 1); 1805 TestSmiOr(masm, &exit, 0x70, 1, 1);
1806 TestSmiOr(masm, &exit, 0x80, Smi::kMinValue, Smi::kMaxValue); 1806 TestSmiOr(masm, &exit, 0x80, Smi::kMinValue, Smi::kMaxValue);
1807 TestSmiOr(masm, &exit, 0x90, Smi::kMinValue, Smi::kMinValue); 1807 TestSmiOr(masm, &exit, 0x90, Smi::kMinValue, Smi::kMinValue);
1808 TestSmiOr(masm, &exit, 0xA0, Smi::kMinValue, -1); 1808 TestSmiOr(masm, &exit, 0xA0, Smi::kMinValue, -1);
1809 TestSmiOr(masm, &exit, 0xB0, 0x05555555, 0x01234567); 1809 TestSmiOr(masm, &exit, 0xB0, 0x05555555, 0x01234567);
1810 TestSmiOr(masm, &exit, 0xC0, 0x05555555, 0x0fedcba9); 1810 TestSmiOr(masm, &exit, 0xC0, 0x05555555, 0x0fedcba9);
1811 TestSmiOr(masm, &exit, 0xD0, Smi::kMinValue, -1); 1811 TestSmiOr(masm, &exit, 0xD0, Smi::kMinValue, -1);
1812 1812
1813 __ xor_(rax, rax); // Success. 1813 __ xorq(rax, rax); // Success.
1814 __ bind(&exit); 1814 __ bind(&exit);
1815 ExitCode(masm); 1815 ExitCode(masm);
1816 __ ret(0); 1816 __ ret(0);
1817 1817
1818 CodeDesc desc; 1818 CodeDesc desc;
1819 masm->GetCode(&desc); 1819 masm->GetCode(&desc);
1820 // Call the function from C++. 1820 // Call the function from C++.
1821 int result = FUNCTION_CAST<F0>(buffer)(); 1821 int result = FUNCTION_CAST<F0>(buffer)();
1822 CHECK_EQ(0, result); 1822 CHECK_EQ(0, result);
1823 } 1823 }
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
1886 TestSmiXor(masm, &exit, 0x50, -1, 0); 1886 TestSmiXor(masm, &exit, 0x50, -1, 0);
1887 TestSmiXor(masm, &exit, 0x60, -1, -1); 1887 TestSmiXor(masm, &exit, 0x60, -1, -1);
1888 TestSmiXor(masm, &exit, 0x70, 1, 1); 1888 TestSmiXor(masm, &exit, 0x70, 1, 1);
1889 TestSmiXor(masm, &exit, 0x80, Smi::kMinValue, Smi::kMaxValue); 1889 TestSmiXor(masm, &exit, 0x80, Smi::kMinValue, Smi::kMaxValue);
1890 TestSmiXor(masm, &exit, 0x90, Smi::kMinValue, Smi::kMinValue); 1890 TestSmiXor(masm, &exit, 0x90, Smi::kMinValue, Smi::kMinValue);
1891 TestSmiXor(masm, &exit, 0xA0, Smi::kMinValue, -1); 1891 TestSmiXor(masm, &exit, 0xA0, Smi::kMinValue, -1);
1892 TestSmiXor(masm, &exit, 0xB0, 0x5555555, 0x01234567); 1892 TestSmiXor(masm, &exit, 0xB0, 0x5555555, 0x01234567);
1893 TestSmiXor(masm, &exit, 0xC0, 0x5555555, 0x0fedcba9); 1893 TestSmiXor(masm, &exit, 0xC0, 0x5555555, 0x0fedcba9);
1894 TestSmiXor(masm, &exit, 0xD0, Smi::kMinValue, -1); 1894 TestSmiXor(masm, &exit, 0xD0, Smi::kMinValue, -1);
1895 1895
1896 __ xor_(rax, rax); // Success. 1896 __ xorq(rax, rax); // Success.
1897 __ bind(&exit); 1897 __ bind(&exit);
1898 ExitCode(masm); 1898 ExitCode(masm);
1899 __ ret(0); 1899 __ ret(0);
1900 1900
1901 CodeDesc desc; 1901 CodeDesc desc;
1902 masm->GetCode(&desc); 1902 masm->GetCode(&desc);
1903 // Call the function from C++. 1903 // Call the function from C++.
1904 int result = FUNCTION_CAST<F0>(buffer)(); 1904 int result = FUNCTION_CAST<F0>(buffer)();
1905 CHECK_EQ(0, result); 1905 CHECK_EQ(0, result);
1906 } 1906 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
1948 1948
1949 TestSmiNot(masm, &exit, 0x10, 0); 1949 TestSmiNot(masm, &exit, 0x10, 0);
1950 TestSmiNot(masm, &exit, 0x20, 1); 1950 TestSmiNot(masm, &exit, 0x20, 1);
1951 TestSmiNot(masm, &exit, 0x30, -1); 1951 TestSmiNot(masm, &exit, 0x30, -1);
1952 TestSmiNot(masm, &exit, 0x40, 127); 1952 TestSmiNot(masm, &exit, 0x40, 127);
1953 TestSmiNot(masm, &exit, 0x50, 65535); 1953 TestSmiNot(masm, &exit, 0x50, 65535);
1954 TestSmiNot(masm, &exit, 0x60, Smi::kMinValue); 1954 TestSmiNot(masm, &exit, 0x60, Smi::kMinValue);
1955 TestSmiNot(masm, &exit, 0x70, Smi::kMaxValue); 1955 TestSmiNot(masm, &exit, 0x70, Smi::kMaxValue);
1956 TestSmiNot(masm, &exit, 0x80, 0x05555555); 1956 TestSmiNot(masm, &exit, 0x80, 0x05555555);
1957 1957
1958 __ xor_(rax, rax); // Success. 1958 __ xorq(rax, rax); // Success.
1959 __ bind(&exit); 1959 __ bind(&exit);
1960 ExitCode(masm); 1960 ExitCode(masm);
1961 __ ret(0); 1961 __ ret(0);
1962 1962
1963 CodeDesc desc; 1963 CodeDesc desc;
1964 masm->GetCode(&desc); 1964 masm->GetCode(&desc);
1965 // Call the function from C++. 1965 // Call the function from C++.
1966 int result = FUNCTION_CAST<F0>(buffer)(); 1966 int result = FUNCTION_CAST<F0>(buffer)();
1967 CHECK_EQ(0, result); 1967 CHECK_EQ(0, result);
1968 } 1968 }
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
2043 Label exit; 2043 Label exit;
2044 2044
2045 TestSmiShiftLeft(masm, &exit, 0x10, 0); 2045 TestSmiShiftLeft(masm, &exit, 0x10, 0);
2046 TestSmiShiftLeft(masm, &exit, 0x50, 1); 2046 TestSmiShiftLeft(masm, &exit, 0x50, 1);
2047 TestSmiShiftLeft(masm, &exit, 0x90, 127); 2047 TestSmiShiftLeft(masm, &exit, 0x90, 127);
2048 TestSmiShiftLeft(masm, &exit, 0xD0, 65535); 2048 TestSmiShiftLeft(masm, &exit, 0xD0, 65535);
2049 TestSmiShiftLeft(masm, &exit, 0x110, Smi::kMaxValue); 2049 TestSmiShiftLeft(masm, &exit, 0x110, Smi::kMaxValue);
2050 TestSmiShiftLeft(masm, &exit, 0x150, Smi::kMinValue); 2050 TestSmiShiftLeft(masm, &exit, 0x150, Smi::kMinValue);
2051 TestSmiShiftLeft(masm, &exit, 0x190, -1); 2051 TestSmiShiftLeft(masm, &exit, 0x190, -1);
2052 2052
2053 __ xor_(rax, rax); // Success. 2053 __ xorq(rax, rax); // Success.
2054 __ bind(&exit); 2054 __ bind(&exit);
2055 ExitCode(masm); 2055 ExitCode(masm);
2056 __ ret(0); 2056 __ ret(0);
2057 2057
2058 CodeDesc desc; 2058 CodeDesc desc;
2059 masm->GetCode(&desc); 2059 masm->GetCode(&desc);
2060 // Call the function from C++. 2060 // Call the function from C++.
2061 int result = FUNCTION_CAST<F0>(buffer)(); 2061 int result = FUNCTION_CAST<F0>(buffer)();
2062 CHECK_EQ(0, result); 2062 CHECK_EQ(0, result);
2063 } 2063 }
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
2149 Label exit; 2149 Label exit;
2150 2150
2151 TestSmiShiftLogicalRight(masm, &exit, 0x10, 0); 2151 TestSmiShiftLogicalRight(masm, &exit, 0x10, 0);
2152 TestSmiShiftLogicalRight(masm, &exit, 0x30, 1); 2152 TestSmiShiftLogicalRight(masm, &exit, 0x30, 1);
2153 TestSmiShiftLogicalRight(masm, &exit, 0x50, 127); 2153 TestSmiShiftLogicalRight(masm, &exit, 0x50, 127);
2154 TestSmiShiftLogicalRight(masm, &exit, 0x70, 65535); 2154 TestSmiShiftLogicalRight(masm, &exit, 0x70, 65535);
2155 TestSmiShiftLogicalRight(masm, &exit, 0x90, Smi::kMaxValue); 2155 TestSmiShiftLogicalRight(masm, &exit, 0x90, Smi::kMaxValue);
2156 TestSmiShiftLogicalRight(masm, &exit, 0xB0, Smi::kMinValue); 2156 TestSmiShiftLogicalRight(masm, &exit, 0xB0, Smi::kMinValue);
2157 TestSmiShiftLogicalRight(masm, &exit, 0xD0, -1); 2157 TestSmiShiftLogicalRight(masm, &exit, 0xD0, -1);
2158 2158
2159 __ xor_(rax, rax); // Success. 2159 __ xorq(rax, rax); // Success.
2160 __ bind(&exit); 2160 __ bind(&exit);
2161 ExitCode(masm); 2161 ExitCode(masm);
2162 __ ret(0); 2162 __ ret(0);
2163 2163
2164 CodeDesc desc; 2164 CodeDesc desc;
2165 masm->GetCode(&desc); 2165 masm->GetCode(&desc);
2166 // Call the function from C++. 2166 // Call the function from C++.
2167 int result = FUNCTION_CAST<F0>(buffer)(); 2167 int result = FUNCTION_CAST<F0>(buffer)();
2168 CHECK_EQ(0, result); 2168 CHECK_EQ(0, result);
2169 } 2169 }
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
2218 Label exit; 2218 Label exit;
2219 2219
2220 TestSmiShiftArithmeticRight(masm, &exit, 0x10, 0); 2220 TestSmiShiftArithmeticRight(masm, &exit, 0x10, 0);
2221 TestSmiShiftArithmeticRight(masm, &exit, 0x20, 1); 2221 TestSmiShiftArithmeticRight(masm, &exit, 0x20, 1);
2222 TestSmiShiftArithmeticRight(masm, &exit, 0x30, 127); 2222 TestSmiShiftArithmeticRight(masm, &exit, 0x30, 127);
2223 TestSmiShiftArithmeticRight(masm, &exit, 0x40, 65535); 2223 TestSmiShiftArithmeticRight(masm, &exit, 0x40, 65535);
2224 TestSmiShiftArithmeticRight(masm, &exit, 0x50, Smi::kMaxValue); 2224 TestSmiShiftArithmeticRight(masm, &exit, 0x50, Smi::kMaxValue);
2225 TestSmiShiftArithmeticRight(masm, &exit, 0x60, Smi::kMinValue); 2225 TestSmiShiftArithmeticRight(masm, &exit, 0x60, Smi::kMinValue);
2226 TestSmiShiftArithmeticRight(masm, &exit, 0x70, -1); 2226 TestSmiShiftArithmeticRight(masm, &exit, 0x70, -1);
2227 2227
2228 __ xor_(rax, rax); // Success. 2228 __ xorq(rax, rax); // Success.
2229 __ bind(&exit); 2229 __ bind(&exit);
2230 ExitCode(masm); 2230 ExitCode(masm);
2231 __ ret(0); 2231 __ ret(0);
2232 2232
2233 CodeDesc desc; 2233 CodeDesc desc;
2234 masm->GetCode(&desc); 2234 masm->GetCode(&desc);
2235 // Call the function from C++. 2235 // Call the function from C++.
2236 int result = FUNCTION_CAST<F0>(buffer)(); 2236 int result = FUNCTION_CAST<F0>(buffer)();
2237 CHECK_EQ(0, result); 2237 CHECK_EQ(0, result);
2238 } 2238 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
2284 TestPositiveSmiPowerUp(masm, &exit, 0x20, 0); 2284 TestPositiveSmiPowerUp(masm, &exit, 0x20, 0);
2285 TestPositiveSmiPowerUp(masm, &exit, 0x40, 1); 2285 TestPositiveSmiPowerUp(masm, &exit, 0x40, 1);
2286 TestPositiveSmiPowerUp(masm, &exit, 0x60, 127); 2286 TestPositiveSmiPowerUp(masm, &exit, 0x60, 127);
2287 TestPositiveSmiPowerUp(masm, &exit, 0x80, 128); 2287 TestPositiveSmiPowerUp(masm, &exit, 0x80, 128);
2288 TestPositiveSmiPowerUp(masm, &exit, 0xA0, 255); 2288 TestPositiveSmiPowerUp(masm, &exit, 0xA0, 255);
2289 TestPositiveSmiPowerUp(masm, &exit, 0xC0, 256); 2289 TestPositiveSmiPowerUp(masm, &exit, 0xC0, 256);
2290 TestPositiveSmiPowerUp(masm, &exit, 0x100, 65535); 2290 TestPositiveSmiPowerUp(masm, &exit, 0x100, 65535);
2291 TestPositiveSmiPowerUp(masm, &exit, 0x120, 65536); 2291 TestPositiveSmiPowerUp(masm, &exit, 0x120, 65536);
2292 TestPositiveSmiPowerUp(masm, &exit, 0x140, Smi::kMaxValue); 2292 TestPositiveSmiPowerUp(masm, &exit, 0x140, Smi::kMaxValue);
2293 2293
2294 __ xor_(rax, rax); // Success. 2294 __ xorq(rax, rax); // Success.
2295 __ bind(&exit); 2295 __ bind(&exit);
2296 ExitCode(masm); 2296 ExitCode(masm);
2297 __ ret(0); 2297 __ ret(0);
2298 2298
2299 CodeDesc desc; 2299 CodeDesc desc;
2300 masm->GetCode(&desc); 2300 masm->GetCode(&desc);
2301 // Call the function from C++. 2301 // Call the function from C++.
2302 int result = FUNCTION_CAST<F0>(buffer)(); 2302 int result = FUNCTION_CAST<F0>(buffer)();
2303 CHECK_EQ(0, result); 2303 CHECK_EQ(0, result);
2304 } 2304 }
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
2789 __ movq(rcx, Immediate(-1)); 2789 __ movq(rcx, Immediate(-1));
2790 __ Store(Operand(rsp, 0 * kPointerSize), rcx, Representation::UInteger16()); 2790 __ Store(Operand(rsp, 0 * kPointerSize), rcx, Representation::UInteger16());
2791 __ movq(rcx, Operand(rsp, 0 * kPointerSize)); 2791 __ movq(rcx, Operand(rsp, 0 * kPointerSize));
2792 __ movl(rdx, Immediate(65535)); 2792 __ movl(rdx, Immediate(65535));
2793 __ cmpq(rcx, rdx); 2793 __ cmpq(rcx, rdx);
2794 __ j(not_equal, &exit); 2794 __ j(not_equal, &exit);
2795 __ Load(rdx, Operand(rsp, 0 * kPointerSize), Representation::UInteger16()); 2795 __ Load(rdx, Operand(rsp, 0 * kPointerSize), Representation::UInteger16());
2796 __ cmpq(rcx, rdx); 2796 __ cmpq(rcx, rdx);
2797 __ j(not_equal, &exit); 2797 __ j(not_equal, &exit);
2798 2798
2799 __ xor_(rax, rax); // Success. 2799 __ xorq(rax, rax); // Success.
2800 __ bind(&exit); 2800 __ bind(&exit);
2801 __ addq(rsp, Immediate(1 * kPointerSize)); 2801 __ addq(rsp, Immediate(1 * kPointerSize));
2802 ExitCode(masm); 2802 ExitCode(masm);
2803 __ ret(0); 2803 __ ret(0);
2804 2804
2805 CodeDesc desc; 2805 CodeDesc desc;
2806 masm->GetCode(&desc); 2806 masm->GetCode(&desc);
2807 // Call the function from C++. 2807 // Call the function from C++.
2808 int result = FUNCTION_CAST<F0>(buffer)(); 2808 int result = FUNCTION_CAST<F0>(buffer)();
2809 CHECK_EQ(0, result); 2809 CHECK_EQ(0, result);
2810 } 2810 }
2811 2811
2812 2812
2813 #undef __ 2813 #undef __
OLDNEW
« no previous file with comments | « test/cctest/test-disasm-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698