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

Unified Diff: runtime/vm/assembler_arm_test.cc

Issue 12459005: Adds muls, sdiv, udiv instructions to ARM simulator, assembler, disassembler (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/assembler_arm_test.cc
===================================================================
--- runtime/vm/assembler_arm_test.cc (revision 19488)
+++ runtime/vm/assembler_arm_test.cc (working copy)
@@ -1423,6 +1423,54 @@
}
+ASSEMBLER_TEST_GENERATE(Udiv, assembler) {
+ __ mov(R0, ShifterOperand(27));
+ __ mov(R1, ShifterOperand(9));
+ __ udiv(R2, R0, R1);
+ __ Mov(R0, R2);
+ __ mov(PC, ShifterOperand(LR));
+}
+
+
+ASSEMBLER_TEST_RUN(Udiv, test) {
+ EXPECT(test != NULL);
+ typedef int (*Tst)();
+ EXPECT_EQ(3, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
+}
+
+
+ASSEMBLER_TEST_GENERATE(Sdiv, assembler) {
+ __ mov(R0, ShifterOperand(27));
+ __ LoadImmediate(R1, -9);
+ __ sdiv(R2, R0, R1);
+ __ Mov(R0, R2);
+ __ mov(PC, ShifterOperand(LR));
+}
+
+
+ASSEMBLER_TEST_RUN(Sdiv, test) {
+ EXPECT(test != NULL);
+ typedef int (*Tst)();
+ EXPECT_EQ(-3, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
+}
+
+
+ASSEMBLER_TEST_GENERATE(Muls, assembler) {
+ __ mov(R0, ShifterOperand(3));
+ __ LoadImmediate(R1, -9);
+ __ muls(R2, R0, R1);
+ __ mov(R0, ShifterOperand(42), MI);
+ __ mov(PC, ShifterOperand(LR));
+}
+
+
+ASSEMBLER_TEST_RUN(Muls, test) {
+ EXPECT(test != NULL);
+ typedef int (*Tst)();
+ EXPECT_EQ(42, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
+}
regis 2013/03/05 19:11:34 I would add tests for division by zero as well as
+
+
} // namespace dart
#endif // defined TARGET_ARCH_ARM

Powered by Google App Engine
This is Rietveld 408576698