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

Unified Diff: runtime/vm/assembler_arm64_test.cc

Issue 1124173002: Implement Smi_bitLength intrinsic on mips, arm, and arm64. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 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_arm64.h ('k') | runtime/vm/constants_arm64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_arm64_test.cc
===================================================================
--- runtime/vm/assembler_arm64_test.cc (revision 45551)
+++ runtime/vm/assembler_arm64_test.cc (working copy)
@@ -723,6 +723,38 @@
}
+ASSEMBLER_TEST_GENERATE(Clz, assembler) {
+ Label error;
+
+ __ clz(R1, ZR);
+ __ cmp(R1, Operand(64));
+ __ b(&error, NE);
+ __ LoadImmediate(R2, 42, kNoPP);
+ __ clz(R2, R2);
+ __ cmp(R2, Operand(58));
+ __ b(&error, NE);
+ __ LoadImmediate(R0, -1, kNoPP);
+ __ clz(R1, R0);
+ __ cmp(R1, Operand(0));
+ __ b(&error, NE);
+ __ add(R0, ZR, Operand(R0, LSR, 3));
+ __ clz(R1, R0);
+ __ cmp(R1, Operand(3));
+ __ b(&error, NE);
+ __ mov(R0, ZR);
+ __ ret();
+ __ Bind(&error);
+ __ LoadImmediate(R0, 1, kNoPP);
+ __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(Clz, test) {
+ typedef int64_t (*Int64Return)() DART_UNUSED;
+ EXPECT_EQ(0, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry()));
+}
+
+
// Comparisons, branching.
ASSEMBLER_TEST_GENERATE(BranchALForward, assembler) {
Label l;
« no previous file with comments | « runtime/vm/assembler_arm64.h ('k') | runtime/vm/constants_arm64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698