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

Side by Side Diff: runtime/vm/assembler_x64.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_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/heap.h" 9 #include "vm/heap.h"
10 #include "vm/memory_region.h" 10 #include "vm/memory_region.h"
(...skipping 1440 matching lines...) Expand 10 before | Expand all | Expand 10 after
1451 } else { 1451 } else {
1452 EmitRegisterREX(reg, REX_W); 1452 EmitRegisterREX(reg, REX_W);
1453 EmitUint8(0xF7); 1453 EmitUint8(0xF7);
1454 EmitUint8(0xC0 | (reg & 7)); 1454 EmitUint8(0xC0 | (reg & 7));
1455 } 1455 }
1456 EmitImmediate(imm); 1456 EmitImmediate(imm);
1457 } 1457 }
1458 } 1458 }
1459 1459
1460 1460
1461 void Assembler::TestImmediate(Register dst, const Immediate& imm, Register pp) {
1462 if (CanLoadImmediateFromPool(imm, pp)) {
1463 ASSERT(dst != TMP);
1464 LoadImmediate(TMP, imm, pp);
1465 testq(dst, TMP);
1466 } else {
1467 testq(dst, imm);
1468 }
1469 }
1470
1471
1461 void Assembler::andl(Register dst, Register src) { 1472 void Assembler::andl(Register dst, Register src) {
1462 AssemblerBuffer::EnsureCapacity ensured(&buffer_); 1473 AssemblerBuffer::EnsureCapacity ensured(&buffer_);
1463 Operand operand(src); 1474 Operand operand(src);
1464 EmitOperandREX(dst, operand, REX_NONE); 1475 EmitOperandREX(dst, operand, REX_NONE);
1465 EmitUint8(0x23); 1476 EmitUint8(0x23);
1466 EmitOperand(dst & 7, operand); 1477 EmitOperand(dst & 7, operand);
1467 } 1478 }
1468 1479
1469 1480
1470 void Assembler::andl(Register dst, const Immediate& imm) { 1481 void Assembler::andl(Register dst, const Immediate& imm) {
(...skipping 1614 matching lines...) Expand 10 before | Expand all | Expand 10 after
3085 3096
3086 3097
3087 const char* Assembler::FpuRegisterName(FpuRegister reg) { 3098 const char* Assembler::FpuRegisterName(FpuRegister reg) {
3088 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); 3099 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters));
3089 return xmm_reg_names[reg]; 3100 return xmm_reg_names[reg];
3090 } 3101 }
3091 3102
3092 } // namespace dart 3103 } // namespace dart
3093 3104
3094 #endif // defined TARGET_ARCH_X64 3105 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698