Chromium Code Reviews| OLD | NEW |
|---|---|
| 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_MIPS. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. |
| 6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
| 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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 357 | 357 |
| 358 | 358 |
| 359 // Optimizations: | 359 // Optimizations: |
| 360 // - result is 0 if: | 360 // - result is 0 if: |
| 361 // - left is 0 | 361 // - left is 0 |
| 362 // - left equals right | 362 // - left equals right |
| 363 // - result is left if | 363 // - result is left if |
| 364 // - left > 0 && left < right | 364 // - left > 0 && left < right |
| 365 // T1: Tagged left (dividend). | 365 // T1: Tagged left (dividend). |
| 366 // T0: Tagged right (divisor). | 366 // T0: Tagged right (divisor). |
| 367 // V0: Untagged result. | 367 // Returns: |
| 368 // V0: Untagged fallthrough result (remainder to be adjusted), or | |
| 369 // V0: Tagged return result (remainder). | |
|
zra
2015/02/06 22:27:34
V1 is available here if it would help to be consis
regis
2015/02/06 22:42:40
It does not have to be. X64 uses RAX in both cases
| |
| 368 static void EmitRemainderOperation(Assembler* assembler) { | 370 static void EmitRemainderOperation(Assembler* assembler) { |
| 369 Label return_zero, modulo; | 371 Label return_zero, modulo; |
| 370 const Register left = T1; | 372 const Register left = T1; |
| 371 const Register right = T0; | 373 const Register right = T0; |
| 372 const Register result = V0; | 374 const Register result = V0; |
| 373 | 375 |
| 374 __ beq(left, ZR, &return_zero); | 376 __ beq(left, ZR, &return_zero); |
| 375 __ beq(left, right, &return_zero); | 377 __ beq(left, right, &return_zero); |
| 376 | 378 |
| 377 __ bltz(left, &modulo); | 379 __ bltz(left, &modulo); |
| (...skipping 1649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2027 Isolate* isolate = Isolate::Current(); | 2029 Isolate* isolate = Isolate::Current(); |
| 2028 __ LoadImmediate(V0, reinterpret_cast<uword>(isolate)); | 2030 __ LoadImmediate(V0, reinterpret_cast<uword>(isolate)); |
| 2029 // Set return value. | 2031 // Set return value. |
| 2030 __ Ret(); | 2032 __ Ret(); |
| 2031 __ delay_slot()->lw(V0, Address(V0, Isolate::current_tag_offset())); | 2033 __ delay_slot()->lw(V0, Address(V0, Isolate::current_tag_offset())); |
| 2032 } | 2034 } |
| 2033 | 2035 |
| 2034 } // namespace dart | 2036 } // namespace dart |
| 2035 | 2037 |
| 2036 #endif // defined TARGET_ARCH_MIPS | 2038 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |