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

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

Issue 59613005: Merge (x & y) == 0 pattern to emit a single test instruction. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/longjump.h" 9 #include "vm/longjump.h"
10 #include "vm/runtime_entry.h" 10 #include "vm/runtime_entry.h"
(...skipping 2424 matching lines...) Expand 10 before | Expand all | Expand 10 after
2435 if (ShifterOperand::CanHold(value, &shifter_op)) { 2435 if (ShifterOperand::CanHold(value, &shifter_op)) {
2436 cmp(rn, shifter_op, cond); 2436 cmp(rn, shifter_op, cond);
2437 } else { 2437 } else {
2438 ASSERT(rn != IP); 2438 ASSERT(rn != IP);
2439 LoadImmediate(IP, value, cond); 2439 LoadImmediate(IP, value, cond);
2440 cmp(rn, ShifterOperand(IP), cond); 2440 cmp(rn, ShifterOperand(IP), cond);
2441 } 2441 }
2442 } 2442 }
2443 2443
2444 2444
2445 void Assembler::TestImmediate(Register rn, int32_t imm, Condition cond) {
2446 ShifterOperand shifter_op;
2447 if (ShifterOperand::CanHold(imm, &shifter_op)) {
2448 tst(rn, shifter_op, cond);
2449 } else {
2450 LoadImmediate(IP, imm);
2451 tst(rn, ShifterOperand(IP), cond);
2452 }
2453 }
2454
2445 void Assembler::IntegerDivide(Register result, Register left, Register right, 2455 void Assembler::IntegerDivide(Register result, Register left, Register right,
2446 DRegister tmpl, DRegister tmpr) { 2456 DRegister tmpl, DRegister tmpr) {
2447 ASSERT(tmpl != tmpr); 2457 ASSERT(tmpl != tmpr);
2448 if (CPUFeatures::integer_division_supported()) { 2458 if (CPUFeatures::integer_division_supported()) {
2449 sdiv(result, left, right); 2459 sdiv(result, left, right);
2450 } else { 2460 } else {
2451 SRegister stmpl = static_cast<SRegister>(2 * tmpl); 2461 SRegister stmpl = static_cast<SRegister>(2 * tmpl);
2452 SRegister stmpr = static_cast<SRegister>(2 * tmpr); 2462 SRegister stmpr = static_cast<SRegister>(2 * tmpr);
2453 vmovsr(stmpl, left); 2463 vmovsr(stmpl, left);
2454 vcvtdi(tmpl, stmpl); // left is in tmpl. 2464 vcvtdi(tmpl, stmpl); // left is in tmpl.
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
2752 2762
2753 const char* Assembler::FpuRegisterName(FpuRegister reg) { 2763 const char* Assembler::FpuRegisterName(FpuRegister reg) {
2754 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters)); 2764 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters));
2755 return fpu_reg_names[reg]; 2765 return fpu_reg_names[reg];
2756 } 2766 }
2757 2767
2758 } // namespace dart 2768 } // namespace dart
2759 2769
2760 #endif // defined TARGET_ARCH_ARM 2770 #endif // defined TARGET_ARCH_ARM
2761 2771
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698