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

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

Issue 26780004: Introduce xchgl, orl, roll, subl, testl and xorl into X64 assembler (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 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/lithium-gap-resolver-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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 1881 matching lines...) Expand 10 before | Expand all | Expand 10 after
1892 1892
1893 void Assembler::shrd(Register dst, Register src) { 1893 void Assembler::shrd(Register dst, Register src) {
1894 EnsureSpace ensure_space(this); 1894 EnsureSpace ensure_space(this);
1895 emit_rex_64(src, dst); 1895 emit_rex_64(src, dst);
1896 emit(0x0F); 1896 emit(0x0F);
1897 emit(0xAD); 1897 emit(0xAD);
1898 emit_modrm(src, dst); 1898 emit_modrm(src, dst);
1899 } 1899 }
1900 1900
1901 1901
1902 void Assembler::xchg(Register dst, Register src) { 1902 void Assembler::xchgq(Register dst, Register src) {
1903 EnsureSpace ensure_space(this); 1903 EnsureSpace ensure_space(this);
1904 if (src.is(rax) || dst.is(rax)) { // Single-byte encoding 1904 if (src.is(rax) || dst.is(rax)) { // Single-byte encoding
1905 Register other = src.is(rax) ? dst : src; 1905 Register other = src.is(rax) ? dst : src;
1906 emit_rex_64(other); 1906 emit_rex_64(other);
1907 emit(0x90 | other.low_bits()); 1907 emit(0x90 | other.low_bits());
1908 } else if (dst.low_bits() == 4) { 1908 } else if (dst.low_bits() == 4) {
1909 emit_rex_64(dst, src); 1909 emit_rex_64(dst, src);
1910 emit(0x87); 1910 emit(0x87);
1911 emit_modrm(dst, src); 1911 emit_modrm(dst, src);
1912 } else { 1912 } else {
1913 emit_rex_64(src, dst); 1913 emit_rex_64(src, dst);
1914 emit(0x87); 1914 emit(0x87);
1915 emit_modrm(src, dst); 1915 emit_modrm(src, dst);
1916 } 1916 }
1917 } 1917 }
1918 1918
1919 1919
1920 void Assembler::xchgl(Register dst, Register src) {
1921 EnsureSpace ensure_space(this);
1922 if (src.is(rax) || dst.is(rax)) { // Single-byte encoding
1923 Register other = src.is(rax) ? dst : src;
1924 emit_optional_rex_32(other);
1925 emit(0x90 | other.low_bits());
1926 } else if (dst.low_bits() == 4) {
1927 emit_optional_rex_32(dst, src);
1928 emit(0x87);
1929 emit_modrm(dst, src);
1930 } else {
1931 emit_optional_rex_32(src, dst);
1932 emit(0x87);
1933 emit_modrm(src, dst);
1934 }
1935 }
1936
1937
1920 void Assembler::store_rax(void* dst, RelocInfo::Mode mode) { 1938 void Assembler::store_rax(void* dst, RelocInfo::Mode mode) {
1921 EnsureSpace ensure_space(this); 1939 EnsureSpace ensure_space(this);
1922 emit(0x48); // REX.W 1940 emit(0x48); // REX.W
1923 emit(0xA3); 1941 emit(0xA3);
1924 emitp(dst, mode); 1942 emitp(dst, mode);
1925 } 1943 }
1926 1944
1927 1945
1928 void Assembler::store_rax(ExternalReference ref) { 1946 void Assembler::store_rax(ExternalReference ref) {
1929 store_rax(ref.address(), RelocInfo::EXTERNAL_REFERENCE); 1947 store_rax(ref.address(), RelocInfo::EXTERNAL_REFERENCE);
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
2028 return; 2046 return;
2029 } 2047 }
2030 EnsureSpace ensure_space(this); 2048 EnsureSpace ensure_space(this);
2031 emit_optional_rex_32(rax, op); 2049 emit_optional_rex_32(rax, op);
2032 emit(0xF7); 2050 emit(0xF7);
2033 emit_operand(rax, op); // Operation code 0 2051 emit_operand(rax, op); // Operation code 0
2034 emit(mask); 2052 emit(mask);
2035 } 2053 }
2036 2054
2037 2055
2056 void Assembler::testl(const Operand& op, Register reg) {
2057 EnsureSpace ensure_space(this);
2058 emit_optional_rex_32(reg, op);
2059 emit(0x85);
2060 emit_operand(reg, op);
2061 }
2062
2063
2038 void Assembler::testq(const Operand& op, Register reg) { 2064 void Assembler::testq(const Operand& op, Register reg) {
2039 EnsureSpace ensure_space(this); 2065 EnsureSpace ensure_space(this);
2040 emit_rex_64(reg, op); 2066 emit_rex_64(reg, op);
2041 emit(0x85); 2067 emit(0x85);
2042 emit_operand(reg, op); 2068 emit_operand(reg, op);
2043 } 2069 }
2044 2070
2045 2071
2046 void Assembler::testq(Register dst, Register src) { 2072 void Assembler::testq(Register dst, Register src) {
2047 EnsureSpace ensure_space(this); 2073 EnsureSpace ensure_space(this);
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after
3051 bool RelocInfo::IsCodedSpecially() { 3077 bool RelocInfo::IsCodedSpecially() {
3052 // The deserializer needs to know whether a pointer is specially coded. Being 3078 // The deserializer needs to know whether a pointer is specially coded. Being
3053 // specially coded on x64 means that it is a relative 32 bit address, as used 3079 // specially coded on x64 means that it is a relative 32 bit address, as used
3054 // by branch instructions. 3080 // by branch instructions.
3055 return (1 << rmode_) & kApplyMask; 3081 return (1 << rmode_) & kApplyMask;
3056 } 3082 }
3057 3083
3058 } } // namespace v8::internal 3084 } } // namespace v8::internal
3059 3085
3060 #endif // V8_TARGET_ARCH_X64 3086 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/assembler-x64.h ('k') | src/x64/lithium-gap-resolver-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698