OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #include "src/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "src/compilation-info.h" | 9 #include "src/compilation-info.h" |
10 #include "src/compiler/code-generator-impl.h" | 10 #include "src/compiler/code-generator-impl.h" |
(...skipping 2137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2148 __ xchgw(i.InputRegister(index), operand); | 2148 __ xchgw(i.InputRegister(index), operand); |
2149 break; | 2149 break; |
2150 } | 2150 } |
2151 case kX64Xchgl: { | 2151 case kX64Xchgl: { |
2152 size_t index = 0; | 2152 size_t index = 0; |
2153 Operand operand = i.MemoryOperand(&index); | 2153 Operand operand = i.MemoryOperand(&index); |
2154 __ xchgl(i.InputRegister(index), operand); | 2154 __ xchgl(i.InputRegister(index), operand); |
2155 break; | 2155 break; |
2156 } | 2156 } |
2157 case kX64Int32x4Splat: { | 2157 case kX64Int32x4Splat: { |
2158 CpuFeatureScope sse_scope(masm(), SSE4_1); | |
2159 XMMRegister dst = i.OutputSimd128Register(); | 2158 XMMRegister dst = i.OutputSimd128Register(); |
2160 __ Movd(dst, i.InputRegister(0)); | 2159 __ Movd(dst, i.InputRegister(0)); |
2161 __ shufps(dst, dst, 0x0); | 2160 __ pshufd(dst, dst, 0x0); |
2162 break; | 2161 break; |
2163 } | 2162 } |
2164 case kX64Int32x4ExtractLane: { | 2163 case kX64Int32x4ExtractLane: { |
2165 CpuFeatureScope sse_scope(masm(), SSE4_1); | 2164 CpuFeatureScope sse_scope(masm(), SSE4_1); |
2166 __ Pextrd(i.OutputRegister(), i.InputSimd128Register(0), i.InputInt8(1)); | 2165 __ Pextrd(i.OutputRegister(), i.InputSimd128Register(0), i.InputInt8(1)); |
2167 break; | 2166 break; |
2168 } | 2167 } |
2169 case kX64Int32x4ReplaceLane: { | 2168 case kX64Int32x4ReplaceLane: { |
2170 CpuFeatureScope sse_scope(masm(), SSE4_1); | 2169 CpuFeatureScope sse_scope(masm(), SSE4_1); |
2171 if (instr->InputAt(2)->IsRegister()) { | 2170 if (instr->InputAt(2)->IsRegister()) { |
2172 __ Pinsrd(i.OutputSimd128Register(), i.InputRegister(2), | 2171 __ Pinsrd(i.OutputSimd128Register(), i.InputRegister(2), |
2173 i.InputInt8(1)); | 2172 i.InputInt8(1)); |
2174 } else { | 2173 } else { |
2175 __ Pinsrd(i.OutputSimd128Register(), i.InputOperand(2), i.InputInt8(1)); | 2174 __ Pinsrd(i.OutputSimd128Register(), i.InputOperand(2), i.InputInt8(1)); |
2176 } | 2175 } |
2177 break; | 2176 break; |
2178 } | 2177 } |
2179 case kX64Int32x4Add: { | 2178 case kX64Int32x4Add: { |
2180 CpuFeatureScope sse_scope(masm(), SSE4_1); | |
2181 __ paddd(i.OutputSimd128Register(), i.InputSimd128Register(1)); | 2179 __ paddd(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
2182 break; | 2180 break; |
2183 } | 2181 } |
2184 case kX64Int32x4Sub: { | 2182 case kX64Int32x4Sub: { |
2185 CpuFeatureScope sse_scope(masm(), SSE4_1); | |
2186 __ psubd(i.OutputSimd128Register(), i.InputSimd128Register(1)); | 2183 __ psubd(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
2187 break; | 2184 break; |
2188 } | 2185 } |
| 2186 case kX64Int32x4Mul: { |
| 2187 CpuFeatureScope sse_scope(masm(), SSE4_1); |
| 2188 __ pmulld(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2189 break; |
| 2190 } |
| 2191 case kX64Int32x4Min: { |
| 2192 CpuFeatureScope sse_scope(masm(), SSE4_1); |
| 2193 __ pminsd(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2194 break; |
| 2195 } |
| 2196 case kX64Int32x4Max: { |
| 2197 CpuFeatureScope sse_scope(masm(), SSE4_1); |
| 2198 __ pmaxsd(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2199 break; |
| 2200 } |
| 2201 case kX64Uint32x4Min: { |
| 2202 CpuFeatureScope sse_scope(masm(), SSE4_1); |
| 2203 __ pminud(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2204 break; |
| 2205 } |
| 2206 case kX64Uint32x4Max: { |
| 2207 CpuFeatureScope sse_scope(masm(), SSE4_1); |
| 2208 __ pmaxud(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2209 break; |
| 2210 } |
| 2211 case kX64Int32x4Equal: { |
| 2212 __ pcmpeqd(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2213 break; |
| 2214 } |
| 2215 case kX64Int32x4NotEqual: { |
| 2216 __ pcmpeqd(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2217 __ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg); |
| 2218 __ pxor(i.OutputSimd128Register(), kScratchDoubleReg); |
| 2219 break; |
| 2220 } |
| 2221 case kX64Simd32x4Select: { |
| 2222 XMMRegister dst = i.OutputSimd128Register(); |
| 2223 __ xorps(i.InputSimd128Register(1), i.InputSimd128Register(2)); |
| 2224 __ andps(dst, i.InputSimd128Register(1)); |
| 2225 __ xorps(dst, i.InputSimd128Register(2)); |
| 2226 break; |
| 2227 } |
2189 case kX64Simd128Zero: { | 2228 case kX64Simd128Zero: { |
2190 CpuFeatureScope sse_scope(masm(), SSE4_1); | |
2191 XMMRegister dst = i.OutputSimd128Register(); | 2229 XMMRegister dst = i.OutputSimd128Register(); |
2192 __ xorps(dst, dst); | 2230 __ xorps(dst, dst); |
2193 break; | 2231 break; |
2194 } | 2232 } |
2195 case kCheckedLoadInt8: | 2233 case kCheckedLoadInt8: |
2196 ASSEMBLE_CHECKED_LOAD_INTEGER(movsxbl); | 2234 ASSEMBLE_CHECKED_LOAD_INTEGER(movsxbl); |
2197 break; | 2235 break; |
2198 case kCheckedLoadUint8: | 2236 case kCheckedLoadUint8: |
2199 ASSEMBLE_CHECKED_LOAD_INTEGER(movzxbl); | 2237 ASSEMBLE_CHECKED_LOAD_INTEGER(movzxbl); |
2200 break; | 2238 break; |
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2867 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 2905 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
2868 __ Nop(padding_size); | 2906 __ Nop(padding_size); |
2869 } | 2907 } |
2870 } | 2908 } |
2871 | 2909 |
2872 #undef __ | 2910 #undef __ |
2873 | 2911 |
2874 } // namespace compiler | 2912 } // namespace compiler |
2875 } // namespace internal | 2913 } // namespace internal |
2876 } // namespace v8 | 2914 } // namespace v8 |
OLD | NEW |