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

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

Issue 10440099: Adding unary op optimizations. missing assembly operations/ (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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
« no previous file with comments | « runtime/vm/assembler_x64.h ('k') | runtime/vm/assembler_x64_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 ASSERT(a <= XMM7); 528 ASSERT(a <= XMM7);
529 ASSERT(b <= XMM7); 529 ASSERT(b <= XMM7);
530 AssemblerBuffer::EnsureCapacity ensured(&buffer_); 530 AssemblerBuffer::EnsureCapacity ensured(&buffer_);
531 EmitUint8(0x66); 531 EmitUint8(0x66);
532 EmitUint8(0x0F); 532 EmitUint8(0x0F);
533 EmitUint8(0x2F); 533 EmitUint8(0x2F);
534 EmitXmmRegisterOperand(a, b); 534 EmitXmmRegisterOperand(a, b);
535 } 535 }
536 536
537 537
538 void Assembler::xorpd(XmmRegister dst, const Address& src) {
539 ASSERT(dst <= XMM7);
540 AssemblerBuffer::EnsureCapacity ensured(&buffer_);
541 EmitUint8(0x66);
542 EmitOperandREX(0, src, REX_NONE);
543 EmitUint8(0x0F);
544 EmitUint8(0x57);
545 EmitOperand(dst & 7, src);
546 }
547
548
538 void Assembler::xchgl(Register dst, Register src) { 549 void Assembler::xchgl(Register dst, Register src) {
539 AssemblerBuffer::EnsureCapacity ensured(&buffer_); 550 AssemblerBuffer::EnsureCapacity ensured(&buffer_);
540 Operand operand(src); 551 Operand operand(src);
541 EmitOperandREX(dst, operand, REX_NONE); 552 EmitOperandREX(dst, operand, REX_NONE);
542 EmitUint8(0x87); 553 EmitUint8(0x87);
543 EmitOperand(dst & 7, operand); 554 EmitOperand(dst & 7, operand);
544 } 555 }
545 556
546 557
547 void Assembler::xchgq(Register dst, Register src) { 558 void Assembler::xchgq(Register dst, Register src) {
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
1056 1067
1057 1068
1058 void Assembler::negq(Register reg) { 1069 void Assembler::negq(Register reg) {
1059 AssemblerBuffer::EnsureCapacity ensured(&buffer_); 1070 AssemblerBuffer::EnsureCapacity ensured(&buffer_);
1060 EmitRegisterREX(reg, REX_W); 1071 EmitRegisterREX(reg, REX_W);
1061 EmitUint8(0xF7); 1072 EmitUint8(0xF7);
1062 EmitOperand(3, Operand(reg)); 1073 EmitOperand(3, Operand(reg));
1063 } 1074 }
1064 1075
1065 1076
1077 void Assembler::notq(Register reg) {
1078 AssemblerBuffer::EnsureCapacity ensured(&buffer_);
1079 EmitRegisterREX(reg, REX_W);
1080 EmitUint8(0xF7);
1081 EmitUint8(0xD0 | (reg & 7));
1082 }
1083
1084
1066 void Assembler::enter(const Immediate& imm) { 1085 void Assembler::enter(const Immediate& imm) {
1067 AssemblerBuffer::EnsureCapacity ensured(&buffer_); 1086 AssemblerBuffer::EnsureCapacity ensured(&buffer_);
1068 EmitUint8(0xC8); 1087 EmitUint8(0xC8);
1069 ASSERT(imm.is_uint16()); 1088 ASSERT(imm.is_uint16());
1070 EmitUint8(imm.value() & 0xFF); 1089 EmitUint8(imm.value() & 0xFF);
1071 EmitUint8((imm.value() >> 8) & 0xFF); 1090 EmitUint8((imm.value() >> 8) & 0xFF);
1072 EmitUint8(0x00); 1091 EmitUint8(0x00);
1073 } 1092 }
1074 1093
1075 1094
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
1336 1355
1337 1356
1338 void Assembler::StoreIntoObject(Register object, 1357 void Assembler::StoreIntoObject(Register object,
1339 const FieldAddress& dest, 1358 const FieldAddress& dest,
1340 Register value) { 1359 Register value) {
1341 // TODO(iposva): Add write barrier. 1360 // TODO(iposva): Add write barrier.
1342 movq(dest, value); 1361 movq(dest, value);
1343 } 1362 }
1344 1363
1345 1364
1365 void Assembler::DoubleNegate(XmmRegister d) {
1366 static const struct ALIGN16 {
1367 uint64_t a;
1368 uint64_t b;
1369 } double_negate_constant =
1370 {0x8000000000000000LL, 0x8000000000000000LL};
1371 movq(TMP, Immediate(reinterpret_cast<intptr_t>(&double_negate_constant)));
1372 xorpd(d, Address(TMP, 0));
1373 }
1374
1375
1346 void Assembler::Stop(const char* message) { 1376 void Assembler::Stop(const char* message) {
1347 int64_t message_address = reinterpret_cast<int64_t>(message); 1377 int64_t message_address = reinterpret_cast<int64_t>(message);
1348 if (FLAG_print_stop_message) { 1378 if (FLAG_print_stop_message) {
1349 pushq(TMP); // Preserve TMP register. 1379 pushq(TMP); // Preserve TMP register.
1350 pushq(RDI); // Preserve RDI register. 1380 pushq(RDI); // Preserve RDI register.
1351 movq(RDI, Immediate(message_address)); 1381 movq(RDI, Immediate(message_address));
1352 call(&StubCode::PrintStopMessageLabel()); 1382 call(&StubCode::PrintStopMessageLabel());
1353 popq(RDI); // Restore RDI register. 1383 popq(RDI); // Restore RDI register.
1354 popq(TMP); // Restore TMP register. 1384 popq(TMP); // Restore TMP register.
1355 } else { 1385 } else {
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
1596 comments.SetCommentAt(i, comments_[i]->comment()); 1626 comments.SetCommentAt(i, comments_[i]->comment());
1597 } 1627 }
1598 1628
1599 return comments; 1629 return comments;
1600 } 1630 }
1601 1631
1602 1632
1603 } // namespace dart 1633 } // namespace dart
1604 1634
1605 #endif // defined TARGET_ARCH_X64 1635 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/assembler_x64.h ('k') | runtime/vm/assembler_x64_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698