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

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

Issue 844006: Merge changes up to V8 version 2.1.3 into the partial snapshots (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/partial_snapshots/
Patch Set: Created 10 years, 9 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/ia32/assembler-ia32.h ('k') | src/ia32/builtins-ia32.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) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions 5 // modification, are permitted provided that the following conditions
6 // are met: 6 // are met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 ASSERT(CpuFeatures::IsEnabled(CMOV)); 746 ASSERT(CpuFeatures::IsEnabled(CMOV));
747 EnsureSpace ensure_space(this); 747 EnsureSpace ensure_space(this);
748 last_pc_ = pc_; 748 last_pc_ = pc_;
749 // Opcode: 0f 40 + cc /r. 749 // Opcode: 0f 40 + cc /r.
750 EMIT(0x0F); 750 EMIT(0x0F);
751 EMIT(0x40 + cc); 751 EMIT(0x40 + cc);
752 emit_operand(dst, src); 752 emit_operand(dst, src);
753 } 753 }
754 754
755 755
756 void Assembler::cld() {
757 EnsureSpace ensure_space(this);
758 last_pc_ = pc_;
759 EMIT(0xFC);
760 }
761
762
756 void Assembler::rep_movs() { 763 void Assembler::rep_movs() {
757 EnsureSpace ensure_space(this); 764 EnsureSpace ensure_space(this);
758 last_pc_ = pc_; 765 last_pc_ = pc_;
759 EMIT(0xF3); 766 EMIT(0xF3);
760 EMIT(0xA5); 767 EMIT(0xA5);
761 } 768 }
762 769
763 770
771 void Assembler::rep_stos() {
772 EnsureSpace ensure_space(this);
773 last_pc_ = pc_;
774 EMIT(0xF3);
775 EMIT(0xAB);
776 }
777
778
764 void Assembler::xchg(Register dst, Register src) { 779 void Assembler::xchg(Register dst, Register src) {
765 EnsureSpace ensure_space(this); 780 EnsureSpace ensure_space(this);
766 last_pc_ = pc_; 781 last_pc_ = pc_;
767 if (src.is(eax) || dst.is(eax)) { // Single-byte encoding. 782 if (src.is(eax) || dst.is(eax)) { // Single-byte encoding.
768 EMIT(0x90 | (src.is(eax) ? dst.code() : src.code())); 783 EMIT(0x90 | (src.is(eax) ? dst.code() : src.code()));
769 } else { 784 } else {
770 EMIT(0x87); 785 EMIT(0x87);
771 EMIT(0xC0 | src.code() << 3 | dst.code()); 786 EMIT(0xC0 | src.code() << 3 | dst.code());
772 } 787 }
773 } 788 }
(...skipping 1254 matching lines...) Expand 10 before | Expand all | Expand 10 after
2028 ASSERT(CpuFeatures::IsEnabled(SSE2)); 2043 ASSERT(CpuFeatures::IsEnabled(SSE2));
2029 EnsureSpace ensure_space(this); 2044 EnsureSpace ensure_space(this);
2030 last_pc_ = pc_; 2045 last_pc_ = pc_;
2031 EMIT(0xF2); 2046 EMIT(0xF2);
2032 EMIT(0x0F); 2047 EMIT(0x0F);
2033 EMIT(0x2A); 2048 EMIT(0x2A);
2034 emit_sse_operand(dst, src); 2049 emit_sse_operand(dst, src);
2035 } 2050 }
2036 2051
2037 2052
2053 void Assembler::cvtss2sd(XMMRegister dst, XMMRegister src) {
2054 ASSERT(CpuFeatures::IsEnabled(SSE2));
2055 EnsureSpace ensure_space(this);
2056 last_pc_ = pc_;
2057 EMIT(0xF3);
2058 EMIT(0x0F);
2059 EMIT(0x5A);
2060 emit_sse_operand(dst, src);
2061 }
2062
2063
2038 void Assembler::addsd(XMMRegister dst, XMMRegister src) { 2064 void Assembler::addsd(XMMRegister dst, XMMRegister src) {
2039 ASSERT(CpuFeatures::IsEnabled(SSE2)); 2065 ASSERT(CpuFeatures::IsEnabled(SSE2));
2040 EnsureSpace ensure_space(this); 2066 EnsureSpace ensure_space(this);
2041 last_pc_ = pc_; 2067 last_pc_ = pc_;
2042 EMIT(0xF2); 2068 EMIT(0xF2);
2043 EMIT(0x0F); 2069 EMIT(0x0F);
2044 EMIT(0x58); 2070 EMIT(0x58);
2045 emit_sse_operand(dst, src); 2071 emit_sse_operand(dst, src);
2046 } 2072 }
2047 2073
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
2083 ASSERT(CpuFeatures::IsEnabled(SSE2)); 2109 ASSERT(CpuFeatures::IsEnabled(SSE2));
2084 EnsureSpace ensure_space(this); 2110 EnsureSpace ensure_space(this);
2085 last_pc_ = pc_; 2111 last_pc_ = pc_;
2086 EMIT(0x66); 2112 EMIT(0x66);
2087 EMIT(0x0F); 2113 EMIT(0x0F);
2088 EMIT(0x57); 2114 EMIT(0x57);
2089 emit_sse_operand(dst, src); 2115 emit_sse_operand(dst, src);
2090 } 2116 }
2091 2117
2092 2118
2119 void Assembler::sqrtsd(XMMRegister dst, XMMRegister src) {
2120 EnsureSpace ensure_space(this);
2121 last_pc_ = pc_;
2122 EMIT(0xF2);
2123 EMIT(0x0F);
2124 EMIT(0x51);
2125 emit_sse_operand(dst, src);
2126 }
2127
2128
2093 void Assembler::comisd(XMMRegister dst, XMMRegister src) { 2129 void Assembler::comisd(XMMRegister dst, XMMRegister src) {
2094 ASSERT(CpuFeatures::IsEnabled(SSE2)); 2130 ASSERT(CpuFeatures::IsEnabled(SSE2));
2095 EnsureSpace ensure_space(this); 2131 EnsureSpace ensure_space(this);
2096 last_pc_ = pc_; 2132 last_pc_ = pc_;
2097 EMIT(0x66); 2133 EMIT(0x66);
2098 EMIT(0x0F); 2134 EMIT(0x0F);
2099 EMIT(0x2F); 2135 EMIT(0x2F);
2100 emit_sse_operand(dst, src); 2136 emit_sse_operand(dst, src);
2101 } 2137 }
2102 2138
2103 2139
2140 void Assembler::ucomisd(XMMRegister dst, XMMRegister src) {
2141 ASSERT(CpuFeatures::IsEnabled(SSE2));
2142 EnsureSpace ensure_space(this);
2143 last_pc_ = pc_;
2144 EMIT(0x66);
2145 EMIT(0x0F);
2146 EMIT(0x2E);
2147 emit_sse_operand(dst, src);
2148 }
2149
2150
2104 void Assembler::movdqa(const Operand& dst, XMMRegister src ) { 2151 void Assembler::movdqa(const Operand& dst, XMMRegister src ) {
2105 ASSERT(CpuFeatures::IsEnabled(SSE2)); 2152 ASSERT(CpuFeatures::IsEnabled(SSE2));
2106 EnsureSpace ensure_space(this); 2153 EnsureSpace ensure_space(this);
2107 last_pc_ = pc_; 2154 last_pc_ = pc_;
2108 EMIT(0x66); 2155 EMIT(0x66);
2109 EMIT(0x0F); 2156 EMIT(0x0F);
2110 EMIT(0x7F); 2157 EMIT(0x7F);
2111 emit_sse_operand(src, dst); 2158 emit_sse_operand(src, dst);
2112 } 2159 }
2113 2160
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
2173 void Assembler::movsd(XMMRegister dst, const Operand& src) { 2220 void Assembler::movsd(XMMRegister dst, const Operand& src) {
2174 ASSERT(CpuFeatures::IsEnabled(SSE2)); 2221 ASSERT(CpuFeatures::IsEnabled(SSE2));
2175 EnsureSpace ensure_space(this); 2222 EnsureSpace ensure_space(this);
2176 last_pc_ = pc_; 2223 last_pc_ = pc_;
2177 EMIT(0xF2); // double 2224 EMIT(0xF2); // double
2178 EMIT(0x0F); 2225 EMIT(0x0F);
2179 EMIT(0x10); // load 2226 EMIT(0x10); // load
2180 emit_sse_operand(dst, src); 2227 emit_sse_operand(dst, src);
2181 } 2228 }
2182 2229
2230 void Assembler::movsd(XMMRegister dst, XMMRegister src) {
2231 ASSERT(CpuFeatures::IsEnabled(SSE2));
2232 EnsureSpace ensure_space(this);
2233 last_pc_ = pc_;
2234 EMIT(0xF2);
2235 EMIT(0x0F);
2236 EMIT(0x10);
2237 emit_sse_operand(dst, src);
2238 }
2239
2240
2241 void Assembler::movd(XMMRegister dst, const Operand& src) {
2242 ASSERT(CpuFeatures::IsEnabled(SSE2));
2243 EnsureSpace ensure_space(this);
2244 last_pc_ = pc_;
2245 EMIT(0x66);
2246 EMIT(0x0F);
2247 EMIT(0x6E);
2248 emit_sse_operand(dst, src);
2249 }
2250
2251
2252 void Assembler::pxor(XMMRegister dst, XMMRegister src) {
2253 ASSERT(CpuFeatures::IsEnabled(SSE2));
2254 EnsureSpace ensure_space(this);
2255 last_pc_ = pc_;
2256 EMIT(0x66);
2257 EMIT(0x0F);
2258 EMIT(0xEF);
2259 emit_sse_operand(dst, src);
2260 }
2261
2262
2263 void Assembler::ptest(XMMRegister dst, XMMRegister src) {
2264 ASSERT(CpuFeatures::IsEnabled(SSE2));
2265 EnsureSpace ensure_space(this);
2266 last_pc_ = pc_;
2267 EMIT(0x66);
2268 EMIT(0x0F);
2269 EMIT(0x38);
2270 EMIT(0x17);
2271 emit_sse_operand(dst, src);
2272 }
2273
2183 2274
2184 void Assembler::emit_sse_operand(XMMRegister reg, const Operand& adr) { 2275 void Assembler::emit_sse_operand(XMMRegister reg, const Operand& adr) {
2185 Register ireg = { reg.code() }; 2276 Register ireg = { reg.code() };
2186 emit_operand(ireg, adr); 2277 emit_operand(ireg, adr);
2187 } 2278 }
2188 2279
2189 2280
2190 void Assembler::emit_sse_operand(XMMRegister dst, XMMRegister src) { 2281 void Assembler::emit_sse_operand(XMMRegister dst, XMMRegister src) {
2191 EMIT(0xC0 | dst.code() << 3 | src.code()); 2282 EMIT(0xC0 | dst.code() << 3 | src.code());
2192 } 2283 }
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
2414 push_insn[1] = 13; // Skip over coverage insns. 2505 push_insn[1] = 13; // Skip over coverage insns.
2415 if (coverage_log != NULL) { 2506 if (coverage_log != NULL) {
2416 fprintf(coverage_log, "%s\n", file_line); 2507 fprintf(coverage_log, "%s\n", file_line);
2417 fflush(coverage_log); 2508 fflush(coverage_log);
2418 } 2509 }
2419 } 2510 }
2420 2511
2421 #endif 2512 #endif
2422 2513
2423 } } // namespace v8::internal 2514 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/assembler-ia32.h ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698