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

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

Issue 2582001: Add optimized version of memcpy on ia32. (Closed)
Patch Set: 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
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 2203 matching lines...) Expand 10 before | Expand all | Expand 10 after
2214 ASSERT(CpuFeatures::IsEnabled(SSE2)); 2214 ASSERT(CpuFeatures::IsEnabled(SSE2));
2215 EnsureSpace ensure_space(this); 2215 EnsureSpace ensure_space(this);
2216 last_pc_ = pc_; 2216 last_pc_ = pc_;
2217 EMIT(0xF3); 2217 EMIT(0xF3);
2218 EMIT(0x0F); 2218 EMIT(0x0F);
2219 EMIT(0x6F); 2219 EMIT(0x6F);
2220 emit_sse_operand(dst, src); 2220 emit_sse_operand(dst, src);
2221 } 2221 }
2222 2222
2223 2223
2224 void Assembler::movntdqa(XMMRegister dst, const Operand& src) {
2225 ASSERT(CpuFeatures::IsEnabled(SSE2));
Erik Corry 2010/06/03 20:29:49 As far as I can see this is an SSE4 instruction.
Lasse Reichstein 2010/06/04 11:52:13 Well spotted.
2226 EnsureSpace ensure_space(this);
2227 last_pc_ = pc_;
2228 EMIT(0x66);
2229 EMIT(0x0F);
2230 EMIT(0x38);
2231 EMIT(0x2A);
2232 emit_sse_operand(dst, src);
2233 }
2234
2235
2236 void Assembler::movntdq(const Operand& dst, XMMRegister src) {
2237 ASSERT(CpuFeatures::IsEnabled(SSE2));
2238 EnsureSpace ensure_space(this);
2239 last_pc_ = pc_;
2240 EMIT(0x66);
2241 EMIT(0x0F);
2242 EMIT(0xE7);
2243 emit_sse_operand(src, dst);
2244 }
2245
2246
2247 void Assembler::prefetch(const Operand& src, int level) {
2248 ASSERT(CpuFeatures::IsEnabled(SSE2));
Erik Corry 2010/06/03 20:29:49 This is an SSE instruction.
Lasse Reichstein 2010/06/04 11:52:13 True. Do we even have a test for that?
2249 ASSERT(is_uint2(level));
2250 EnsureSpace ensure_space(this);
2251 last_pc_ = pc_;
2252 EMIT(0x0F);
2253 EMIT(0x18);
2254 XMMRegister code = { level }; // Emit hint number in Reg position of RegR/M.
2255 emit_sse_operand(code, src);
2256 }
2257
2258
2224 void Assembler::movdbl(XMMRegister dst, const Operand& src) { 2259 void Assembler::movdbl(XMMRegister dst, const Operand& src) {
2225 EnsureSpace ensure_space(this); 2260 EnsureSpace ensure_space(this);
2226 last_pc_ = pc_; 2261 last_pc_ = pc_;
2227 movsd(dst, src); 2262 movsd(dst, src);
2228 } 2263 }
2229 2264
2230 2265
2231 void Assembler::movdbl(const Operand& dst, XMMRegister src) { 2266 void Assembler::movdbl(const Operand& dst, XMMRegister src) {
2232 EnsureSpace ensure_space(this); 2267 EnsureSpace ensure_space(this);
2233 last_pc_ = pc_; 2268 last_pc_ = pc_;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
2292 void Assembler::ptest(XMMRegister dst, XMMRegister src) { 2327 void Assembler::ptest(XMMRegister dst, XMMRegister src) {
2293 ASSERT(CpuFeatures::IsEnabled(SSE2)); 2328 ASSERT(CpuFeatures::IsEnabled(SSE2));
2294 EnsureSpace ensure_space(this); 2329 EnsureSpace ensure_space(this);
2295 last_pc_ = pc_; 2330 last_pc_ = pc_;
2296 EMIT(0x66); 2331 EMIT(0x66);
2297 EMIT(0x0F); 2332 EMIT(0x0F);
2298 EMIT(0x38); 2333 EMIT(0x38);
2299 EMIT(0x17); 2334 EMIT(0x17);
2300 emit_sse_operand(dst, src); 2335 emit_sse_operand(dst, src);
2301 } 2336 }
2302 2337
Erik Corry 2010/06/03 20:29:49 Inadvertent edit?
Lasse Reichstein 2010/06/04 11:52:13 Fixed.
2303
2304 void Assembler::emit_sse_operand(XMMRegister reg, const Operand& adr) { 2338 void Assembler::emit_sse_operand(XMMRegister reg, const Operand& adr) {
2305 Register ireg = { reg.code() }; 2339 Register ireg = { reg.code() };
2306 emit_operand(ireg, adr); 2340 emit_operand(ireg, adr);
2307 } 2341 }
2308 2342
2309 2343
2310 void Assembler::emit_sse_operand(XMMRegister dst, XMMRegister src) { 2344 void Assembler::emit_sse_operand(XMMRegister dst, XMMRegister src) {
2311 EMIT(0xC0 | dst.code() << 3 | src.code()); 2345 EMIT(0xC0 | dst.code() << 3 | src.code());
2312 } 2346 }
2313 2347
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
2541 fprintf(coverage_log, "%s\n", file_line); 2575 fprintf(coverage_log, "%s\n", file_line);
2542 fflush(coverage_log); 2576 fflush(coverage_log);
2543 } 2577 }
2544 } 2578 }
2545 2579
2546 #endif 2580 #endif
2547 2581
2548 } } // namespace v8::internal 2582 } } // namespace v8::internal
2549 2583
2550 #endif // V8_TARGET_ARCH_IA32 2584 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/assembler-ia32.h ('k') | src/ia32/codegen-ia32.cc » ('j') | src/ia32/codegen-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698