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

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

Issue 2744643004: [ia32] Add some SSE2, SSE4 instructions and AVX version for SIMD (Closed)
Patch Set: Created 3 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
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 2323 matching lines...) Expand 10 before | Expand all | Expand 10 after
2334 2334
2335 2335
2336 void Assembler::movmskps(Register dst, XMMRegister src) { 2336 void Assembler::movmskps(Register dst, XMMRegister src) {
2337 EnsureSpace ensure_space(this); 2337 EnsureSpace ensure_space(this);
2338 EMIT(0x0F); 2338 EMIT(0x0F);
2339 EMIT(0x50); 2339 EMIT(0x50);
2340 emit_sse_operand(dst, src); 2340 emit_sse_operand(dst, src);
2341 } 2341 }
2342 2342
2343 2343
2344 void Assembler::pcmpeqd(XMMRegister dst, XMMRegister src) {
2345 EnsureSpace ensure_space(this);
2346 EMIT(0x66);
2347 EMIT(0x0F);
2348 EMIT(0x76);
2349 emit_sse_operand(dst, src);
2350 }
2351
2352
2353 void Assembler::punpckldq(XMMRegister dst, XMMRegister src) { 2344 void Assembler::punpckldq(XMMRegister dst, XMMRegister src) {
2354 EnsureSpace ensure_space(this); 2345 EnsureSpace ensure_space(this);
2355 EMIT(0x66); 2346 EMIT(0x66);
2356 EMIT(0x0F); 2347 EMIT(0x0F);
2357 EMIT(0x62); 2348 EMIT(0x62);
2358 emit_sse_operand(dst, src); 2349 emit_sse_operand(dst, src);
2359 } 2350 }
2360 2351
2361 2352
2362 void Assembler::punpckhdq(XMMRegister dst, XMMRegister src) { 2353 void Assembler::punpckhdq(XMMRegister dst, XMMRegister src) {
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
2541 EnsureSpace ensure_space(this); 2532 EnsureSpace ensure_space(this);
2542 EMIT(0x66); 2533 EMIT(0x66);
2543 EMIT(0x0F); 2534 EMIT(0x0F);
2544 EMIT(0x3A); 2535 EMIT(0x3A);
2545 EMIT(0x17); 2536 EMIT(0x17);
2546 emit_sse_operand(src, dst); 2537 emit_sse_operand(src, dst);
2547 EMIT(imm8); 2538 EMIT(imm8);
2548 } 2539 }
2549 2540
2550 2541
2551 void Assembler::pand(XMMRegister dst, XMMRegister src) {
2552 EnsureSpace ensure_space(this);
2553 EMIT(0x66);
2554 EMIT(0x0F);
2555 EMIT(0xDB);
2556 emit_sse_operand(dst, src);
2557 }
2558
2559
2560 void Assembler::pxor(XMMRegister dst, XMMRegister src) {
2561 EnsureSpace ensure_space(this);
2562 EMIT(0x66);
2563 EMIT(0x0F);
2564 EMIT(0xEF);
2565 emit_sse_operand(dst, src);
2566 }
2567
2568
2569 void Assembler::por(XMMRegister dst, XMMRegister src) {
2570 EnsureSpace ensure_space(this);
2571 EMIT(0x66);
2572 EMIT(0x0F);
2573 EMIT(0xEB);
2574 emit_sse_operand(dst, src);
2575 }
2576
2577
2578 void Assembler::ptest(XMMRegister dst, XMMRegister src) { 2542 void Assembler::ptest(XMMRegister dst, XMMRegister src) {
2579 DCHECK(IsEnabled(SSE4_1)); 2543 DCHECK(IsEnabled(SSE4_1));
2580 EnsureSpace ensure_space(this); 2544 EnsureSpace ensure_space(this);
2581 EMIT(0x66); 2545 EMIT(0x66);
2582 EMIT(0x0F); 2546 EMIT(0x0F);
2583 EMIT(0x38); 2547 EMIT(0x38);
2584 EMIT(0x17); 2548 EMIT(0x17);
2585 emit_sse_operand(dst, src); 2549 emit_sse_operand(dst, src);
2586 } 2550 }
2587 2551
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
2881 2845
2882 void Assembler::sse2_instr(XMMRegister dst, const Operand& src, byte prefix, 2846 void Assembler::sse2_instr(XMMRegister dst, const Operand& src, byte prefix,
2883 byte escape, byte opcode) { 2847 byte escape, byte opcode) {
2884 EnsureSpace ensure_space(this); 2848 EnsureSpace ensure_space(this);
2885 EMIT(prefix); 2849 EMIT(prefix);
2886 EMIT(escape); 2850 EMIT(escape);
2887 EMIT(opcode); 2851 EMIT(opcode);
2888 emit_sse_operand(dst, src); 2852 emit_sse_operand(dst, src);
2889 } 2853 }
2890 2854
2855 void Assembler::sse4_instr(XMMRegister dst, const Operand& src, byte prefix,
2856 byte escape1, byte escape2, byte opcode) {
2857 DCHECK(IsEnabled(SSE4_1));
2858 EnsureSpace ensure_space(this);
2859 EMIT(prefix);
2860 EMIT(escape1);
2861 EMIT(escape2);
2862 EMIT(opcode);
2863 emit_sse_operand(dst, src);
2864 }
2865
2891 void Assembler::vinstr(byte op, XMMRegister dst, XMMRegister src1, 2866 void Assembler::vinstr(byte op, XMMRegister dst, XMMRegister src1,
2892 const Operand& src2, SIMDPrefix pp, LeadingOpcode m, 2867 const Operand& src2, SIMDPrefix pp, LeadingOpcode m,
2893 VexW w) { 2868 VexW w) {
2894 DCHECK(IsEnabled(AVX)); 2869 DCHECK(IsEnabled(AVX));
2895 EnsureSpace ensure_space(this); 2870 EnsureSpace ensure_space(this);
2896 emit_vex_prefix(src1, kL128, pp, m, w); 2871 emit_vex_prefix(src1, kL128, pp, m, w);
2897 EMIT(op); 2872 EMIT(op);
2898 emit_sse_operand(dst, src2); 2873 emit_sse_operand(dst, src2);
2899 } 2874 }
2900 2875
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
3097 } 3072 }
3098 RelocInfo rinfo(isolate(), pc_, rmode, data, NULL); 3073 RelocInfo rinfo(isolate(), pc_, rmode, data, NULL);
3099 reloc_info_writer.Write(&rinfo); 3074 reloc_info_writer.Write(&rinfo);
3100 } 3075 }
3101 3076
3102 3077
3103 } // namespace internal 3078 } // namespace internal
3104 } // namespace v8 3079 } // namespace v8
3105 3080
3106 #endif // V8_TARGET_ARCH_IA32 3081 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698