| 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_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 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 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 __ cmp(R1, Operand(32)); | 945 __ cmp(R1, Operand(32)); |
| 946 __ b(&error, NE); | 946 __ b(&error, NE); |
| 947 __ mov(R2, Operand(42)); | 947 __ mov(R2, Operand(42)); |
| 948 __ clz(R2, R2); | 948 __ clz(R2, R2); |
| 949 __ cmp(R2, Operand(26)); | 949 __ cmp(R2, Operand(26)); |
| 950 __ b(&error, NE); | 950 __ b(&error, NE); |
| 951 __ mvn(R0, Operand(0)); | 951 __ mvn(R0, Operand(0)); |
| 952 __ clz(R1, R0); | 952 __ clz(R1, R0); |
| 953 __ cmp(R1, Operand(0)); | 953 __ cmp(R1, Operand(0)); |
| 954 __ b(&error, NE); | 954 __ b(&error, NE); |
| 955 __ Lsr(R0, R0, 3); | 955 __ Lsr(R0, R0, Operand(3)); |
| 956 __ clz(R1, R0); | 956 __ clz(R1, R0); |
| 957 __ cmp(R1, Operand(3)); | 957 __ cmp(R1, Operand(3)); |
| 958 __ b(&error, NE); | 958 __ b(&error, NE); |
| 959 __ mov(R0, Operand(0)); | 959 __ mov(R0, Operand(0)); |
| 960 __ bx(LR); | 960 __ bx(LR); |
| 961 __ Bind(&error); | 961 __ Bind(&error); |
| 962 __ mov(R0, Operand(1)); | 962 __ mov(R0, Operand(1)); |
| 963 __ bx(LR); | 963 __ bx(LR); |
| 964 } | 964 } |
| 965 | 965 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1024 EXPECT(test != NULL); | 1024 EXPECT(test != NULL); |
| 1025 typedef int (*Tst)() DART_UNUSED; | 1025 typedef int (*Tst)() DART_UNUSED; |
| 1026 EXPECT_EQ(1, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); | 1026 EXPECT_EQ(1, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); |
| 1027 } | 1027 } |
| 1028 | 1028 |
| 1029 | 1029 |
| 1030 ASSEMBLER_TEST_GENERATE(Lsr1, assembler) { | 1030 ASSEMBLER_TEST_GENERATE(Lsr1, assembler) { |
| 1031 Label skip; | 1031 Label skip; |
| 1032 | 1032 |
| 1033 __ mov(R0, Operand(1)); | 1033 __ mov(R0, Operand(1)); |
| 1034 __ Lsl(R0, R0, 31); | 1034 __ Lsl(R0, R0, Operand(31)); |
| 1035 __ Lsr(R0, R0, 31); | 1035 __ Lsr(R0, R0, Operand(31)); |
| 1036 __ bx(LR); | 1036 __ bx(LR); |
| 1037 } | 1037 } |
| 1038 | 1038 |
| 1039 | 1039 |
| 1040 ASSEMBLER_TEST_RUN(Lsr1, test) { | 1040 ASSEMBLER_TEST_RUN(Lsr1, test) { |
| 1041 EXPECT(test != NULL); | 1041 EXPECT(test != NULL); |
| 1042 typedef int (*Tst)() DART_UNUSED; | 1042 typedef int (*Tst)() DART_UNUSED; |
| 1043 EXPECT_EQ(1, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); | 1043 EXPECT_EQ(1, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); |
| 1044 } | 1044 } |
| 1045 | 1045 |
| 1046 | 1046 |
| 1047 ASSEMBLER_TEST_GENERATE(Asr1, assembler) { | 1047 ASSEMBLER_TEST_GENERATE(Asr1, assembler) { |
| 1048 Label skip; | 1048 Label skip; |
| 1049 | 1049 |
| 1050 __ mov(R0, Operand(1)); | 1050 __ mov(R0, Operand(1)); |
| 1051 __ Lsl(R0, R0, 31); | 1051 __ Lsl(R0, R0, Operand(31)); |
| 1052 __ Asr(R0, R0, 31); | 1052 __ Asr(R0, R0, Operand(31)); |
| 1053 __ bx(LR); | 1053 __ bx(LR); |
| 1054 } | 1054 } |
| 1055 | 1055 |
| 1056 | 1056 |
| 1057 ASSEMBLER_TEST_RUN(Asr1, test) { | 1057 ASSEMBLER_TEST_RUN(Asr1, test) { |
| 1058 EXPECT(test != NULL); | 1058 EXPECT(test != NULL); |
| 1059 typedef int (*Tst)() DART_UNUSED; | 1059 typedef int (*Tst)() DART_UNUSED; |
| 1060 EXPECT_EQ(-1, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); | 1060 EXPECT_EQ(-1, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); |
| 1061 } | 1061 } |
| 1062 | 1062 |
| (...skipping 3065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4128 __ StoreIntoObject(R2, | 4128 __ StoreIntoObject(R2, |
| 4129 FieldAddress(R2, GrowableObjectArray::data_offset()), | 4129 FieldAddress(R2, GrowableObjectArray::data_offset()), |
| 4130 R1); | 4130 R1); |
| 4131 __ PopList((1 << CTX) | (1 << LR)); | 4131 __ PopList((1 << CTX) | (1 << LR)); |
| 4132 __ Ret(); | 4132 __ Ret(); |
| 4133 } | 4133 } |
| 4134 | 4134 |
| 4135 } // namespace dart | 4135 } // namespace dart |
| 4136 | 4136 |
| 4137 #endif // defined TARGET_ARCH_ARM | 4137 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |