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

Unified Diff: runtime/vm/assembler_arm_test.cc

Issue 107293008: Fixes bug in far branches on MIPS. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/assembler_arm_test.cc
===================================================================
--- runtime/vm/assembler_arm_test.cc (revision 31003)
+++ runtime/vm/assembler_arm_test.cc (working copy)
@@ -478,6 +478,49 @@
}
+ASSEMBLER_TEST_GENERATE(Loop2, assembler) {
+ Label loop_entry;
+ __ set_use_far_branches(true);
+ __ mov(R0, ShifterOperand(1));
+ __ mov(R1, ShifterOperand(2));
+ __ Bind(&loop_entry);
+ __ mov(R0, ShifterOperand(R0, LSL, 1));
+ __ movs(R1, ShifterOperand(R1, LSR, 1));
+ __ b(&loop_entry, NE);
+ __ bx(LR);
+}
+
+
+ASSEMBLER_TEST_RUN(Loop2, test) {
+ EXPECT(test != NULL);
+ typedef int (*Loop)();
+ EXPECT_EQ(4, EXECUTE_TEST_CODE_INT32(Loop, test->entry()));
+}
+
+
+ASSEMBLER_TEST_GENERATE(Loop3, assembler) {
+ Label loop_entry;
+ __ set_use_far_branches(true);
+ __ mov(R0, ShifterOperand(1));
+ __ mov(R1, ShifterOperand(2));
+ __ Bind(&loop_entry);
+ for (int i = 0; i < (1 << 22); i++) {
+ __ nop();
+ }
+ __ mov(R0, ShifterOperand(R0, LSL, 1));
+ __ movs(R1, ShifterOperand(R1, LSR, 1));
+ __ b(&loop_entry, NE);
+ __ bx(LR);
+}
+
+
+ASSEMBLER_TEST_RUN(Loop3, test) {
+ EXPECT(test != NULL);
+ typedef int (*Loop)();
+ EXPECT_EQ(4, EXECUTE_TEST_CODE_INT32(Loop, test->entry()));
+}
+
+
ASSEMBLER_TEST_GENERATE(LoadStore, assembler) {
__ mov(R1, ShifterOperand(123));
__ Push(R1);

Powered by Google App Engine
This is Rietveld 408576698