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

Unified Diff: runtime/vm/intrinsifier_ia32.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/intrinsifier_ia32.cc
===================================================================
--- runtime/vm/intrinsifier_ia32.cc (revision 41040)
+++ runtime/vm/intrinsifier_ia32.cc (working copy)
@@ -654,7 +654,7 @@
__ movl(EAX, EBX);
__ shll(EBX, ECX);
__ xorl(EDI, EDI);
- __ shld(EDI, EAX);
+ __ shldl(EDI, EAX);
// Result in EDI (high) and EBX (low).
const Class& mint_class = Class::Handle(
Isolate::Current()->object_store()->mint_class());
@@ -1096,7 +1096,7 @@
// uint32_t mi = *mip++
__ movl(EAX, Address(EDI, 0));
- __ addl(EDI, Immediate(kWordSize));
+ __ addl(EDI, Immediate(Bigint::kBytesPerDigit));
// uint64_t t = x*mi
__ mull(EBX); // t = EDX:EAX = EAX * EBX
@@ -1109,7 +1109,7 @@
// *ajp++ = low32(t)
__ movl(Address(ESI, 0), EAX);
- __ addl(ESI, Immediate(kWordSize));
+ __ addl(ESI, Immediate(Bigint::kBytesPerDigit));
// c = high32(t)
__ movl(ECX, EDX);
@@ -1120,7 +1120,7 @@
Label done;
__ testl(ECX, ECX);
- __ j(ZERO, &done);
+ __ j(ZERO, &done, Assembler::kNearJump);
// *ajp += c
__ addl(Address(ESI, 0), ECX);
@@ -1128,7 +1128,7 @@
Label propagate_carry_loop;
__ Bind(&propagate_carry_loop);
- __ addl(ESI, Immediate(kWordSize));
+ __ addl(ESI, Immediate(Bigint::kBytesPerDigit));
__ incl(Address(ESI, 0)); // c == 0 or 1
__ j(CARRY, &propagate_carry_loop, Assembler::kNearJump);
@@ -1178,8 +1178,8 @@
Label x_zero;
__ movl(EBX, Address(EDI, 0));
__ cmpl(EBX, Immediate(0));
- __ j(EQUAL, &x_zero);
- __ addl(EDI, Immediate(kWordSize));
+ __ j(EQUAL, &x_zero, Assembler::kNearJump);
+ __ addl(EDI, Immediate(Bigint::kBytesPerDigit));
// Preserve CTX to free ESI.
__ pushl(CTX);
@@ -1197,7 +1197,7 @@
// *ajp++ = low32(t)
__ movl(Address(ESI, 0), EAX);
- __ addl(ESI, Immediate(kWordSize));
+ __ addl(ESI, Immediate(Bigint::kBytesPerDigit));
// int n = used - i - 1
__ movl(EAX, Address(ESP, 2 * kWordSize)); // used is Smi
@@ -1225,17 +1225,17 @@
// while (--n >= 0)
__ decl(Address(ESP, 2 * kWordSize)); // --n
- __ j(NEGATIVE, &done);
+ __ j(NEGATIVE, &done, Assembler::kNearJump);
// uint32_t xi = *xip++
__ movl(EAX, Address(EDI, 0));
- __ addl(EDI, Immediate(kWordSize));
+ __ addl(EDI, Immediate(Bigint::kBytesPerDigit));
// uint96_t t = ECX:EDX:EAX = 2*x*xi + aj + c
__ mull(EBX); // EDX:EAX = EAX * EBX
__ xorl(ECX, ECX); // ECX = 0
- __ shld(ECX, EDX, Immediate(1));
- __ shld(EDX, EAX, Immediate(1));
+ __ shldl(ECX, EDX, Immediate(1));
+ __ shldl(EDX, EAX, Immediate(1));
__ shll(EAX, Immediate(1)); // ECX:EDX:EAX <<= 1
__ addl(EAX, Address(ESI, 0)); // t += aj
__ adcl(EDX, Immediate(0));
@@ -1246,7 +1246,7 @@
// *ajp++ = low32(t)
__ movl(Address(ESI, 0), EAX);
- __ addl(ESI, Immediate(kWordSize));
+ __ addl(ESI, Immediate(Bigint::kBytesPerDigit));
// c = high64(t)
__ movl(cl_addr, EDX);
@@ -1264,7 +1264,7 @@
// *ajp++ = low32(t)
// *ajp = high32(t)
__ movl(Address(ESI, 0), EAX);
- __ movl(Address(ESI, kWordSize), EDX);
+ __ movl(Address(ESI, Bigint::kBytesPerDigit), EDX);
// Restore CTX and return.
__ Drop(3);
@@ -1314,7 +1314,7 @@
__ j(EQUAL, &return_qd, Assembler::kNearJump);
// EAX = dl = dp[-1]
- __ movl(EAX, Address(EBX, -kWordSize));
+ __ movl(EAX, Address(EBX, -Bigint::kBytesPerDigit));
// EAX = qd = dh:dl / yt = EDX:EAX / ECX
__ divl(ECX);
@@ -1321,7 +1321,8 @@
__ Bind(&return_qd);
// args[1] = qd
- __ movl(FieldAddress(EDI, TypedData::data_offset() + kWordSize), EAX);
+ __ movl(FieldAddress(EDI, TypedData::data_offset() + Bigint::kBytesPerDigit),
+ EAX);
// Returning Object::null() is not required, since this method is private.
__ ret();
@@ -1352,7 +1353,8 @@
__ mull(ECX);
// args[1] = t mod DIGIT_BASE = low32(t)
- __ movl(FieldAddress(EDI, TypedData::data_offset() + kWordSize), EAX);
+ __ movl(FieldAddress(EDI, TypedData::data_offset() + Bigint::kBytesPerDigit),
+ EAX);
// Returning Object::null() is not required, since this method is private.
__ ret();

Powered by Google App Engine
This is Rietveld 408576698