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

Unified Diff: runtime/vm/assembler_mips_test.cc

Issue 16272004: Implements intrinsics for MIPS. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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
« no previous file with comments | « runtime/vm/assembler_mips.cc ('k') | runtime/vm/constants_mips.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_mips_test.cc
===================================================================
--- runtime/vm/assembler_mips_test.cc (revision 23484)
+++ runtime/vm/assembler_mips_test.cc (working copy)
@@ -134,6 +134,34 @@
}
+ASSEMBLER_TEST_GENERATE(MtloMflo, assembler) {
+ __ LoadImmediate(T0, 42);
+ __ mtlo(T0);
+ __ mflo(V0);
+ __ jr(RA);
+}
+
+
+ASSEMBLER_TEST_RUN(MtloMflo, test) {
+ typedef int (*SimpleCode)();
+ EXPECT_EQ(42, EXECUTE_TEST_CODE_INT32(SimpleCode, test->entry()));
+}
+
+
+ASSEMBLER_TEST_GENERATE(MthiMfhi, assembler) {
+ __ LoadImmediate(T0, 42);
+ __ mthi(T0);
+ __ mfhi(V0);
+ __ jr(RA);
+}
+
+
+ASSEMBLER_TEST_RUN(MthiMfhi, test) {
+ typedef int (*SimpleCode)();
+ EXPECT_EQ(42, EXECUTE_TEST_CODE_INT32(SimpleCode, test->entry()));
+}
+
+
ASSEMBLER_TEST_GENERATE(Divu, assembler) {
__ addiu(R1, ZR, Immediate(27));
__ addiu(R2, ZR, Immediate(9));
@@ -520,6 +548,23 @@
}
+ASSEMBLER_TEST_GENERATE(Madd_neg, assembler) {
+ __ LoadImmediate(R1, -6);
+ __ LoadImmediate(R2, 7);
+ __ mult(R1, R2);
+ __ madd(R1, R2);
+ __ mflo(V0);
+ __ mfhi(V1);
+ __ jr(RA);
+}
+
+
+ASSEMBLER_TEST_RUN(Madd_neg, test) {
+ typedef int (*SimpleCode)();
+ EXPECT_EQ(-84, EXECUTE_TEST_CODE_INT32(SimpleCode, test->entry()));
+}
+
+
ASSEMBLER_TEST_GENERATE(Subu, assembler) {
__ LoadImmediate(R1, 737);
__ LoadImmediate(R2, 695);
« no previous file with comments | « runtime/vm/assembler_mips.cc ('k') | runtime/vm/constants_mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698