| 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 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 893 __ cmp(R1, Operand(32)); | 893 __ cmp(R1, Operand(32)); |
| 894 __ b(&error, NE); | 894 __ b(&error, NE); |
| 895 __ mov(R2, Operand(42)); | 895 __ mov(R2, Operand(42)); |
| 896 __ clz(R2, R2); | 896 __ clz(R2, R2); |
| 897 __ cmp(R2, Operand(26)); | 897 __ cmp(R2, Operand(26)); |
| 898 __ b(&error, NE); | 898 __ b(&error, NE); |
| 899 __ mvn(R0, Operand(0)); | 899 __ mvn(R0, Operand(0)); |
| 900 __ clz(R1, R0); | 900 __ clz(R1, R0); |
| 901 __ cmp(R1, Operand(0)); | 901 __ cmp(R1, Operand(0)); |
| 902 __ b(&error, NE); | 902 __ b(&error, NE); |
| 903 __ Lsr(R0, R0, 3); | 903 __ Lsr(R0, R0, Operand(3)); |
| 904 __ clz(R1, R0); | 904 __ clz(R1, R0); |
| 905 __ cmp(R1, Operand(3)); | 905 __ cmp(R1, Operand(3)); |
| 906 __ b(&error, NE); | 906 __ b(&error, NE); |
| 907 __ mov(R0, Operand(0)); | 907 __ mov(R0, Operand(0)); |
| 908 __ bx(LR); | 908 __ bx(LR); |
| 909 __ Bind(&error); | 909 __ Bind(&error); |
| 910 __ mov(R0, Operand(1)); | 910 __ mov(R0, Operand(1)); |
| 911 __ bx(LR); | 911 __ bx(LR); |
| 912 } | 912 } |
| 913 | 913 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 972 EXPECT(test != NULL); | 972 EXPECT(test != NULL); |
| 973 typedef int (*Tst)() DART_UNUSED; | 973 typedef int (*Tst)() DART_UNUSED; |
| 974 EXPECT_EQ(1, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); | 974 EXPECT_EQ(1, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); |
| 975 } | 975 } |
| 976 | 976 |
| 977 | 977 |
| 978 ASSEMBLER_TEST_GENERATE(Lsr1, assembler) { | 978 ASSEMBLER_TEST_GENERATE(Lsr1, assembler) { |
| 979 Label skip; | 979 Label skip; |
| 980 | 980 |
| 981 __ mov(R0, Operand(1)); | 981 __ mov(R0, Operand(1)); |
| 982 __ Lsl(R0, R0, 31); | 982 __ Lsl(R0, R0, Operand(31)); |
| 983 __ Lsr(R0, R0, 31); | 983 __ Lsr(R0, R0, Operand(31)); |
| 984 __ bx(LR); | 984 __ bx(LR); |
| 985 } | 985 } |
| 986 | 986 |
| 987 | 987 |
| 988 ASSEMBLER_TEST_RUN(Lsr1, test) { | 988 ASSEMBLER_TEST_RUN(Lsr1, test) { |
| 989 EXPECT(test != NULL); | 989 EXPECT(test != NULL); |
| 990 typedef int (*Tst)() DART_UNUSED; | 990 typedef int (*Tst)() DART_UNUSED; |
| 991 EXPECT_EQ(1, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); | 991 EXPECT_EQ(1, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); |
| 992 } | 992 } |
| 993 | 993 |
| 994 | 994 |
| 995 ASSEMBLER_TEST_GENERATE(Asr1, assembler) { | 995 ASSEMBLER_TEST_GENERATE(Asr1, assembler) { |
| 996 Label skip; | 996 Label skip; |
| 997 | 997 |
| 998 __ mov(R0, Operand(1)); | 998 __ mov(R0, Operand(1)); |
| 999 __ Lsl(R0, R0, 31); | 999 __ Lsl(R0, R0, Operand(31)); |
| 1000 __ Asr(R0, R0, 31); | 1000 __ Asr(R0, R0, Operand(31)); |
| 1001 __ bx(LR); | 1001 __ bx(LR); |
| 1002 } | 1002 } |
| 1003 | 1003 |
| 1004 | 1004 |
| 1005 ASSEMBLER_TEST_RUN(Asr1, test) { | 1005 ASSEMBLER_TEST_RUN(Asr1, test) { |
| 1006 EXPECT(test != NULL); | 1006 EXPECT(test != NULL); |
| 1007 typedef int (*Tst)() DART_UNUSED; | 1007 typedef int (*Tst)() DART_UNUSED; |
| 1008 EXPECT_EQ(-1, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); | 1008 EXPECT_EQ(-1, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); |
| 1009 } | 1009 } |
| 1010 | 1010 |
| (...skipping 3065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4076 __ StoreIntoObject(R2, | 4076 __ StoreIntoObject(R2, |
| 4077 FieldAddress(R2, GrowableObjectArray::data_offset()), | 4077 FieldAddress(R2, GrowableObjectArray::data_offset()), |
| 4078 R1); | 4078 R1); |
| 4079 __ PopList((1 << CTX) | (1 << LR)); | 4079 __ PopList((1 << CTX) | (1 << LR)); |
| 4080 __ Ret(); | 4080 __ Ret(); |
| 4081 } | 4081 } |
| 4082 | 4082 |
| 4083 } // namespace dart | 4083 } // namespace dart |
| 4084 | 4084 |
| 4085 #endif // defined TARGET_ARCH_ARM | 4085 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |