| 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 __ mov(R0, Operand(R1)); | 181 __ mov(R0, Operand(R1)); |
| 182 __ bx(LR); | 182 __ bx(LR); |
| 183 } | 183 } |
| 184 | 184 |
| 185 | 185 |
| 186 ASSEMBLER_TEST_RUN(LoadWordUnaligned, test) { | 186 ASSEMBLER_TEST_RUN(LoadWordUnaligned, test) { |
| 187 EXPECT(test != NULL); | 187 EXPECT(test != NULL); |
| 188 typedef intptr_t (*LoadWordUnaligned)(intptr_t) DART_UNUSED; | 188 typedef intptr_t (*LoadWordUnaligned)(intptr_t) DART_UNUSED; |
| 189 uint8_t buffer[8] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; | 189 uint8_t buffer[8] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; |
| 190 | 190 |
| 191 EXPECT_EQ(0x78563412, EXECUTE_TEST_CODE_INTPTR_INTPTR( | 191 EXPECT_EQ( |
| 192 LoadWordUnaligned, test->entry(), | 192 static_cast<intptr_t>(0x78563412), |
| 193 reinterpret_cast<intptr_t>(&buffer[0]))); | 193 EXECUTE_TEST_CODE_INTPTR_INTPTR(LoadWordUnaligned, test->entry(), |
| 194 EXPECT_EQ(0x9A785634, EXECUTE_TEST_CODE_INTPTR_INTPTR( | 194 reinterpret_cast<intptr_t>(&buffer[0]))); |
| 195 LoadWordUnaligned, test->entry(), | 195 EXPECT_EQ( |
| 196 reinterpret_cast<intptr_t>(&buffer[1]))); | 196 static_cast<intptr_t>(0x9A785634), |
| 197 EXPECT_EQ(0xBC9A7856, EXECUTE_TEST_CODE_INTPTR_INTPTR( | 197 EXECUTE_TEST_CODE_INTPTR_INTPTR(LoadWordUnaligned, test->entry(), |
| 198 LoadWordUnaligned, test->entry(), | 198 reinterpret_cast<intptr_t>(&buffer[1]))); |
| 199 reinterpret_cast<intptr_t>(&buffer[2]))); | 199 EXPECT_EQ( |
| 200 EXPECT_EQ(0xDEBC9A78, EXECUTE_TEST_CODE_INTPTR_INTPTR( | 200 static_cast<intptr_t>(0xBC9A7856), |
| 201 LoadWordUnaligned, test->entry(), | 201 EXECUTE_TEST_CODE_INTPTR_INTPTR(LoadWordUnaligned, test->entry(), |
| 202 reinterpret_cast<intptr_t>(&buffer[3]))); | 202 reinterpret_cast<intptr_t>(&buffer[2]))); |
| 203 EXPECT_EQ( |
| 204 static_cast<intptr_t>(0xDEBC9A78), |
| 205 EXECUTE_TEST_CODE_INTPTR_INTPTR(LoadWordUnaligned, test->entry(), |
| 206 reinterpret_cast<intptr_t>(&buffer[3]))); |
| 203 } | 207 } |
| 204 | 208 |
| 205 | 209 |
| 206 ASSEMBLER_TEST_GENERATE(StoreWordUnaligned, assembler) { | 210 ASSEMBLER_TEST_GENERATE(StoreWordUnaligned, assembler) { |
| 207 __ LoadImmediate(R1, 0x12345678); | 211 __ LoadImmediate(R1, 0x12345678); |
| 208 __ StoreWordUnaligned(R1, R0, TMP); | 212 __ StoreWordUnaligned(R1, R0, TMP); |
| 209 __ mov(R0, Operand(R1)); | 213 __ mov(R0, Operand(R1)); |
| 210 __ bx(LR); | 214 __ bx(LR); |
| 211 } | 215 } |
| 212 | 216 |
| (...skipping 3898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4111 __ mov(THR, Operand(R2)); | 4115 __ mov(THR, Operand(R2)); |
| 4112 __ StoreIntoObject(R1, FieldAddress(R1, GrowableObjectArray::data_offset()), | 4116 __ StoreIntoObject(R1, FieldAddress(R1, GrowableObjectArray::data_offset()), |
| 4113 R0); | 4117 R0); |
| 4114 __ PopList((1 << LR) | (1 << THR)); | 4118 __ PopList((1 << LR) | (1 << THR)); |
| 4115 __ Ret(); | 4119 __ Ret(); |
| 4116 } | 4120 } |
| 4117 | 4121 |
| 4118 } // namespace dart | 4122 } // namespace dart |
| 4119 | 4123 |
| 4120 #endif // defined TARGET_ARCH_ARM | 4124 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |