| 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_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
| 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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 __ LoadWordUnaligned(V0, A0, TMP); | 401 __ LoadWordUnaligned(V0, A0, TMP); |
| 402 __ jr(RA); | 402 __ jr(RA); |
| 403 } | 403 } |
| 404 | 404 |
| 405 | 405 |
| 406 ASSEMBLER_TEST_RUN(LoadWordUnaligned, test) { | 406 ASSEMBLER_TEST_RUN(LoadWordUnaligned, test) { |
| 407 EXPECT(test != NULL); | 407 EXPECT(test != NULL); |
| 408 typedef intptr_t (*LoadWordUnaligned)(intptr_t) DART_UNUSED; | 408 typedef intptr_t (*LoadWordUnaligned)(intptr_t) DART_UNUSED; |
| 409 uint8_t buffer[8] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; | 409 uint8_t buffer[8] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0}; |
| 410 | 410 |
| 411 EXPECT_EQ(0x78563412, EXECUTE_TEST_CODE_INTPTR_INTPTR( | 411 EXPECT_EQ( |
| 412 LoadWordUnaligned, test->entry(), | 412 static_cast<intptr_t>(0x78563412), |
| 413 reinterpret_cast<intptr_t>(&buffer[0]))); | 413 EXECUTE_TEST_CODE_INTPTR_INTPTR(LoadWordUnaligned, test->entry(), |
| 414 EXPECT_EQ(0x9A785634, EXECUTE_TEST_CODE_INTPTR_INTPTR( | 414 reinterpret_cast<intptr_t>(&buffer[0]))); |
| 415 LoadWordUnaligned, test->entry(), | 415 EXPECT_EQ( |
| 416 reinterpret_cast<intptr_t>(&buffer[1]))); | 416 static_cast<intptr_t>(0x9A785634), |
| 417 EXPECT_EQ(0xBC9A7856, EXECUTE_TEST_CODE_INTPTR_INTPTR( | 417 EXECUTE_TEST_CODE_INTPTR_INTPTR(LoadWordUnaligned, test->entry(), |
| 418 LoadWordUnaligned, test->entry(), | 418 reinterpret_cast<intptr_t>(&buffer[1]))); |
| 419 reinterpret_cast<intptr_t>(&buffer[2]))); | 419 EXPECT_EQ( |
| 420 EXPECT_EQ(0xDEBC9A78, EXECUTE_TEST_CODE_INTPTR_INTPTR( | 420 static_cast<intptr_t>(0xBC9A7856), |
| 421 LoadWordUnaligned, test->entry(), | 421 EXECUTE_TEST_CODE_INTPTR_INTPTR(LoadWordUnaligned, test->entry(), |
| 422 reinterpret_cast<intptr_t>(&buffer[3]))); | 422 reinterpret_cast<intptr_t>(&buffer[2]))); |
| 423 EXPECT_EQ( |
| 424 static_cast<intptr_t>(0xDEBC9A78), |
| 425 EXECUTE_TEST_CODE_INTPTR_INTPTR(LoadWordUnaligned, test->entry(), |
| 426 reinterpret_cast<intptr_t>(&buffer[3]))); |
| 423 } | 427 } |
| 424 | 428 |
| 425 | 429 |
| 426 ASSEMBLER_TEST_GENERATE(StoreWordUnaligned, assembler) { | 430 ASSEMBLER_TEST_GENERATE(StoreWordUnaligned, assembler) { |
| 427 __ LoadImmediate(A1, 0x12345678); | 431 __ LoadImmediate(A1, 0x12345678); |
| 428 __ StoreWordUnaligned(A1, A0, TMP); | 432 __ StoreWordUnaligned(A1, A0, TMP); |
| 429 __ mov(V0, A1); | 433 __ mov(V0, A1); |
| 430 __ jr(RA); | 434 __ jr(RA); |
| 431 } | 435 } |
| 432 | 436 |
| (...skipping 1877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2310 ASSEMBLER_TEST_RUN(Semaphore, test) { | 2314 ASSEMBLER_TEST_RUN(Semaphore, test) { |
| 2311 EXPECT(test != NULL); | 2315 EXPECT(test != NULL); |
| 2312 typedef int (*Semaphore)() DART_UNUSED; | 2316 typedef int (*Semaphore)() DART_UNUSED; |
| 2313 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT32(Semaphore, test->entry())); | 2317 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT32(Semaphore, test->entry())); |
| 2314 } | 2318 } |
| 2315 | 2319 |
| 2316 | 2320 |
| 2317 } // namespace dart | 2321 } // namespace dart |
| 2318 | 2322 |
| 2319 #endif // defined TARGET_ARCH_MIPS | 2323 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |