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 3552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3563 ASSEMBLER_TEST_RUN(ReciprocalSqrt, test) { | 3563 ASSEMBLER_TEST_RUN(ReciprocalSqrt, test) { |
3564 EXPECT(test != NULL); | 3564 EXPECT(test != NULL); |
3565 typedef double (*DoubleReturn)() DART_UNUSED; | 3565 typedef double (*DoubleReturn)() DART_UNUSED; |
3566 double res = EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry()); | 3566 double res = EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry()); |
3567 EXPECT_FLOAT_EQ(1.0/sqrt(147000.0), res, 0.0001); | 3567 EXPECT_FLOAT_EQ(1.0/sqrt(147000.0), res, 0.0001); |
3568 } | 3568 } |
3569 | 3569 |
3570 | 3570 |
3571 // Called from assembler_test.cc. | 3571 // Called from assembler_test.cc. |
3572 // LR: return address. | 3572 // LR: return address. |
3573 // R0: context. | 3573 // R0: value. |
3574 // R1: value. | 3574 // R1: growable array. |
3575 // R2: growable array. | 3575 // R2: current thread. |
3576 // R3: current thread. | |
3577 ASSEMBLER_TEST_GENERATE(StoreIntoObject, assembler) { | 3576 ASSEMBLER_TEST_GENERATE(StoreIntoObject, assembler) { |
3578 __ SetupDartSP(kTestStackSpace); | 3577 __ SetupDartSP(kTestStackSpace); |
3579 __ TagAndPushPP(); | 3578 __ TagAndPushPP(); |
3580 __ LoadPoolPointer(); | 3579 __ LoadPoolPointer(); |
3581 __ Push(THR); | 3580 __ Push(THR); |
3582 __ Push(CTX); | |
3583 __ Push(LR); | 3581 __ Push(LR); |
3584 __ mov(CTX, R0); | 3582 __ mov(THR, R2); |
3585 __ mov(THR, R3); | 3583 __ StoreIntoObject(R1, |
3586 __ StoreIntoObject(R2, | 3584 FieldAddress(R1, GrowableObjectArray::data_offset()), |
3587 FieldAddress(R2, GrowableObjectArray::data_offset()), | 3585 R0); |
3588 R1); | |
3589 __ Pop(LR); | 3586 __ Pop(LR); |
3590 __ Pop(CTX); | |
3591 __ Pop(THR); | 3587 __ Pop(THR); |
3592 __ PopAndUntagPP(); | 3588 __ PopAndUntagPP(); |
3593 __ mov(CSP, SP); | 3589 __ mov(CSP, SP); |
3594 __ ret(); | 3590 __ ret(); |
3595 } | 3591 } |
3596 | 3592 |
3597 | 3593 |
3598 ASSEMBLER_TEST_GENERATE(ComputeRange, assembler) { | 3594 ASSEMBLER_TEST_GENERATE(ComputeRange, assembler) { |
3599 __ SetupDartSP(kTestStackSpace); | 3595 __ SetupDartSP(kTestStackSpace); |
3600 __ TagAndPushPP(); | 3596 __ TagAndPushPP(); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3651 | 3647 |
3652 EXPECT_EQ(-1, RANGE_OF(Bool::True().raw())); | 3648 EXPECT_EQ(-1, RANGE_OF(Bool::True().raw())); |
3653 | 3649 |
3654 #undef RANGE_OF | 3650 #undef RANGE_OF |
3655 } | 3651 } |
3656 | 3652 |
3657 | 3653 |
3658 } // namespace dart | 3654 } // namespace dart |
3659 | 3655 |
3660 #endif // defined(TARGET_ARCH_ARM64) | 3656 #endif // defined(TARGET_ARCH_ARM64) |
OLD | NEW |