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

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

Issue 6873006: X64 tweaks. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added movaps and used it instead of movapd. Created 9 years, 8 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 | « src/x64/assembler-x64.h ('k') | src/x64/code-stubs-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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 2522 matching lines...) Expand 10 before | Expand all | Expand 10 after
2533 void Assembler::movq(Register dst, XMMRegister src) { 2533 void Assembler::movq(Register dst, XMMRegister src) {
2534 EnsureSpace ensure_space(this); 2534 EnsureSpace ensure_space(this);
2535 emit(0x66); 2535 emit(0x66);
2536 emit_rex_64(src, dst); 2536 emit_rex_64(src, dst);
2537 emit(0x0F); 2537 emit(0x0F);
2538 emit(0x7E); 2538 emit(0x7E);
2539 emit_sse_operand(src, dst); 2539 emit_sse_operand(src, dst);
2540 } 2540 }
2541 2541
2542 2542
2543 void Assembler::movq(XMMRegister dst, XMMRegister src) {
2544 EnsureSpace ensure_space(this);
2545 if (dst.low_bits() == 4) {
2546 // Avoid unnecessary SIB byte.
2547 emit(0xf3);
2548 emit_optional_rex_32(dst, src);
2549 emit(0x0F);
2550 emit(0x7e);
2551 emit_sse_operand(dst, src);
2552 } else {
2553 emit(0x66);
2554 emit_optional_rex_32(src, dst);
2555 emit(0x0F);
2556 emit(0xD6);
2557 emit_sse_operand(src, dst);
2558 }
2559 }
2560
2543 void Assembler::movdqa(const Operand& dst, XMMRegister src) { 2561 void Assembler::movdqa(const Operand& dst, XMMRegister src) {
2544 EnsureSpace ensure_space(this); 2562 EnsureSpace ensure_space(this);
2545 emit(0x66); 2563 emit(0x66);
2546 emit_rex_64(src, dst); 2564 emit_rex_64(src, dst);
2547 emit(0x0F); 2565 emit(0x0F);
2548 emit(0x7F); 2566 emit(0x7F);
2549 emit_sse_operand(src, dst); 2567 emit_sse_operand(src, dst);
2550 } 2568 }
2551 2569
2552 2570
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
2596 void Assembler::movsd(XMMRegister dst, const Operand& src) { 2614 void Assembler::movsd(XMMRegister dst, const Operand& src) {
2597 EnsureSpace ensure_space(this); 2615 EnsureSpace ensure_space(this);
2598 emit(0xF2); // double 2616 emit(0xF2); // double
2599 emit_optional_rex_32(dst, src); 2617 emit_optional_rex_32(dst, src);
2600 emit(0x0F); 2618 emit(0x0F);
2601 emit(0x10); // load 2619 emit(0x10); // load
2602 emit_sse_operand(dst, src); 2620 emit_sse_operand(dst, src);
2603 } 2621 }
2604 2622
2605 2623
2624 void Assembler::movaps(XMMRegister dst, XMMRegister src) {
2625 EnsureSpace ensure_space(this);
2626 if (src.low_bits() == 4) {
2627 // Try to avoid an unnecessary SIB byte.
2628 emit_optional_rex_32(src, dst);
2629 emit(0x0F);
2630 emit(0x29);
2631 emit_sse_operand(src, dst);
2632 } else {
2633 emit_optional_rex_32(dst, src);
2634 emit(0x0F);
2635 emit(0x28);
2636 emit_sse_operand(dst, src);
2637 }
2638 }
2639
2640
2641 void Assembler::movapd(XMMRegister dst, XMMRegister src) {
2642 EnsureSpace ensure_space(this);
2643 if (src.low_bits() == 4) {
2644 // Try to avoid an unnecessary SIB byte.
2645 emit(0x66);
2646 emit_optional_rex_32(src, dst);
2647 emit(0x0F);
2648 emit(0x29);
2649 emit_sse_operand(src, dst);
2650 } else {
2651 emit(0x66);
2652 emit_optional_rex_32(dst, src);
2653 emit(0x0F);
2654 emit(0x28);
2655 emit_sse_operand(dst, src);
2656 }
2657 }
2658
2659
2606 void Assembler::movss(XMMRegister dst, const Operand& src) { 2660 void Assembler::movss(XMMRegister dst, const Operand& src) {
2607 EnsureSpace ensure_space(this); 2661 EnsureSpace ensure_space(this);
2608 emit(0xF3); // single 2662 emit(0xF3); // single
2609 emit_optional_rex_32(dst, src); 2663 emit_optional_rex_32(dst, src);
2610 emit(0x0F); 2664 emit(0x0F);
2611 emit(0x10); // load 2665 emit(0x10); // load
2612 emit_sse_operand(dst, src); 2666 emit_sse_operand(dst, src);
2613 } 2667 }
2614 2668
2615 2669
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
2826 void Assembler::xorpd(XMMRegister dst, XMMRegister src) { 2880 void Assembler::xorpd(XMMRegister dst, XMMRegister src) {
2827 EnsureSpace ensure_space(this); 2881 EnsureSpace ensure_space(this);
2828 emit(0x66); 2882 emit(0x66);
2829 emit_optional_rex_32(dst, src); 2883 emit_optional_rex_32(dst, src);
2830 emit(0x0F); 2884 emit(0x0F);
2831 emit(0x57); 2885 emit(0x57);
2832 emit_sse_operand(dst, src); 2886 emit_sse_operand(dst, src);
2833 } 2887 }
2834 2888
2835 2889
2890 void Assembler::xorps(XMMRegister dst, XMMRegister src) {
2891 EnsureSpace ensure_space(this);
2892 emit_optional_rex_32(dst, src);
2893 emit(0x0F);
2894 emit(0x57);
2895 emit_sse_operand(dst, src);
2896 }
2897
2898
2836 void Assembler::sqrtsd(XMMRegister dst, XMMRegister src) { 2899 void Assembler::sqrtsd(XMMRegister dst, XMMRegister src) {
2837 EnsureSpace ensure_space(this); 2900 EnsureSpace ensure_space(this);
2838 emit(0xF2); 2901 emit(0xF2);
2839 emit_optional_rex_32(dst, src); 2902 emit_optional_rex_32(dst, src);
2840 emit(0x0F); 2903 emit(0x0F);
2841 emit(0x51); 2904 emit(0x51);
2842 emit_sse_operand(dst, src); 2905 emit_sse_operand(dst, src);
2843 } 2906 }
2844 2907
2845 2908
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
2969 // specially coded on x64 means that it is a relative 32 bit address, as used 3032 // specially coded on x64 means that it is a relative 32 bit address, as used
2970 // by branch instructions. 3033 // by branch instructions.
2971 return (1 << rmode_) & kApplyMask; 3034 return (1 << rmode_) & kApplyMask;
2972 } 3035 }
2973 3036
2974 3037
2975 3038
2976 } } // namespace v8::internal 3039 } } // namespace v8::internal
2977 3040
2978 #endif // V8_TARGET_ARCH_X64 3041 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/assembler-x64.h ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698