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

Unified Diff: runtime/vm/assembler_ia32_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_ia32.cc ('k') | runtime/vm/assembler_mips.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_ia32_test.cc
===================================================================
--- runtime/vm/assembler_ia32_test.cc (revision 38085)
+++ runtime/vm/assembler_ia32_test.cc (working copy)
@@ -3019,6 +3019,26 @@
}
+// Return 1 if equal, 0 if not equal.
+ASSEMBLER_TEST_GENERATE(ConditionalMovesEqual, assembler) {
+ __ xorl(EAX, EAX);
+ __ movl(ECX, Immediate(1));
+ __ movl(EDX, Address(ESP, 1 * kWordSize));
+ __ cmpl(EDX, Immediate(785));
+ __ cmove(EAX, ECX);
+ __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(ConditionalMovesEqual, test) {
+ typedef int (*ConditionalMovesSignCode)(int i);
+ int res = reinterpret_cast<ConditionalMovesSignCode>(test->entry())(785);
+ EXPECT_EQ(1, res);
+ res = reinterpret_cast<ConditionalMovesSignCode>(test->entry())(-12);
+ EXPECT_EQ(0, res);
+}
+
+
ASSEMBLER_TEST_GENERATE(ConditionalMovesCompare, assembler) {
__ movl(EDX, Immediate(1)); // Greater equal.
__ movl(ECX, Immediate(-1)); // Less
« no previous file with comments | « runtime/vm/assembler_ia32.cc ('k') | runtime/vm/assembler_mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698