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" | 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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
344 EXPECT_EQ(8000, reinterpret_cast<SignedMultiply>(entry)()); | 344 EXPECT_EQ(8000, reinterpret_cast<SignedMultiply>(entry)()); |
345 } | 345 } |
346 | 346 |
347 | 347 |
348 ASSEMBLER_TEST_GENERATE(SignedMultiply64, assembler) { | 348 ASSEMBLER_TEST_GENERATE(SignedMultiply64, assembler) { |
349 __ movq(RAX, Immediate(2)); | 349 __ movq(RAX, Immediate(2)); |
350 __ movq(RCX, Immediate(4)); | 350 __ movq(RCX, Immediate(4)); |
351 __ imulq(RAX, RCX); | 351 __ imulq(RAX, RCX); |
352 __ movq(R8, Immediate(2)); | 352 __ movq(R8, Immediate(2)); |
353 __ movq(R9, Immediate(4)); | 353 __ movq(R9, Immediate(4)); |
354 __ imulq(R8, R9); | 354 __ pushq(R9); |
355 __ imulq(R8, Address(RSP, 0)); | |
356 __ popq(R9); | |
355 __ addq(RAX, R8); | 357 __ addq(RAX, R8); |
356 __ ret(); | 358 __ ret(); |
357 } | 359 } |
358 | 360 |
359 | 361 |
360 ASSEMBLER_TEST_RUN(SignedMultiply64, entry) { | 362 ASSEMBLER_TEST_RUN(SignedMultiply64, entry) { |
361 typedef int64_t (*SignedMultiply64)(); | 363 typedef int64_t (*SignedMultiply64)(); |
362 EXPECT_EQ(16, reinterpret_cast<SignedMultiply64>(entry)()); | 364 EXPECT_EQ(16, reinterpret_cast<SignedMultiply64>(entry)()); |
363 } | 365 } |
364 | 366 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
513 __ ret(); | 515 __ ret(); |
514 } | 516 } |
515 | 517 |
516 | 518 |
517 ASSEMBLER_TEST_RUN(Bitwise, entry) { | 519 ASSEMBLER_TEST_RUN(Bitwise, entry) { |
518 typedef int (*Bitwise)(); | 520 typedef int (*Bitwise)(); |
519 EXPECT_EQ(256 + 1, reinterpret_cast<Bitwise>(entry)()); | 521 EXPECT_EQ(256 + 1, reinterpret_cast<Bitwise>(entry)()); |
520 } | 522 } |
521 | 523 |
522 | 524 |
525 ASSEMBLER_TEST_GENERATE(Bitwise64, assembler) { | |
526 Label error; | |
527 __ movq(RAX, Immediate(42)); | |
528 __ pushq(RAX); | |
529 __ xorq(RAX, Address(RSP, 0)); | |
530 __ popq(RCX); | |
531 __ cmpq(RAX, Immediate(0)); | |
532 __ j(NOT_EQUAL, &error); | |
533 __ xorq(RCX, RCX); | |
534 __ orq(RCX, Immediate(256)); | |
535 __ movq(RAX, Immediate(4)); | |
536 __ orq(RCX, RAX); | |
537 __ movq(RAX, Immediate(0xfff0)); | |
538 __ andq(RCX, RAX); | |
539 __ movq(RAX, Immediate(1)); | |
540 __ pushq(RAX); | |
541 __ orq(RCX, Address(RSP, 0)); | |
542 __ popq(RAX); | |
543 __ movq(RAX, RCX); | |
544 __ ret(); | |
545 __ Bind(&error); | |
546 __ movq(RAX, Immediate(-1)); | |
547 __ ret(); | |
548 } | |
549 | |
550 | |
551 ASSEMBLER_TEST_RUN(Bitwise64, entry) { | |
552 typedef int (*Bitwise64)(); | |
553 EXPECT_EQ(256 + 1, reinterpret_cast<Bitwise64>(entry)()); | |
554 } | |
555 | |
556 | |
523 ASSEMBLER_TEST_GENERATE(LogicalOps, assembler) { | 557 ASSEMBLER_TEST_GENERATE(LogicalOps, assembler) { |
524 Label donetest1; | 558 Label donetest1; |
525 __ movl(RAX, Immediate(4)); | 559 __ movq(RAX, Immediate(4)); |
526 __ andl(RAX, Immediate(2)); | 560 __ andq(RAX, Immediate(2)); |
527 __ cmpl(RAX, Immediate(0)); | 561 __ cmpq(RAX, Immediate(0)); |
528 __ j(EQUAL, &donetest1); | 562 __ j(EQUAL, &donetest1); |
529 // Be sure to skip this crashing code. | 563 // Be sure to skip this crashing code. |
530 __ movl(RAX, Immediate(0)); | 564 __ movq(RAX, Immediate(0)); |
531 __ movl(Address(RAX, 0), RAX); | 565 __ movq(Address(RAX, 0), RAX); |
532 __ Bind(&donetest1); | 566 __ Bind(&donetest1); |
533 | 567 |
534 Label donetest2; | 568 Label donetest2; |
535 __ movl(RCX, Immediate(4)); | 569 __ movq(RCX, Immediate(4)); |
536 __ andl(RCX, Immediate(4)); | 570 __ pushq(RCX); |
537 __ cmpl(RCX, Immediate(0)); | 571 __ andq(RCX, Address(RSP, 0)); |
572 __ popq(RAX); | |
573 __ cmpq(RCX, Immediate(0)); | |
538 __ j(NOT_EQUAL, &donetest2); | 574 __ j(NOT_EQUAL, &donetest2); |
539 // Be sure to skip this crashing code. | 575 // Be sure to skip this crashing code. |
540 __ movl(RAX, Immediate(0)); | 576 __ movq(RAX, Immediate(0)); |
541 __ movl(Address(RAX, 0), RAX); | 577 __ movq(Address(RAX, 0), RAX); |
542 __ Bind(&donetest2); | 578 __ Bind(&donetest2); |
543 | 579 |
544 Label donetest3; | 580 Label donetest3; |
545 __ movl(RAX, Immediate(0)); | 581 __ movq(RAX, Immediate(0)); |
546 __ orl(RAX, Immediate(0)); | 582 __ orq(RAX, Immediate(0)); |
547 __ cmpl(RAX, Immediate(0)); | 583 __ cmpq(RAX, Immediate(0)); |
548 __ j(EQUAL, &donetest3); | 584 __ j(EQUAL, &donetest3); |
549 // Be sure to skip this crashing code. | 585 // Be sure to skip this crashing code. |
550 __ movl(RAX, Immediate(0)); | 586 __ movq(RAX, Immediate(0)); |
551 __ movl(Address(RAX, 0), RAX); | 587 __ movq(Address(RAX, 0), RAX); |
552 __ Bind(&donetest3); | 588 __ Bind(&donetest3); |
553 | 589 |
554 Label donetest4; | 590 Label donetest4; |
555 __ movl(RAX, Immediate(4)); | 591 __ movq(RAX, Immediate(4)); |
556 __ orl(RAX, Immediate(0)); | 592 __ orq(RAX, Immediate(0)); |
557 __ cmpl(RAX, Immediate(0)); | 593 __ cmpq(RAX, Immediate(0)); |
558 __ j(NOT_EQUAL, &donetest4); | 594 __ j(NOT_EQUAL, &donetest4); |
559 // Be sure to skip this crashing code. | 595 // Be sure to skip this crashing code. |
560 __ movl(RAX, Immediate(0)); | 596 __ movq(RAX, Immediate(0)); |
561 __ movl(Address(RAX, 0), RAX); | 597 __ movq(Address(RAX, 0), RAX); |
562 __ Bind(&donetest4); | 598 __ Bind(&donetest4); |
563 | 599 |
564 Label donetest5; | 600 Label donetest5; |
565 __ pushq(RAX); | 601 __ pushq(RAX); |
566 __ movl(RAX, Immediate(0xff)); | 602 __ movq(RAX, Immediate(0xff)); |
567 __ movl(Address(RSP, 0), RAX); | 603 __ movq(Address(RSP, 0), RAX); |
568 __ cmpl(Address(RSP, 0), Immediate(0xff)); | 604 __ cmpq(Address(RSP, 0), Immediate(0xff)); |
569 __ j(EQUAL, &donetest5); | 605 __ j(EQUAL, &donetest5); |
570 // Be sure to skip this crashing code. | 606 // Be sure to skip this crashing code. |
571 __ movq(RAX, Immediate(0)); | 607 __ movq(RAX, Immediate(0)); |
572 __ movq(Address(RAX, 0), RAX); | 608 __ movq(Address(RAX, 0), RAX); |
573 __ Bind(&donetest5); | 609 __ Bind(&donetest5); |
574 __ popq(RAX); | 610 __ popq(RAX); |
575 | 611 |
576 Label donetest6; | 612 Label donetest6; |
577 __ movl(RAX, Immediate(1)); | 613 __ movq(RAX, Immediate(1)); |
578 __ shll(RAX, Immediate(3)); | 614 __ shlq(RAX, Immediate(3)); |
579 __ cmpl(RAX, Immediate(8)); | 615 __ cmpq(RAX, Immediate(8)); |
580 __ j(EQUAL, &donetest6); | 616 __ j(EQUAL, &donetest6); |
581 // Be sure to skip this crashing code. | 617 // Be sure to skip this crashing code. |
582 __ movl(RAX, Immediate(0)); | 618 __ movq(RAX, Immediate(0)); |
583 __ movl(Address(RAX, 0), RAX); | 619 __ movq(Address(RAX, 0), RAX); |
584 __ Bind(&donetest6); | 620 __ Bind(&donetest6); |
585 | 621 |
586 Label donetest7; | 622 Label donetest7; |
587 __ movl(RAX, Immediate(2)); | 623 __ movq(RAX, Immediate(2)); |
588 __ shrl(RAX, Immediate(1)); | 624 __ shrq(RAX, Immediate(1)); |
589 __ cmpl(RAX, Immediate(1)); | 625 __ cmpq(RAX, Immediate(1)); |
590 __ j(EQUAL, &donetest7); | 626 __ j(EQUAL, &donetest7); |
591 // Be sure to skip this crashing code. | 627 // Be sure to skip this crashing code. |
592 __ movl(RAX, Immediate(0)); | 628 __ movq(RAX, Immediate(0)); |
593 __ movl(Address(RAX, 0), RAX); | 629 __ movq(Address(RAX, 0), RAX); |
594 __ Bind(&donetest7); | 630 __ Bind(&donetest7); |
595 | 631 |
596 Label donetest8; | 632 Label donetest8; |
597 __ movl(RAX, Immediate(8)); | 633 __ movq(RAX, Immediate(8)); |
598 __ shrl(RAX, Immediate(3)); | 634 __ shrq(RAX, Immediate(3)); |
599 __ cmpl(RAX, Immediate(1)); | 635 __ cmpq(RAX, Immediate(1)); |
600 __ j(EQUAL, &donetest8); | 636 __ j(EQUAL, &donetest8); |
601 // Be sure to skip this crashing code. | 637 // Be sure to skip this crashing code. |
602 __ movl(RAX, Immediate(0)); | 638 __ movq(RAX, Immediate(0)); |
603 __ movl(Address(RAX, 0), RAX); | 639 __ movq(Address(RAX, 0), RAX); |
604 __ Bind(&donetest8); | 640 __ Bind(&donetest8); |
605 | 641 |
606 Label donetest9; | 642 Label donetest9; |
607 __ movl(RAX, Immediate(1)); | 643 __ movq(RAX, Immediate(1)); |
608 __ movl(RCX, Immediate(3)); | 644 __ movq(RCX, Immediate(3)); |
609 __ shll(RAX, RCX); | 645 __ shlq(RAX, RCX); |
610 __ cmpl(RAX, Immediate(8)); | 646 __ cmpq(RAX, Immediate(8)); |
611 __ j(EQUAL, &donetest9); | 647 __ j(EQUAL, &donetest9); |
612 // Be sure to skip this crashing code. | 648 // Be sure to skip this crashing code. |
613 __ movl(RAX, Immediate(0)); | 649 __ movq(RAX, Immediate(0)); |
614 __ movl(Address(RAX, 0), RAX); | 650 __ movq(Address(RAX, 0), RAX); |
615 __ Bind(&donetest9); | 651 __ Bind(&donetest9); |
616 | 652 |
617 Label donetest10; | 653 Label donetest10; |
618 __ movl(RAX, Immediate(8)); | 654 __ movq(RAX, Immediate(8)); |
619 __ movl(RCX, Immediate(3)); | 655 __ movq(RCX, Immediate(3)); |
620 __ shrl(RAX, RCX); | 656 __ shrq(RAX, RCX); |
621 __ cmpl(RAX, Immediate(1)); | 657 __ cmpq(RAX, Immediate(1)); |
622 __ j(EQUAL, &donetest10); | 658 __ j(EQUAL, &donetest10); |
623 // Be sure to skip this crashing code. | 659 // Be sure to skip this crashing code. |
624 __ movl(RAX, Immediate(0)); | 660 __ movq(RAX, Immediate(0)); |
625 __ movl(Address(RAX, 0), RAX); | 661 __ movq(Address(RAX, 0), RAX); |
626 __ Bind(&donetest10); | 662 __ Bind(&donetest10); |
627 | 663 |
628 Label donetest6a; | 664 Label donetest6a; |
629 __ movl(RAX, Immediate(1)); | 665 __ movq(RAX, Immediate(1)); |
630 __ shlq(RAX, Immediate(3)); | 666 __ shlq(RAX, Immediate(3)); |
631 __ cmpl(RAX, Immediate(8)); | 667 __ cmpq(RAX, Immediate(8)); |
632 __ j(EQUAL, &donetest6a); | 668 __ j(EQUAL, &donetest6a); |
633 // Be sure to skip this crashing code. | 669 // Be sure to skip this crashing code. |
634 __ movl(RAX, Immediate(0)); | 670 __ movq(RAX, Immediate(0)); |
635 __ movl(Address(RAX, 0), RAX); | 671 __ movq(Address(RAX, 0), RAX); |
636 __ Bind(&donetest6a); | 672 __ Bind(&donetest6a); |
637 | 673 |
638 Label donetest7a; | 674 Label donetest7a; |
639 __ movl(RAX, Immediate(2)); | 675 __ movq(RAX, Immediate(2)); |
640 __ shrq(RAX, Immediate(1)); | 676 __ shrq(RAX, Immediate(1)); |
641 __ cmpl(RAX, Immediate(1)); | 677 __ cmpq(RAX, Immediate(1)); |
642 __ j(EQUAL, &donetest7a); | 678 __ j(EQUAL, &donetest7a); |
643 // Be sure to skip this crashing code. | 679 // Be sure to skip this crashing code. |
644 __ movl(RAX, Immediate(0)); | 680 __ movq(RAX, Immediate(0)); |
645 __ movl(Address(RAX, 0), RAX); | 681 __ movq(Address(RAX, 0), RAX); |
646 __ Bind(&donetest7a); | 682 __ Bind(&donetest7a); |
647 | 683 |
648 Label donetest8a; | 684 Label donetest8a; |
649 __ movl(RAX, Immediate(8)); | 685 __ movq(RAX, Immediate(8)); |
650 __ shrq(RAX, Immediate(3)); | 686 __ shrq(RAX, Immediate(3)); |
651 __ cmpl(RAX, Immediate(1)); | 687 __ cmpq(RAX, Immediate(1)); |
652 __ j(EQUAL, &donetest8a); | 688 __ j(EQUAL, &donetest8a); |
653 // Be sure to skip this crashing code. | 689 // Be sure to skip this crashing code. |
654 __ movl(RAX, Immediate(0)); | 690 __ movq(RAX, Immediate(0)); |
655 __ movl(Address(RAX, 0), RAX); | 691 __ movq(Address(RAX, 0), RAX); |
656 __ Bind(&donetest8a); | 692 __ Bind(&donetest8a); |
657 | 693 |
658 Label donetest9a; | 694 Label donetest9a; |
659 __ movl(RAX, Immediate(1)); | 695 __ movq(RAX, Immediate(1)); |
660 __ movl(RCX, Immediate(3)); | 696 __ movq(RCX, Immediate(3)); |
661 __ shlq(RAX, RCX); | 697 __ shlq(RAX, RCX); |
662 __ cmpl(RAX, Immediate(8)); | 698 __ cmpq(RAX, Immediate(8)); |
663 __ j(EQUAL, &donetest9a); | 699 __ j(EQUAL, &donetest9a); |
664 // Be sure to skip this crashing code. | 700 // Be sure to skip this crashing code. |
665 __ movl(RAX, Immediate(0)); | 701 __ movq(RAX, Immediate(0)); |
666 __ movl(Address(RAX, 0), RAX); | 702 __ movq(Address(RAX, 0), RAX); |
667 __ Bind(&donetest9a); | 703 __ Bind(&donetest9a); |
668 | 704 |
669 Label donetest10a; | 705 Label donetest10a; |
670 __ movl(RAX, Immediate(8)); | 706 __ movq(RAX, Immediate(8)); |
671 __ movl(RCX, Immediate(3)); | 707 __ movq(RCX, Immediate(3)); |
672 __ shrq(RAX, RCX); | 708 __ shrq(RAX, RCX); |
673 __ cmpl(RAX, Immediate(1)); | 709 __ cmpq(RAX, Immediate(1)); |
674 __ j(EQUAL, &donetest10a); | 710 __ j(EQUAL, &donetest10a); |
675 // Be sure to skip this crashing code. | 711 // Be sure to skip this crashing code. |
676 __ movl(RAX, Immediate(0)); | 712 __ movq(RAX, Immediate(0)); |
677 __ movl(Address(RAX, 0), RAX); | 713 __ movq(Address(RAX, 0), RAX); |
678 __ Bind(&donetest10a); | 714 __ Bind(&donetest10a); |
679 | 715 |
680 Label donetest11a; | 716 Label donetest11a; |
681 __ movl(RAX, Immediate(1)); | 717 __ movq(RAX, Immediate(1)); |
682 __ shlq(RAX, Immediate(31)); | 718 __ shlq(RAX, Immediate(31)); |
683 __ shrq(RAX, Immediate(3)); | 719 __ shrq(RAX, Immediate(3)); |
684 __ cmpq(RAX, Immediate(0x10000000)); | 720 __ cmpq(RAX, Immediate(0x10000000)); |
685 __ j(EQUAL, &donetest11a); | 721 __ j(EQUAL, &donetest11a); |
686 // Be sure to skip this crashing code. | 722 // Be sure to skip this crashing code. |
687 __ movl(RAX, Immediate(0)); | 723 __ movq(RAX, Immediate(0)); |
688 __ movl(Address(RAX, 0), RAX); | 724 __ movq(Address(RAX, 0), RAX); |
689 __ Bind(&donetest11a); | 725 __ Bind(&donetest11a); |
690 | 726 |
691 Label donetest12a; | 727 Label donetest12a; |
692 __ movl(RAX, Immediate(1)); | 728 __ movq(RAX, Immediate(1)); |
693 __ shlq(RAX, Immediate(31)); | 729 __ shlq(RAX, Immediate(63)); |
694 __ sarl(RAX, Immediate(3)); | 730 __ sarq(RAX, Immediate(3)); |
695 __ cmpl(RAX, Immediate(0xfffffffff0000000)); | 731 __ cmpq(RAX, Immediate(0xf000000000000000)); |
696 __ j(EQUAL, &donetest12a); | 732 __ j(EQUAL, &donetest12a); |
697 // Be sure to skip this crashing code. | 733 // Be sure to skip this crashing code. |
698 __ movl(RAX, Immediate(0)); | 734 __ movq(RAX, Immediate(0)); |
699 __ movl(Address(RAX, 0), RAX); | 735 __ movq(Address(RAX, 0), RAX); |
700 __ Bind(&donetest12a); | 736 __ Bind(&donetest12a); |
701 | 737 |
702 Label donetest13a; | 738 Label donetest13a; |
703 __ movl(RAX, Immediate(1)); | 739 __ movq(RAX, Immediate(1)); |
704 __ movl(RCX, Immediate(3)); | 740 __ movq(RCX, Immediate(3)); |
705 __ shlq(RAX, Immediate(31)); | 741 __ shlq(RAX, Immediate(63)); |
706 __ sarl(RAX, RCX); | 742 __ sarq(RAX, RCX); |
707 __ cmpl(RAX, Immediate(0xfffffffff0000000)); | 743 __ cmpq(RAX, Immediate(0xf000000000000000)); |
708 __ j(EQUAL, &donetest13a); | 744 __ j(EQUAL, &donetest13a); |
709 // Be sure to skip this crashing code. | 745 // Be sure to skip this crashing code. |
710 __ movl(RAX, Immediate(0)); | 746 __ movq(RAX, Immediate(0)); |
711 __ movl(Address(RAX, 0), RAX); | 747 __ movq(Address(RAX, 0), RAX); |
712 __ Bind(&donetest13a); | 748 __ Bind(&donetest13a); |
713 | 749 |
714 __ movl(RAX, Immediate(0)); | 750 __ movq(RAX, Immediate(0)); |
715 __ ret(); | 751 __ ret(); |
716 } | 752 } |
717 | 753 |
regis
2012/07/12 00:24:28
Why not keep this 32-bit version and add a Logical
srdjan
2012/07/12 00:34:38
Done.
| |
718 | 754 |
719 ASSEMBLER_TEST_RUN(LogicalOps, entry) { | 755 ASSEMBLER_TEST_RUN(LogicalOps, entry) { |
720 typedef int (*LogicalOpsCode)(); | 756 typedef int (*LogicalOpsCode)(); |
721 EXPECT_EQ(0, reinterpret_cast<LogicalOpsCode>(entry)()); | 757 EXPECT_EQ(0, reinterpret_cast<LogicalOpsCode>(entry)()); |
722 } | 758 } |
723 | 759 |
724 | 760 |
725 ASSEMBLER_TEST_GENERATE(LogicalTestL, assembler) { | 761 ASSEMBLER_TEST_GENERATE(LogicalTestL, assembler) { |
726 Label donetest1; | 762 Label donetest1; |
727 __ movl(RAX, Immediate(4)); | 763 __ movl(RAX, Immediate(4)); |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1243 ASSEMBLER_TEST_GENERATE(TestAdds, assembler) { | 1279 ASSEMBLER_TEST_GENERATE(TestAdds, assembler) { |
1244 __ movq(RAX, Immediate(4)); | 1280 __ movq(RAX, Immediate(4)); |
1245 __ pushq(RAX); | 1281 __ pushq(RAX); |
1246 __ addq(Address(RSP, 0), Immediate(5)); | 1282 __ addq(Address(RSP, 0), Immediate(5)); |
1247 // TOS: 9 | 1283 // TOS: 9 |
1248 __ addq(Address(RSP, 0), Immediate(-2)); | 1284 __ addq(Address(RSP, 0), Immediate(-2)); |
1249 // TOS: 7 | 1285 // TOS: 7 |
1250 __ movq(RCX, Immediate(3)); | 1286 __ movq(RCX, Immediate(3)); |
1251 __ addq(Address(RSP, 0), RCX); | 1287 __ addq(Address(RSP, 0), RCX); |
1252 // TOS: 10 | 1288 // TOS: 10 |
1253 __ popq(RAX); | 1289 __ movq(RAX, Immediate(10)); |
1290 __ addq(RAX, Address(RSP, 0)); | |
1291 // RAX: 20 | |
1292 __ popq(RCX); | |
1254 __ ret(); | 1293 __ ret(); |
1255 } | 1294 } |
1256 | 1295 |
1257 | 1296 |
1258 ASSEMBLER_TEST_RUN(TestAdds, entry) { | 1297 ASSEMBLER_TEST_RUN(TestAdds, entry) { |
1259 typedef int (*TestAdds)(); | 1298 typedef int (*TestAdds)(); |
1260 int res = reinterpret_cast<TestAdds>(entry)(); | 1299 int res = reinterpret_cast<TestAdds>(entry)(); |
1261 EXPECT_EQ(10, res); | 1300 EXPECT_EQ(20, res); |
1262 } | 1301 } |
1263 | 1302 |
1264 | 1303 |
1265 ASSEMBLER_TEST_GENERATE(TestNot, assembler) { | 1304 ASSEMBLER_TEST_GENERATE(TestNot, assembler) { |
1266 __ movq(RAX, Immediate(0xFFFFFFFF00000000)); | 1305 __ movq(RAX, Immediate(0xFFFFFFFF00000000)); |
1267 __ notq(RAX); | 1306 __ notq(RAX); |
1268 __ ret(); | 1307 __ ret(); |
1269 } | 1308 } |
1270 | 1309 |
1271 | 1310 |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1433 EXPECT_EQ(0, res); | 1472 EXPECT_EQ(0, res); |
1434 res = reinterpret_cast<ExtractSignBits>(entry)(-1.0); | 1473 res = reinterpret_cast<ExtractSignBits>(entry)(-1.0); |
1435 EXPECT_EQ(1, res); | 1474 EXPECT_EQ(1, res); |
1436 res = reinterpret_cast<ExtractSignBits>(entry)(-0.0); | 1475 res = reinterpret_cast<ExtractSignBits>(entry)(-0.0); |
1437 EXPECT_EQ(1, res); | 1476 EXPECT_EQ(1, res); |
1438 } | 1477 } |
1439 | 1478 |
1440 } // namespace dart | 1479 } // namespace dart |
1441 | 1480 |
1442 #endif // defined TARGET_ARCH_X64 | 1481 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |