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

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

Issue 13474009: Implements optional parameter handling in MIPS vm. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/os.h" 9 #include "vm/os.h"
10 #include "vm/unit_test.h" 10 #include "vm/unit_test.h"
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 __ jr(RA); 982 __ jr(RA);
983 } 983 }
984 984
985 985
986 ASSEMBLER_TEST_RUN(Bnel, test) { 986 ASSEMBLER_TEST_RUN(Bnel, test) {
987 typedef int (*SimpleCode)(); 987 typedef int (*SimpleCode)();
988 EXPECT_EQ(0, EXECUTE_TEST_CODE_INT32(SimpleCode, test->entry())); 988 EXPECT_EQ(0, EXECUTE_TEST_CODE_INT32(SimpleCode, test->entry()));
989 } 989 }
990 990
991 991
992 ASSEMBLER_TEST_GENERATE(Label_link1, assembler) {
993 Label l;
994
995 __ bgez(ZR, &l);
996 __ bgez(ZR, &l);
997 __ bgez(ZR, &l);
998
999 __ Bind(&l);
1000 __ mov(V0, ZR);
1001 __ jr(RA);
regis 2013/04/03 21:12:39 Whether the branch is taken or not, the returned r
zra 2013/04/03 21:41:00 Done.
1002 }
1003
1004
1005 ASSEMBLER_TEST_RUN(Label_link1, test) {
1006 typedef int (*SimpleCode)();
1007 EXPECT_EQ(0, EXECUTE_TEST_CODE_INT32(SimpleCode, test->entry()));
1008 }
1009
1010
1011 ASSEMBLER_TEST_GENERATE(Label_link2, assembler) {
1012 Label l;
1013
1014 __ beq(ZR, ZR, &l);
1015 __ beq(ZR, ZR, &l);
1016 __ beq(ZR, ZR, &l);
1017
regis 2013/04/03 21:12:39 ditto
zra 2013/04/03 21:41:00 Done.
1018 __ Bind(&l);
1019 __ mov(V0, ZR);
1020 __ jr(RA);
1021 }
1022
1023
1024 ASSEMBLER_TEST_RUN(Label_link2, test) {
1025 typedef int (*SimpleCode)();
1026 EXPECT_EQ(0, EXECUTE_TEST_CODE_INT32(SimpleCode, test->entry()));
1027 }
1028
1029
992 ASSEMBLER_TEST_GENERATE(Jalr_delay, assembler) { 1030 ASSEMBLER_TEST_GENERATE(Jalr_delay, assembler) {
993 __ mov(R2, RA); 1031 __ mov(R2, RA);
994 __ jalr(R2, RA); 1032 __ jalr(R2, RA);
995 __ delay_slot()->ori(V0, ZR, Immediate(42)); 1033 __ delay_slot()->ori(V0, ZR, Immediate(42));
996 } 1034 }
997 1035
998 1036
999 ASSEMBLER_TEST_RUN(Jalr_delay, test) { 1037 ASSEMBLER_TEST_RUN(Jalr_delay, test) {
1000 typedef int (*SimpleCode)(); 1038 typedef int (*SimpleCode)();
1001 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT32(SimpleCode, test->entry())); 1039 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT32(SimpleCode, test->entry()));
1002 } 1040 }
1003 1041
1004 } // namespace dart 1042 } // namespace dart
1005 1043
1006 #endif // defined TARGET_ARCH_MIPS 1044 #endif // defined TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698