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

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

Issue 6049008: SSE2 truncating double-to-i. (Closed)
Patch Set: . Created 9 years, 11 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 2447 matching lines...) Expand 10 before | Expand all | Expand 10 after
2458 ASSERT(CpuFeatures::IsEnabled(SSE2)); 2458 ASSERT(CpuFeatures::IsEnabled(SSE2));
2459 EnsureSpace ensure_space(this); 2459 EnsureSpace ensure_space(this);
2460 last_pc_ = pc_; 2460 last_pc_ = pc_;
2461 EMIT(0x66); 2461 EMIT(0x66);
2462 EMIT(0x0F); 2462 EMIT(0x0F);
2463 EMIT(0xEF); 2463 EMIT(0xEF);
2464 emit_sse_operand(dst, src); 2464 emit_sse_operand(dst, src);
2465 } 2465 }
2466 2466
2467 2467
2468 void Assembler::por(XMMRegister dst, XMMRegister src) {
2469 ASSERT(CpuFeatures::IsEnabled(SSE2));
2470 EnsureSpace ensure_space(this);
2471 last_pc_ = pc_;
2472 EMIT(0x66);
2473 EMIT(0x0F);
2474 EMIT(0xEB);
2475 emit_sse_operand(dst, src);
2476 }
2477
2478
2468 void Assembler::ptest(XMMRegister dst, XMMRegister src) { 2479 void Assembler::ptest(XMMRegister dst, XMMRegister src) {
2469 ASSERT(CpuFeatures::IsEnabled(SSE4_1)); 2480 ASSERT(CpuFeatures::IsEnabled(SSE4_1));
2470 EnsureSpace ensure_space(this); 2481 EnsureSpace ensure_space(this);
2471 last_pc_ = pc_; 2482 last_pc_ = pc_;
2472 EMIT(0x66); 2483 EMIT(0x66);
2473 EMIT(0x0F); 2484 EMIT(0x0F);
2474 EMIT(0x38); 2485 EMIT(0x38);
2475 EMIT(0x17); 2486 EMIT(0x17);
2476 emit_sse_operand(dst, src); 2487 emit_sse_operand(dst, src);
2477 } 2488 }
2478 2489
2479 2490
2480 void Assembler::psllq(XMMRegister reg, int8_t shift) { 2491 void Assembler::psllq(XMMRegister reg, int8_t shift) {
2481 ASSERT(CpuFeatures::IsEnabled(SSE2)); 2492 ASSERT(CpuFeatures::IsEnabled(SSE2));
2482 EnsureSpace ensure_space(this); 2493 EnsureSpace ensure_space(this);
2483 last_pc_ = pc_; 2494 last_pc_ = pc_;
2484 EMIT(0x66); 2495 EMIT(0x66);
2485 EMIT(0x0F); 2496 EMIT(0x0F);
2486 EMIT(0x73); 2497 EMIT(0x73);
2487 emit_sse_operand(esi, reg); // esi == 6 2498 emit_sse_operand(esi, reg); // esi == 6
2488 EMIT(shift); 2499 EMIT(shift);
2489 } 2500 }
2490 2501
2491 2502
2503 void Assembler::psllq(XMMRegister dst, XMMRegister src) {
2504 ASSERT(CpuFeatures::IsEnabled(SSE2));
2505 EnsureSpace ensure_space(this);
2506 last_pc_ = pc_;
2507 EMIT(0x66);
2508 EMIT(0x0F);
2509 EMIT(0xF3);
2510 emit_sse_operand(dst, src);
2511 }
2512
2513
2514 void Assembler::psrlq(XMMRegister reg, int8_t shift) {
2515 ASSERT(CpuFeatures::IsEnabled(SSE2));
2516 EnsureSpace ensure_space(this);
2517 last_pc_ = pc_;
2518 EMIT(0x66);
2519 EMIT(0x0F);
2520 EMIT(0x73);
2521 emit_sse_operand(edx, reg); // edx == 2
2522 EMIT(shift);
2523 }
2524
2525
2526 void Assembler::psrlq(XMMRegister dst, XMMRegister src) {
2527 ASSERT(CpuFeatures::IsEnabled(SSE2));
2528 EnsureSpace ensure_space(this);
2529 last_pc_ = pc_;
2530 EMIT(0x66);
2531 EMIT(0x0F);
2532 EMIT(0xD3);
2533 emit_sse_operand(dst, src);
2534 }
2535
2536
2537 void Assembler::punpckldq(XMMRegister dst, XMMRegister src) {
2538 ASSERT(CpuFeatures::IsEnabled(SSE2));
2539 EnsureSpace ensure_space(this);
2540 last_pc_ = pc_;
2541 EMIT(0x66);
2542 EMIT(0x0F);
2543 EMIT(0x62);
2544 emit_sse_operand(dst, src);
2545 }
2546
2547
2492 void Assembler::pshufd(XMMRegister dst, XMMRegister src, int8_t shuffle) { 2548 void Assembler::pshufd(XMMRegister dst, XMMRegister src, int8_t shuffle) {
2493 ASSERT(CpuFeatures::IsEnabled(SSE2)); 2549 ASSERT(CpuFeatures::IsEnabled(SSE2));
2494 EnsureSpace ensure_space(this); 2550 EnsureSpace ensure_space(this);
2495 last_pc_ = pc_; 2551 last_pc_ = pc_;
2496 EMIT(0x66); 2552 EMIT(0x66);
2497 EMIT(0x0F); 2553 EMIT(0x0F);
2498 EMIT(0x70); 2554 EMIT(0x70);
2499 emit_sse_operand(dst, src); 2555 emit_sse_operand(dst, src);
2500 EMIT(shuffle); 2556 EMIT(shuffle);
2501 } 2557 }
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
2733 fprintf(coverage_log, "%s\n", file_line); 2789 fprintf(coverage_log, "%s\n", file_line);
2734 fflush(coverage_log); 2790 fflush(coverage_log);
2735 } 2791 }
2736 } 2792 }
2737 2793
2738 #endif 2794 #endif
2739 2795
2740 } } // namespace v8::internal 2796 } } // namespace v8::internal
2741 2797
2742 #endif // V8_TARGET_ARCH_IA32 2798 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698