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

Unified Diff: runtime/vm/assembler_x64_test.cc

Issue 383443002: Removes branches from LoadTaggedClassIdMayBeSmi. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 5 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_x64.cc ('k') | runtime/vm/flow_graph_compiler_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_x64_test.cc
===================================================================
--- runtime/vm/assembler_x64_test.cc (revision 38085)
+++ runtime/vm/assembler_x64_test.cc (working copy)
@@ -2949,6 +2949,26 @@
EXPECT_EQ(-1, res); // Less.
}
+
+// Return 1 if equal, 0 if not equal.
+ASSEMBLER_TEST_GENERATE(ConditionalMovesEqual, assembler) {
+ __ xorq(RAX, RAX);
+ __ movq(RCX, Immediate(1));
+ __ movq(RDX, CallingConventions::kArg1Reg);
+ __ cmpq(RDX, Immediate(785));
+ __ cmoveq(RAX, RCX);
+ __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(ConditionalMovesEqual, test) {
+ typedef int (*ConditionalMovesEqualCode)(int i);
+ int res = reinterpret_cast<ConditionalMovesEqualCode>(test->entry())(785);
+ EXPECT_EQ(1, res);
+ res = reinterpret_cast<ConditionalMovesEqualCode>(test->entry())(-12);
+ EXPECT_EQ(0, res);
+}
+
} // namespace dart
#endif // defined TARGET_ARCH_X64
« no previous file with comments | « runtime/vm/assembler_x64.cc ('k') | runtime/vm/flow_graph_compiler_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698