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

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

Issue 905653004: Clarify result returned by remainder intrinsics. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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_ARM64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64.
6 #if defined(TARGET_ARCH_ARM64) 6 #if defined(TARGET_ARCH_ARM64)
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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 359
360 360
361 // Optimizations: 361 // Optimizations:
362 // - result is 0 if: 362 // - result is 0 if:
363 // - left is 0 363 // - left is 0
364 // - left equals right 364 // - left equals right
365 // - result is left if 365 // - result is left if
366 // - left > 0 && left < right 366 // - left > 0 && left < right
367 // R1: Tagged left (dividend). 367 // R1: Tagged left (dividend).
368 // R0: Tagged right (divisor). 368 // R0: Tagged right (divisor).
369 // Returns with result in R0, OR: 369 // Returns:
370 // R1: Untagged result (remainder). 370 // R1: Untagged fallthrough result (remainder to be adjusted), or
371 // R0: Tagged return result (remainder).
371 static void EmitRemainderOperation(Assembler* assembler) { 372 static void EmitRemainderOperation(Assembler* assembler) {
372 Label return_zero, modulo; 373 Label return_zero, modulo;
373 const Register left = R1; 374 const Register left = R1;
374 const Register right = R0; 375 const Register right = R0;
375 const Register result = R1; 376 const Register result = R1;
376 const Register tmp = R2; 377 const Register tmp = R2;
377 ASSERT(left == result); 378 ASSERT(left == result);
378 379
379 // Check for quick zero results. 380 // Check for quick zero results.
380 __ CompareRegisters(left, ZR); 381 __ CompareRegisters(left, ZR);
(...skipping 1624 matching lines...) Expand 10 before | Expand all | Expand 10 after
2005 Isolate* isolate = Isolate::Current(); 2006 Isolate* isolate = Isolate::Current();
2006 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate), kNoPP); 2007 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate), kNoPP);
2007 // Set return value to Isolate::current_tag_. 2008 // Set return value to Isolate::current_tag_.
2008 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); 2009 __ ldr(R0, Address(R1, Isolate::current_tag_offset()));
2009 __ ret(); 2010 __ ret();
2010 } 2011 }
2011 2012
2012 } // namespace dart 2013 } // namespace dart
2013 2014
2014 #endif // defined TARGET_ARCH_ARM64 2015 #endif // defined TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698