| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
| 10 #include "vm/os.h" | 10 #include "vm/os.h" |
| (...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 716 __ ret(); | 716 __ ret(); |
| 717 } | 717 } |
| 718 | 718 |
| 719 | 719 |
| 720 ASSEMBLER_TEST_RUN(EorImm, test) { | 720 ASSEMBLER_TEST_RUN(EorImm, test) { |
| 721 typedef int64_t (*Int64Return)() DART_UNUSED; | 721 typedef int64_t (*Int64Return)() DART_UNUSED; |
| 722 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 722 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
| 723 } | 723 } |
| 724 | 724 |
| 725 | 725 |
| 726 ASSEMBLER_TEST_GENERATE(Clz, assembler) { |
| 727 Label error; |
| 728 |
| 729 __ clz(R1, ZR); |
| 730 __ cmp(R1, Operand(64)); |
| 731 __ b(&error, NE); |
| 732 __ LoadImmediate(R2, 42, kNoPP); |
| 733 __ clz(R2, R2); |
| 734 __ cmp(R2, Operand(58)); |
| 735 __ b(&error, NE); |
| 736 __ LoadImmediate(R0, -1, kNoPP); |
| 737 __ clz(R1, R0); |
| 738 __ cmp(R1, Operand(0)); |
| 739 __ b(&error, NE); |
| 740 __ add(R0, ZR, Operand(R0, LSR, 3)); |
| 741 __ clz(R1, R0); |
| 742 __ cmp(R1, Operand(3)); |
| 743 __ b(&error, NE); |
| 744 __ mov(R0, ZR); |
| 745 __ ret(); |
| 746 __ Bind(&error); |
| 747 __ LoadImmediate(R0, 1, kNoPP); |
| 748 __ ret(); |
| 749 } |
| 750 |
| 751 |
| 752 ASSEMBLER_TEST_RUN(Clz, test) { |
| 753 typedef int64_t (*Int64Return)() DART_UNUSED; |
| 754 EXPECT_EQ(0, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
| 755 } |
| 756 |
| 757 |
| 726 // Comparisons, branching. | 758 // Comparisons, branching. |
| 727 ASSEMBLER_TEST_GENERATE(BranchALForward, assembler) { | 759 ASSEMBLER_TEST_GENERATE(BranchALForward, assembler) { |
| 728 Label l; | 760 Label l; |
| 729 __ movz(R0, Immediate(42), 0); | 761 __ movz(R0, Immediate(42), 0); |
| 730 __ b(&l, AL); | 762 __ b(&l, AL); |
| 731 __ movz(R0, Immediate(0), 0); | 763 __ movz(R0, Immediate(0), 0); |
| 732 __ Bind(&l); | 764 __ Bind(&l); |
| 733 __ ret(); | 765 __ ret(); |
| 734 } | 766 } |
| 735 | 767 |
| (...skipping 2859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3595 | 3627 |
| 3596 EXPECT_EQ(-1, RANGE_OF(Bool::True().raw())); | 3628 EXPECT_EQ(-1, RANGE_OF(Bool::True().raw())); |
| 3597 | 3629 |
| 3598 #undef RANGE_OF | 3630 #undef RANGE_OF |
| 3599 } | 3631 } |
| 3600 | 3632 |
| 3601 | 3633 |
| 3602 } // namespace dart | 3634 } // namespace dart |
| 3603 | 3635 |
| 3604 #endif // defined(TARGET_ARCH_ARM64) | 3636 #endif // defined(TARGET_ARCH_ARM64) |
| OLD | NEW |