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

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 __ LoadImmediate(V0, 1);
regis 2013/04/03 21:44:29 You still miss the jr(RA), otherwise 1 is overwrit
1000 __ Bind(&l);
1001 __ mov(V0, ZR);
1002 __ jr(RA);
1003 }
1004
1005
1006 ASSEMBLER_TEST_RUN(Label_link1, test) {
1007 typedef int (*SimpleCode)();
1008 EXPECT_EQ(0, EXECUTE_TEST_CODE_INT32(SimpleCode, test->entry()));
1009 }
1010
1011
1012 ASSEMBLER_TEST_GENERATE(Label_link2, assembler) {
1013 Label l;
1014
1015 __ beq(ZR, ZR, &l);
1016 __ beq(ZR, ZR, &l);
1017 __ beq(ZR, ZR, &l);
1018
1019 __ LoadImmediate(V0, 1);
regis 2013/04/03 21:44:29 ditto
1020 __ Bind(&l);
1021 __ mov(V0, ZR);
1022 __ jr(RA);
1023 }
1024
1025
1026 ASSEMBLER_TEST_RUN(Label_link2, test) {
1027 typedef int (*SimpleCode)();
1028 EXPECT_EQ(0, EXECUTE_TEST_CODE_INT32(SimpleCode, test->entry()));
1029 }
1030
1031
992 ASSEMBLER_TEST_GENERATE(Jalr_delay, assembler) { 1032 ASSEMBLER_TEST_GENERATE(Jalr_delay, assembler) {
993 __ mov(R2, RA); 1033 __ mov(R2, RA);
994 __ jalr(R2, RA); 1034 __ jalr(R2, RA);
995 __ delay_slot()->ori(V0, ZR, Immediate(42)); 1035 __ delay_slot()->ori(V0, ZR, Immediate(42));
996 } 1036 }
997 1037
998 1038
999 ASSEMBLER_TEST_RUN(Jalr_delay, test) { 1039 ASSEMBLER_TEST_RUN(Jalr_delay, test) {
1000 typedef int (*SimpleCode)(); 1040 typedef int (*SimpleCode)();
1001 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT32(SimpleCode, test->entry())); 1041 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT32(SimpleCode, test->entry()));
1002 } 1042 }
1003 1043
1004 } // namespace dart 1044 } // namespace dart
1005 1045
1006 #endif // defined TARGET_ARCH_MIPS 1046 #endif // defined TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698