OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 ASSERT(a <= XMM7); | 531 ASSERT(a <= XMM7); |
532 ASSERT(b <= XMM7); | 532 ASSERT(b <= XMM7); |
533 AssemblerBuffer::EnsureCapacity ensured(&buffer_); | 533 AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
534 EmitUint8(0x66); | 534 EmitUint8(0x66); |
535 EmitUint8(0x0F); | 535 EmitUint8(0x0F); |
536 EmitUint8(0x2F); | 536 EmitUint8(0x2F); |
537 EmitXmmRegisterOperand(a, b); | 537 EmitXmmRegisterOperand(a, b); |
538 } | 538 } |
539 | 539 |
540 | 540 |
| 541 void Assembler::movmskpd(Register dst, XmmRegister src) { |
| 542 ASSERT(src <= XMM7); |
| 543 AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
| 544 EmitUint8(0x66); |
| 545 EmitUint8(0x0F); |
| 546 EmitUint8(0x50); |
| 547 EmitXmmRegisterOperand(dst, src); |
| 548 } |
| 549 |
| 550 |
541 void Assembler::sqrtsd(XmmRegister dst, XmmRegister src) { | 551 void Assembler::sqrtsd(XmmRegister dst, XmmRegister src) { |
542 ASSERT(dst <= XMM7); | 552 ASSERT(dst <= XMM7); |
543 ASSERT(src <= XMM7); | 553 ASSERT(src <= XMM7); |
544 AssemblerBuffer::EnsureCapacity ensured(&buffer_); | 554 AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
545 EmitUint8(0xF2); | 555 EmitUint8(0xF2); |
546 EmitUint8(0x0F); | 556 EmitUint8(0x0F); |
547 EmitUint8(0x51); | 557 EmitUint8(0x51); |
548 EmitXmmRegisterOperand(dst, src); | 558 EmitXmmRegisterOperand(dst, src); |
549 } | 559 } |
550 | 560 |
551 | 561 |
552 void Assembler::xorpd(XmmRegister dst, const Address& src) { | 562 void Assembler::xorpd(XmmRegister dst, const Address& src) { |
553 ASSERT(dst <= XMM7); | 563 ASSERT(dst <= XMM7); |
554 AssemblerBuffer::EnsureCapacity ensured(&buffer_); | 564 AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
555 EmitUint8(0x66); | 565 EmitUint8(0x66); |
556 EmitOperandREX(0, src, REX_NONE); | 566 EmitOperandREX(0, src, REX_NONE); |
557 EmitUint8(0x0F); | 567 EmitUint8(0x0F); |
558 EmitUint8(0x57); | 568 EmitUint8(0x57); |
559 EmitOperand(dst & 7, src); | 569 EmitOperand(dst & 7, src); |
560 } | 570 } |
561 | 571 |
562 | 572 |
| 573 void Assembler::xorpd(XmmRegister dst, XmmRegister src) { |
| 574 ASSERT(dst <= XMM7); |
| 575 ASSERT(src <= XMM7); |
| 576 AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
| 577 EmitUint8(0x66); |
| 578 EmitUint8(0x0F); |
| 579 EmitUint8(0x57); |
| 580 EmitXmmRegisterOperand(dst, src); |
| 581 } |
| 582 |
| 583 |
563 void Assembler::cvtsi2sd(XmmRegister dst, Register src) { | 584 void Assembler::cvtsi2sd(XmmRegister dst, Register src) { |
564 AssemblerBuffer::EnsureCapacity ensured(&buffer_); | 585 AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
565 ASSERT(dst <= XMM7); | 586 ASSERT(dst <= XMM7); |
566 Operand operand(src); | 587 Operand operand(src); |
567 EmitUint8(0xF2); | 588 EmitUint8(0xF2); |
568 EmitOperandREX(0, operand, REX_W); | 589 EmitOperandREX(0, operand, REX_W); |
569 EmitUint8(0x0F); | 590 EmitUint8(0x0F); |
570 EmitUint8(0x2A); | 591 EmitUint8(0x2A); |
571 EmitOperand(dst, operand); | 592 EmitOperand(dst, operand); |
572 } | 593 } |
573 | 594 |
574 | 595 |
| 596 void Assembler::fldl(const Address& src) { |
| 597 AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
| 598 EmitUint8(0xDD); |
| 599 EmitOperand(0, src); |
| 600 } |
| 601 |
| 602 |
| 603 void Assembler::fstpl(const Address& dst) { |
| 604 AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
| 605 EmitUint8(0xDD); |
| 606 EmitOperand(3, dst); |
| 607 } |
| 608 |
| 609 |
| 610 void Assembler::fildl(const Address& src) { |
| 611 AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
| 612 EmitUint8(0xDF); |
| 613 EmitOperand(5, src); |
| 614 } |
| 615 |
| 616 void Assembler::fincstp() { |
| 617 AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
| 618 EmitUint8(0xD9); |
| 619 EmitUint8(0xF7); |
| 620 } |
| 621 |
| 622 |
| 623 void Assembler::ffree(intptr_t value) { |
| 624 ASSERT(value < 7); |
| 625 AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
| 626 EmitUint8(0xDD); |
| 627 EmitUint8(0xC0 + value); |
| 628 } |
| 629 |
| 630 |
| 631 void Assembler::fsin() { |
| 632 AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
| 633 EmitUint8(0xD9); |
| 634 EmitUint8(0xFE); |
| 635 } |
| 636 |
| 637 |
| 638 void Assembler::fcos() { |
| 639 AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
| 640 EmitUint8(0xD9); |
| 641 EmitUint8(0xFF); |
| 642 } |
| 643 |
| 644 |
575 void Assembler::xchgl(Register dst, Register src) { | 645 void Assembler::xchgl(Register dst, Register src) { |
576 AssemblerBuffer::EnsureCapacity ensured(&buffer_); | 646 AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
577 Operand operand(src); | 647 Operand operand(src); |
578 EmitOperandREX(dst, operand, REX_NONE); | 648 EmitOperandREX(dst, operand, REX_NONE); |
579 EmitUint8(0x87); | 649 EmitUint8(0x87); |
580 EmitOperand(dst & 7, operand); | 650 EmitOperand(dst & 7, operand); |
581 } | 651 } |
582 | 652 |
583 | 653 |
584 void Assembler::xchgq(Register dst, Register src) { | 654 void Assembler::xchgq(Register dst, Register src) { |
(...skipping 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1782 | 1852 |
1783 const char* Assembler::RegisterName(Register reg) { | 1853 const char* Assembler::RegisterName(Register reg) { |
1784 ASSERT((0 <= reg) && (reg < kNumberOfCpuRegisters)); | 1854 ASSERT((0 <= reg) && (reg < kNumberOfCpuRegisters)); |
1785 return cpu_reg_names[reg]; | 1855 return cpu_reg_names[reg]; |
1786 } | 1856 } |
1787 | 1857 |
1788 | 1858 |
1789 } // namespace dart | 1859 } // namespace dart |
1790 | 1860 |
1791 #endif // defined TARGET_ARCH_X64 | 1861 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |