| 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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 __ ret(); | 416 __ ret(); |
| 417 } | 417 } |
| 418 | 418 |
| 419 | 419 |
| 420 ASSEMBLER_TEST_RUN(LoadSigned32Bit, test) { | 420 ASSEMBLER_TEST_RUN(LoadSigned32Bit, test) { |
| 421 typedef int64_t (*Int64Return)() DART_UNUSED; | 421 typedef int64_t (*Int64Return)() DART_UNUSED; |
| 422 EXPECT_EQ(-1, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); | 422 EXPECT_EQ(-1, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
| 423 } | 423 } |
| 424 | 424 |
| 425 | 425 |
| 426 ASSEMBLER_TEST_GENERATE(SimpleLoadStorePair, assembler) { |
| 427 __ SetupDartSP(kTestStackSpace); |
| 428 __ LoadImmediate(R2, 43, kNoPP); |
| 429 __ LoadImmediate(R3, 42, kNoPP); |
| 430 __ stp(R2, R3, Address(SP, -2*kWordSize, Address::PairPreIndex)); |
| 431 __ ldp(R0, R1, Address(SP, 2*kWordSize, Address::PairPostIndex)); |
| 432 __ sub(R0, R0, Operand(R1)); |
| 433 __ mov(CSP, SP); |
| 434 __ ret(); |
| 435 } |
| 436 |
| 437 |
| 438 ASSEMBLER_TEST_RUN(SimpleLoadStorePair, test) { |
| 439 typedef int64_t (*Int64Return)() DART_UNUSED; |
| 440 EXPECT_EQ(1, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
| 441 } |
| 442 |
| 443 |
| 444 ASSEMBLER_TEST_GENERATE(LoadStorePairOffset, assembler) { |
| 445 __ SetupDartSP(kTestStackSpace); |
| 446 __ LoadImmediate(R2, 43, kNoPP); |
| 447 __ LoadImmediate(R3, 42, kNoPP); |
| 448 __ sub(SP, SP, Operand(4 * kWordSize)); |
| 449 __ stp(R2, R3, Address::Pair(SP, 2 * kWordSize)); |
| 450 __ ldp(R0, R1, Address::Pair(SP, 2 * kWordSize)); |
| 451 __ add(SP, SP, Operand(4 * kWordSize)); |
| 452 __ sub(R0, R0, Operand(R1)); |
| 453 __ mov(CSP, SP); |
| 454 __ ret(); |
| 455 } |
| 456 |
| 457 |
| 458 ASSEMBLER_TEST_RUN(LoadStorePairOffset, test) { |
| 459 typedef int64_t (*Int64Return)() DART_UNUSED; |
| 460 EXPECT_EQ(1, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry())); |
| 461 } |
| 462 |
| 463 |
| 426 // Logical register operations. | 464 // Logical register operations. |
| 427 ASSEMBLER_TEST_GENERATE(AndRegs, assembler) { | 465 ASSEMBLER_TEST_GENERATE(AndRegs, assembler) { |
| 428 __ movz(R1, Immediate(43), 0); | 466 __ movz(R1, Immediate(43), 0); |
| 429 __ movz(R2, Immediate(42), 0); | 467 __ movz(R2, Immediate(42), 0); |
| 430 __ and_(R0, R1, Operand(R2)); | 468 __ and_(R0, R1, Operand(R2)); |
| 431 __ ret(); | 469 __ ret(); |
| 432 } | 470 } |
| 433 | 471 |
| 434 | 472 |
| 435 ASSEMBLER_TEST_RUN(AndRegs, test) { | 473 ASSEMBLER_TEST_RUN(AndRegs, test) { |
| (...skipping 2838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3274 __ Pop(LR); | 3312 __ Pop(LR); |
| 3275 __ Pop(CTX); | 3313 __ Pop(CTX); |
| 3276 __ PopAndUntagPP(); | 3314 __ PopAndUntagPP(); |
| 3277 __ mov(CSP, SP); | 3315 __ mov(CSP, SP); |
| 3278 __ ret(); | 3316 __ ret(); |
| 3279 } | 3317 } |
| 3280 | 3318 |
| 3281 } // namespace dart | 3319 } // namespace dart |
| 3282 | 3320 |
| 3283 #endif // defined(TARGET_ARCH_ARM64) | 3321 #endif // defined(TARGET_ARCH_ARM64) |
| OLD | NEW |