Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: runtime/vm/assembler_arm_test.cc

Issue 183803024: Adds support for ARMv6. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Added tests. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 53
54 ASSEMBLER_TEST_RUN(MoveRotImm, test) { 54 ASSEMBLER_TEST_RUN(MoveRotImm, test) {
55 EXPECT(test != NULL); 55 EXPECT(test != NULL);
56 typedef int (*MoveRotImm)(); 56 typedef int (*MoveRotImm)();
57 EXPECT_EQ(0x30550003, EXECUTE_TEST_CODE_INT32(MoveRotImm, test->entry())); 57 EXPECT_EQ(0x30550003, EXECUTE_TEST_CODE_INT32(MoveRotImm, test->entry()));
58 } 58 }
59 59
60 60
61 ASSEMBLER_TEST_GENERATE(MovImm16, assembler) { 61 ASSEMBLER_TEST_GENERATE(MovImm16, assembler) {
62 __ movw(R0, 0x5678); 62 #if defined(USING_SIMULATOR)
63 __ movt(R0, 0x1234); 63 // ARMv7 is the default.
64 HostCPUFeatures::set_arm_version(ARMv6);
65 __ LoadLargeImmediate(R0, 0x12345678 << 1);
regis 2014/03/06 17:32:11 LoadDecodableImmediate
zra 2014/03/07 19:00:17 Done.
66 HostCPUFeatures::set_arm_version(ARMv7);
67 __ movw(R1, 0x5678);
68 __ movt(R1, 0x1234);
69 __ sub(R0, R0, ShifterOperand(R1));
64 __ bx(LR); 70 __ bx(LR);
71 #else
72 if (TargetCPUFeatures::arm_version() == ARMv6) {
73 __ LoadLargeImmediate(R0, 0x12345678);
74 } else {
75 ASSERT(TargetCPUFeatures::arm_version() == ARMv7);
76 __ movw(R0, 0x5678);
77 __ movt(R0, 0x1234);
78 __ bx(LR);
regis 2014/03/06 17:32:11 __ bx(LR) should be outside of the branch. Remove
zra 2014/03/07 19:00:17 Done.
79 }
80 #endif
65 } 81 }
66 82
67 83
68 ASSEMBLER_TEST_RUN(MovImm16, test) { 84 ASSEMBLER_TEST_RUN(MovImm16, test) {
69 EXPECT(test != NULL); 85 EXPECT(test != NULL);
70 typedef int (*MovImm16)(); 86 typedef int (*MovImm16)();
71 EXPECT_EQ(0x12345678, EXECUTE_TEST_CODE_INT32(MovImm16, test->entry())); 87 EXPECT_EQ(0x12345678, EXECUTE_TEST_CODE_INT32(MovImm16, test->entry()));
72 } 88 }
73 89
74 90
(...skipping 3509 matching lines...) Expand 10 before | Expand all | Expand 10 after
3584 __ StoreIntoObject(R2, 3600 __ StoreIntoObject(R2,
3585 FieldAddress(R2, GrowableObjectArray::data_offset()), 3601 FieldAddress(R2, GrowableObjectArray::data_offset()),
3586 R1); 3602 R1);
3587 __ PopList((1 << CTX) | (1 << LR)); 3603 __ PopList((1 << CTX) | (1 << LR));
3588 __ Ret(); 3604 __ Ret();
3589 } 3605 }
3590 3606
3591 } // namespace dart 3607 } // namespace dart
3592 3608
3593 #endif // defined TARGET_ARCH_ARM 3609 #endif // defined TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698