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

Side by Side Diff: runtime/vm/intrinsifier_arm.cc

Issue 701233003: Implement bigint intrinsics on arm64. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/intrinsifier.h" 8 #include "vm/intrinsifier.h"
9 9
10 #include "vm/assembler.h" 10 #include "vm/assembler.h"
(...skipping 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after
1186 // c: R7:R6 1186 // c: R7:R6
1187 // t: R2:R1:R0 (not live at loop entry) 1187 // t: R2:R1:R0 (not live at loop entry)
1188 // n: R8 1188 // n: R8
1189 1189
1190 // uint32_t xi = *xip++ 1190 // uint32_t xi = *xip++
1191 __ ldr(R2, Address(R4, Bigint::kBytesPerDigit, Address::PostIndex)); 1191 __ ldr(R2, Address(R4, Bigint::kBytesPerDigit, Address::PostIndex));
1192 1192
1193 // uint32_t aj = *ajp 1193 // uint32_t aj = *ajp
1194 __ ldr(R1, Address(R5, 0)); 1194 __ ldr(R1, Address(R5, 0));
1195 1195
1196 // uint96_t t = R2:R1:R0 = 2*x*xi + aj + c 1196 // uint96_t t = R7:R6:R0 = 2*x*xi + aj + c
1197 __ mov(R0, Operand(0)); 1197 __ mov(R0, Operand(0));
1198 __ umaal(R0, R1, R2, R3); // R1:R0 = R3*R2 + R1 + R0 = x*xi + aj + 0. 1198 __ umaal(R0, R1, R2, R3); // R1:R0 = R3*R2 + R1 + R0 = x*xi + aj + 0.
1199 __ umlal(R6, R7, R2, R3); // R7:R6 += R3*R2; c += x*xi. 1199 __ umlal(R6, R7, R2, R3); // R7:R6 += R3*R2; c += x*xi.
1200 __ adds(R0, R0, Operand(R6)); 1200 __ adds(R0, R0, Operand(R6));
1201 __ adcs(R6, R1, Operand(R7)); 1201 __ adcs(R6, R1, Operand(R7));
1202 __ mov(R7, Operand(0)); 1202 __ mov(R7, Operand(0));
1203 __ adc(R7, R7, Operand(0)); // R7:R6:R0 = R1:R0 + R7:R6 = 2*x*xi + aj + c. 1203 __ adc(R7, R7, Operand(0)); // R7:R6:R0 = R1:R0 + R7:R6 = 2*x*xi + aj + c.
1204 1204
1205 // *ajp++ = low32(t) = R0 1205 // *ajp++ = low32(t) = R0
1206 __ str(R0, Address(R5, Bigint::kBytesPerDigit, Address::PostIndex)); 1206 __ str(R0, Address(R5, Bigint::kBytesPerDigit, Address::PostIndex));
(...skipping 14 matching lines...) Expand all
1221 // *(ajp + 1) = high32(t) = R7 1221 // *(ajp + 1) = high32(t) = R7
1222 __ strd(R6, Address(R5, 0)); 1222 __ strd(R6, Address(R5, 0));
1223 1223
1224 __ Bind(&x_zero); 1224 __ Bind(&x_zero);
1225 // Returning Object::null() is not required, since this method is private. 1225 // Returning Object::null() is not required, since this method is private.
1226 __ Ret(); 1226 __ Ret();
1227 } 1227 }
1228 1228
1229 1229
1230 void Intrinsifier::Bigint_estQuotientDigit(Assembler* assembler) { 1230 void Intrinsifier::Bigint_estQuotientDigit(Assembler* assembler) {
1231 // TODO(regis): Implement. 1231 // No unsigned 64-bit / 32-bit divide instruction.
1232 } 1232 }
1233 1233
1234 1234
1235 void Intrinsifier::Montgomery_mulMod(Assembler* assembler) { 1235 void Intrinsifier::Montgomery_mulMod(Assembler* assembler) {
1236 if (TargetCPUFeatures::arm_version() != ARMv7) { 1236 if (TargetCPUFeatures::arm_version() != ARMv7) {
1237 return; 1237 return;
1238 } 1238 }
1239 // Pseudo code: 1239 // Pseudo code:
1240 // static void _mulMod(Uint32List args, Uint32List digits, int i) { 1240 // static void _mulMod(Uint32List args, Uint32List digits, int i) {
1241 // uint32_t rho = args[_RHO]; // _RHO == 0. 1241 // uint32_t rho = args[_RHO]; // _RHO == 0.
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
2004 Isolate* isolate = Isolate::Current(); 2004 Isolate* isolate = Isolate::Current();
2005 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); 2005 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate));
2006 // Set return value to Isolate::current_tag_. 2006 // Set return value to Isolate::current_tag_.
2007 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); 2007 __ ldr(R0, Address(R1, Isolate::current_tag_offset()));
2008 __ Ret(); 2008 __ Ret();
2009 } 2009 }
2010 2010
2011 } // namespace dart 2011 } // namespace dart
2012 2012
2013 #endif // defined TARGET_ARCH_ARM 2013 #endif // defined TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698