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

Unified Diff: runtime/vm/assembler_x64_test.cc

Issue 648613006: Implement bigint absAdd, absSub, mulAdd, sqrAdd, estQuotientDigit intrinsics, (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 2 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
Index: runtime/vm/assembler_x64_test.cc
===================================================================
--- runtime/vm/assembler_x64_test.cc (revision 41040)
+++ runtime/vm/assembler_x64_test.cc (working copy)
@@ -386,6 +386,21 @@
}
+ASSEMBLER_TEST_GENERATE(UnsignedMultiply, assembler) {
+ __ movl(RAX, Immediate(-1));
+ __ movl(RCX, Immediate(16));
+ __ mull(RCX);
zra 2014/10/10 16:23:43 A comment about what is going on here might be goo
regis 2014/10/10 19:15:47 Done.
+ __ movq(RAX, RDX);
+ __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(UnsignedMultiply, test) {
+ typedef int (*UnsignedMultiply)();
+ EXPECT_EQ(15, reinterpret_cast<UnsignedMultiply>(test->entry())());
+}
+
+
ASSEMBLER_TEST_GENERATE(SignedMultiply64, assembler) {
__ pushq(R15); // Callee saved.
__ movq(RAX, Immediate(2));
@@ -508,6 +523,21 @@
}
+ASSEMBLER_TEST_GENERATE(UnsignedDivide, assembler) {
+ __ movl(RAX, Immediate(0x0));
+ __ movl(RDX, Immediate(0xfffffffff0000000));
zra 2014/10/10 16:23:43 movq? Can you really give such a big immediate to
regis 2014/10/10 19:15:47 If you do not specify the high bits, the value is
+ __ movl(RCX, Immediate(-1));
+ __ divl(RCX);
zra 2014/10/10 16:23:43 A comment here too.
regis 2014/10/10 19:15:47 ditto
+ __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(UnsignedDivide, test) {
+ typedef uint32_t (*UnsignedDivide)();
+ EXPECT_EQ(0xF0000000, reinterpret_cast<UnsignedDivide>(test->entry())());
+}
+
+
ASSEMBLER_TEST_GENERATE(SignedDivideLong, assembler) {
__ movq(RAX, Immediate(kLargeConstant));
__ movq(RDX, Immediate(123));
@@ -905,6 +935,17 @@
__ movl(Address(RAX, 0), RAX);
__ Bind(&donetest13a);
+ Label donetest15a;
+ __ movl(RDX, Immediate(0xffffffffff000000));
zra 2014/10/10 16:23:43 Same question in the sequence with l vs. q version
regis 2014/10/10 19:15:47 ditto
+ __ movl(RAX, Immediate(-1));
+ __ movl(RCX, Immediate(2));
+ __ shll(RDX, RCX);
+ __ shldl(RDX, RAX, Immediate(2));
zra 2014/10/10 16:23:43 A comment here.
regis 2014/10/10 19:15:47 Done.
+ __ cmpl(RDX, Immediate(0xfffffffff0000003));
+ __ j(EQUAL, &donetest15a);
+ __ int3();
+ __ Bind(&donetest15a);
+
__ movl(RAX, Immediate(0));
__ ret();
}

Powered by Google App Engine
This is Rietveld 408576698