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

Side by Side Diff: src/x64/assembler-x64.cc

Issue 2827022: X64: Change some fpu operations to use XMM registers. (Closed)
Patch Set: Addressed review comment. Created 10 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
« no previous file with comments | « src/x64/assembler-x64.h ('k') | src/x64/codegen-x64.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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 2588 matching lines...) Expand 10 before | Expand all | Expand 10 after
2599 EnsureSpace ensure_space(this); 2599 EnsureSpace ensure_space(this);
2600 last_pc_ = pc_; 2600 last_pc_ = pc_;
2601 emit(0xF2); // double 2601 emit(0xF2); // double
2602 emit_optional_rex_32(dst, src); 2602 emit_optional_rex_32(dst, src);
2603 emit(0x0F); 2603 emit(0x0F);
2604 emit(0x10); // load 2604 emit(0x10); // load
2605 emit_sse_operand(dst, src); 2605 emit_sse_operand(dst, src);
2606 } 2606 }
2607 2607
2608 2608
2609 void Assembler::movss(XMMRegister dst, const Operand& src) {
2610 EnsureSpace ensure_space(this);
2611 last_pc_ = pc_;
2612 emit(0xF3); // single
2613 emit_optional_rex_32(dst, src);
2614 emit(0x0F);
2615 emit(0x10); // load
2616 emit_sse_operand(dst, src);
2617 }
2618
2619
2620 void Assembler::movss(const Operand& src, XMMRegister dst) {
2621 EnsureSpace ensure_space(this);
2622 last_pc_ = pc_;
2623 emit(0xF3); // single
2624 emit_optional_rex_32(dst, src);
2625 emit(0x0F);
2626 emit(0x11); // store
2627 emit_sse_operand(dst, src);
2628 }
2629
2630
2609 void Assembler::cvttss2si(Register dst, const Operand& src) { 2631 void Assembler::cvttss2si(Register dst, const Operand& src) {
2610 EnsureSpace ensure_space(this); 2632 EnsureSpace ensure_space(this);
2611 last_pc_ = pc_; 2633 last_pc_ = pc_;
2612 emit(0xF3); 2634 emit(0xF3);
2613 emit_optional_rex_32(dst, src); 2635 emit_optional_rex_32(dst, src);
2614 emit(0x0F); 2636 emit(0x0F);
2615 emit(0x2C); 2637 emit(0x2C);
2616 emit_operand(dst, src); 2638 emit_operand(dst, src);
2617 } 2639 }
2618 2640
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
2654 EnsureSpace ensure_space(this); 2676 EnsureSpace ensure_space(this);
2655 last_pc_ = pc_; 2677 last_pc_ = pc_;
2656 emit(0xF2); 2678 emit(0xF2);
2657 emit_optional_rex_32(dst, src); 2679 emit_optional_rex_32(dst, src);
2658 emit(0x0F); 2680 emit(0x0F);
2659 emit(0x2A); 2681 emit(0x2A);
2660 emit_sse_operand(dst, src); 2682 emit_sse_operand(dst, src);
2661 } 2683 }
2662 2684
2663 2685
2686 void Assembler::cvtlsi2ss(XMMRegister dst, Register src) {
2687 EnsureSpace ensure_space(this);
2688 last_pc_ = pc_;
2689 emit(0xF3);
2690 emit_optional_rex_32(dst, src);
2691 emit(0x0F);
2692 emit(0x2A);
2693 emit_sse_operand(dst, src);
2694 }
2695
2696
2664 void Assembler::cvtqsi2sd(XMMRegister dst, Register src) { 2697 void Assembler::cvtqsi2sd(XMMRegister dst, Register src) {
2665 EnsureSpace ensure_space(this); 2698 EnsureSpace ensure_space(this);
2666 last_pc_ = pc_; 2699 last_pc_ = pc_;
2667 emit(0xF2); 2700 emit(0xF2);
2668 emit_rex_64(dst, src); 2701 emit_rex_64(dst, src);
2669 emit(0x0F); 2702 emit(0x0F);
2670 emit(0x2A); 2703 emit(0x2A);
2671 emit_sse_operand(dst, src); 2704 emit_sse_operand(dst, src);
2672 } 2705 }
2673 2706
2674 2707
2675 void Assembler::cvtss2sd(XMMRegister dst, XMMRegister src) { 2708 void Assembler::cvtss2sd(XMMRegister dst, XMMRegister src) {
2676 EnsureSpace ensure_space(this); 2709 EnsureSpace ensure_space(this);
2677 last_pc_ = pc_; 2710 last_pc_ = pc_;
2678 emit(0xF3); 2711 emit(0xF3);
2679 emit_optional_rex_32(dst, src); 2712 emit_optional_rex_32(dst, src);
2680 emit(0x0F); 2713 emit(0x0F);
2681 emit(0x5A); 2714 emit(0x5A);
2682 emit_sse_operand(dst, src); 2715 emit_sse_operand(dst, src);
2683 } 2716 }
2684 2717
2685 2718
2719 void Assembler::cvtss2sd(XMMRegister dst, const Operand& src) {
2720 EnsureSpace ensure_space(this);
2721 last_pc_ = pc_;
2722 emit(0xF3);
2723 emit_optional_rex_32(dst, src);
2724 emit(0x0F);
2725 emit(0x5A);
2726 emit_sse_operand(dst, src);
2727 }
2728
2729
2730 void Assembler::cvtsd2ss(XMMRegister dst, XMMRegister src) {
2731 EnsureSpace ensure_space(this);
2732 last_pc_ = pc_;
2733 emit(0xF2);
2734 emit_optional_rex_32(dst, src);
2735 emit(0x0F);
2736 emit(0x5A);
2737 emit_sse_operand(dst, src);
2738 }
2739
2740
2686 void Assembler::addsd(XMMRegister dst, XMMRegister src) { 2741 void Assembler::addsd(XMMRegister dst, XMMRegister src) {
2687 EnsureSpace ensure_space(this); 2742 EnsureSpace ensure_space(this);
2688 last_pc_ = pc_; 2743 last_pc_ = pc_;
2689 emit(0xF2); 2744 emit(0xF2);
2690 emit_optional_rex_32(dst, src); 2745 emit_optional_rex_32(dst, src);
2691 emit(0x0F); 2746 emit(0x0F);
2692 emit(0x58); 2747 emit(0x58);
2693 emit_sse_operand(dst, src); 2748 emit_sse_operand(dst, src);
2694 } 2749 }
2695 2750
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
2753 EnsureSpace ensure_space(this); 2808 EnsureSpace ensure_space(this);
2754 last_pc_ = pc_; 2809 last_pc_ = pc_;
2755 emit(0x66); 2810 emit(0x66);
2756 emit_optional_rex_32(dst, src); 2811 emit_optional_rex_32(dst, src);
2757 emit(0x0f); 2812 emit(0x0f);
2758 emit(0x2e); 2813 emit(0x2e);
2759 emit_sse_operand(dst, src); 2814 emit_sse_operand(dst, src);
2760 } 2815 }
2761 2816
2762 2817
2818 void Assembler::ucomisd(XMMRegister dst, const Operand& src) {
2819 EnsureSpace ensure_space(this);
2820 last_pc_ = pc_;
2821 emit(0x66);
2822 emit_optional_rex_32(dst, src);
2823 emit(0x0f);
2824 emit(0x2e);
2825 emit_sse_operand(dst, src);
2826 }
2827
2828
2829
2763 void Assembler::emit_sse_operand(XMMRegister reg, const Operand& adr) { 2830 void Assembler::emit_sse_operand(XMMRegister reg, const Operand& adr) {
2764 Register ireg = { reg.code() }; 2831 Register ireg = { reg.code() };
2765 emit_operand(ireg, adr); 2832 emit_operand(ireg, adr);
2766 } 2833 }
2767 2834
2768 2835
2769 void Assembler::emit_sse_operand(XMMRegister dst, XMMRegister src) { 2836 void Assembler::emit_sse_operand(XMMRegister dst, XMMRegister src) {
2770 emit(0xC0 | (dst.low_bits() << 3) | src.low_bits()); 2837 emit(0xC0 | (dst.low_bits() << 3) | src.low_bits());
2771 } 2838 }
2772 2839
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
2866 // specially coded on x64 means that it is a relative 32 bit address, as used 2933 // specially coded on x64 means that it is a relative 32 bit address, as used
2867 // by branch instructions. 2934 // by branch instructions.
2868 return (1 << rmode_) & kApplyMask; 2935 return (1 << rmode_) & kApplyMask;
2869 } 2936 }
2870 2937
2871 2938
2872 2939
2873 } } // namespace v8::internal 2940 } } // namespace v8::internal
2874 2941
2875 #endif // V8_TARGET_ARCH_X64 2942 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/assembler-x64.h ('k') | src/x64/codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698