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

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

Issue 2937653002: [ia32][wasm] Add I8x16/I16x8 Splat/ExtractLane/ReplaceLane (Closed)
Patch Set: Rebase 2 Created 3 years, 5 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
« no previous file with comments | « src/ia32/macro-assembler-ia32.h ('k') | test/cctest/wasm/test-run-wasm-simd.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_IA32 5 #if V8_TARGET_ARCH_IA32
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/base/division-by-constant.h" 8 #include "src/base/division-by-constant.h"
9 #include "src/base/utils/random-number-generator.h" 9 #include "src/base/utils/random-number-generator.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 2070 matching lines...) Expand 10 before | Expand all | Expand 10 after
2081 pop(eax); 2081 pop(eax);
2082 } else { 2082 } else {
2083 push(Immediate(upper)); 2083 push(Immediate(upper));
2084 push(Immediate(lower)); 2084 push(Immediate(lower));
2085 movsd(dst, Operand(esp, 0)); 2085 movsd(dst, Operand(esp, 0));
2086 add(esp, Immediate(kDoubleSize)); 2086 add(esp, Immediate(kDoubleSize));
2087 } 2087 }
2088 } 2088 }
2089 } 2089 }
2090 2090
2091 void MacroAssembler::Pxor(XMMRegister dst, const Operand& src) {
2092 if (CpuFeatures::IsSupported(AVX)) {
2093 CpuFeatureScope scope(this, AVX);
2094 vpxor(dst, dst, src);
2095 } else {
2096 pxor(dst, src);
2097 }
2098 }
2099
2100 void MacroAssembler::Pshuflw(XMMRegister dst, const Operand& src,
2101 uint8_t shuffle) {
2102 if (CpuFeatures::IsSupported(AVX)) {
2103 CpuFeatureScope scope(this, AVX);
2104 vpshuflw(dst, src, shuffle);
2105 } else {
2106 pshuflw(dst, src, shuffle);
2107 }
2108 }
2109
2091 void MacroAssembler::Pshufd(XMMRegister dst, const Operand& src, 2110 void MacroAssembler::Pshufd(XMMRegister dst, const Operand& src,
2092 uint8_t shuffle) { 2111 uint8_t shuffle) {
2093 if (CpuFeatures::IsSupported(AVX)) { 2112 if (CpuFeatures::IsSupported(AVX)) {
2094 CpuFeatureScope scope(this, AVX); 2113 CpuFeatureScope scope(this, AVX);
2095 vpshufd(dst, src, shuffle); 2114 vpshufd(dst, src, shuffle);
2096 } else { 2115 } else {
2097 pshufd(dst, src, shuffle); 2116 pshufd(dst, src, shuffle);
2098 } 2117 }
2099 } 2118 }
2100 2119
2120 void MacroAssembler::Pshufb(XMMRegister dst, const Operand& src) {
2121 if (CpuFeatures::IsSupported(AVX)) {
2122 CpuFeatureScope scope(this, AVX);
2123 vpshufb(dst, dst, src);
2124 return;
2125 }
2126 if (CpuFeatures::IsSupported(SSSE3)) {
2127 CpuFeatureScope sse_scope(this, SSSE3);
2128 pshufb(dst, src);
2129 return;
2130 }
2131 UNREACHABLE();
2132 }
2133
2134 void MacroAssembler::Pextrb(Register dst, XMMRegister src, int8_t imm8) {
2135 if (CpuFeatures::IsSupported(AVX)) {
2136 CpuFeatureScope scope(this, AVX);
2137 vpextrb(dst, src, imm8);
2138 return;
2139 }
2140 if (CpuFeatures::IsSupported(SSE4_1)) {
2141 CpuFeatureScope sse_scope(this, SSE4_1);
2142 pextrb(dst, src, imm8);
2143 return;
2144 }
2145 UNREACHABLE();
2146 }
2147
2148 void MacroAssembler::Pextrw(Register dst, XMMRegister src, int8_t imm8) {
2149 if (CpuFeatures::IsSupported(AVX)) {
2150 CpuFeatureScope scope(this, AVX);
2151 vpextrw(dst, src, imm8);
2152 return;
2153 }
2154 if (CpuFeatures::IsSupported(SSE4_1)) {
2155 CpuFeatureScope sse_scope(this, SSE4_1);
2156 pextrw(dst, src, imm8);
2157 return;
2158 }
2159 UNREACHABLE();
2160 }
2161
2101 void MacroAssembler::Pextrd(Register dst, XMMRegister src, int8_t imm8) { 2162 void MacroAssembler::Pextrd(Register dst, XMMRegister src, int8_t imm8) {
2102 if (imm8 == 0) { 2163 if (imm8 == 0) {
2103 Movd(dst, src); 2164 Movd(dst, src);
2104 return; 2165 return;
2105 } 2166 }
2106 if (CpuFeatures::IsSupported(AVX)) { 2167 if (CpuFeatures::IsSupported(AVX)) {
2107 CpuFeatureScope scope(this, AVX); 2168 CpuFeatureScope scope(this, AVX);
2108 vpextrd(dst, src, imm8); 2169 vpextrd(dst, src, imm8);
2109 return; 2170 return;
2110 } 2171 }
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
2753 mov(eax, dividend); 2814 mov(eax, dividend);
2754 shr(eax, 31); 2815 shr(eax, 31);
2755 add(edx, eax); 2816 add(edx, eax);
2756 } 2817 }
2757 2818
2758 2819
2759 } // namespace internal 2820 } // namespace internal
2760 } // namespace v8 2821 } // namespace v8
2761 2822
2762 #endif // V8_TARGET_ARCH_IA32 2823 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.h ('k') | test/cctest/wasm/test-run-wasm-simd.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698