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

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

Issue 1631008: Optimize the assembly code generated for Math.random() (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 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/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 2367 matching lines...) Expand 10 before | Expand all | Expand 10 after
2378 2378
2379 void Assembler::emit_farith(int b1, int b2, int i) { 2379 void Assembler::emit_farith(int b1, int b2, int i) {
2380 ASSERT(is_uint8(b1) && is_uint8(b2)); // wrong opcode 2380 ASSERT(is_uint8(b1) && is_uint8(b2)); // wrong opcode
2381 ASSERT(is_uint3(i)); // illegal stack offset 2381 ASSERT(is_uint3(i)); // illegal stack offset
2382 emit(b1); 2382 emit(b1);
2383 emit(b2 + i); 2383 emit(b2 + i);
2384 } 2384 }
2385 2385
2386 // SSE 2 operations. 2386 // SSE 2 operations.
2387 2387
2388 void Assembler::movd(XMMRegister dst, Register src) {
2389 EnsureSpace ensure_space(this);
2390 last_pc_ = pc_;
2391 emit(0x66);
2392 emit_optional_rex_32(dst, src);
2393 emit(0x0F);
2394 emit(0x6E);
2395 emit_sse_operand(dst, src);
2396 }
2397
2398
2388 void Assembler::movsd(const Operand& dst, XMMRegister src) { 2399 void Assembler::movsd(const Operand& dst, XMMRegister src) {
2389 EnsureSpace ensure_space(this); 2400 EnsureSpace ensure_space(this);
2390 last_pc_ = pc_; 2401 last_pc_ = pc_;
2391 emit(0xF2); // double 2402 emit(0xF2); // double
2392 emit_optional_rex_32(src, dst); 2403 emit_optional_rex_32(src, dst);
2393 emit(0x0F); 2404 emit(0x0F);
2394 emit(0x11); // store 2405 emit(0x11); // store
2395 emit_sse_operand(src, dst); 2406 emit_sse_operand(src, dst);
2396 } 2407 }
2397 2408
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
2466 EnsureSpace ensure_space(this); 2477 EnsureSpace ensure_space(this);
2467 last_pc_ = pc_; 2478 last_pc_ = pc_;
2468 emit(0xF2); 2479 emit(0xF2);
2469 emit_rex_64(dst, src); 2480 emit_rex_64(dst, src);
2470 emit(0x0F); 2481 emit(0x0F);
2471 emit(0x2A); 2482 emit(0x2A);
2472 emit_sse_operand(dst, src); 2483 emit_sse_operand(dst, src);
2473 } 2484 }
2474 2485
2475 2486
2487 void Assembler::cvtss2sd(XMMRegister dst, XMMRegister src) {
2488 EnsureSpace ensure_space(this);
2489 last_pc_ = pc_;
2490 emit(0xF3);
2491 emit_optional_rex_32(dst, src);
2492 emit(0x0F);
2493 emit(0x5A);
2494 emit_sse_operand(dst, src);
2495 }
2496
2497
2476 void Assembler::addsd(XMMRegister dst, XMMRegister src) { 2498 void Assembler::addsd(XMMRegister dst, XMMRegister src) {
2477 EnsureSpace ensure_space(this); 2499 EnsureSpace ensure_space(this);
2478 last_pc_ = pc_; 2500 last_pc_ = pc_;
2479 emit(0xF2); 2501 emit(0xF2);
2480 emit_optional_rex_32(dst, src); 2502 emit_optional_rex_32(dst, src);
2481 emit(0x0F); 2503 emit(0x0F);
2482 emit(0x58); 2504 emit(0x58);
2483 emit_sse_operand(dst, src); 2505 emit_sse_operand(dst, src);
2484 } 2506 }
2485 2507
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
2626 written_position_ = current_position_; 2648 written_position_ = current_position_;
2627 } 2649 }
2628 } 2650 }
2629 2651
2630 2652
2631 const int RelocInfo::kApplyMask = RelocInfo::kCodeTargetMask | 2653 const int RelocInfo::kApplyMask = RelocInfo::kCodeTargetMask |
2632 1 << RelocInfo::INTERNAL_REFERENCE | 2654 1 << RelocInfo::INTERNAL_REFERENCE |
2633 1 << RelocInfo::JS_RETURN; 2655 1 << RelocInfo::JS_RETURN;
2634 2656
2635 } } // namespace v8::internal 2657 } } // namespace v8::internal
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