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 2217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2228 case kX64I32x4MaxU: { | 2228 case kX64I32x4MaxU: { |
2229 CpuFeatureScope sse_scope(masm(), SSE4_1); | 2229 CpuFeatureScope sse_scope(masm(), SSE4_1); |
2230 __ pmaxud(i.OutputSimd128Register(), i.InputSimd128Register(1)); | 2230 __ pmaxud(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
2231 break; | 2231 break; |
2232 } | 2232 } |
2233 case kX64S128Zero: { | 2233 case kX64S128Zero: { |
2234 XMMRegister dst = i.OutputSimd128Register(); | 2234 XMMRegister dst = i.OutputSimd128Register(); |
2235 __ xorps(dst, dst); | 2235 __ xorps(dst, dst); |
2236 break; | 2236 break; |
2237 } | 2237 } |
2238 case kX64S32x4Select: { | 2238 case kX64I16x8Splat: { |
| 2239 XMMRegister dst = i.OutputSimd128Register(); |
| 2240 __ movd(dst, i.InputRegister(0)); |
| 2241 __ pshuflw(dst, dst, 0x0); |
| 2242 __ pshufhw(dst, dst, 0x0); |
| 2243 __ pshufd(dst, dst, 0x0); |
| 2244 break; |
| 2245 } |
| 2246 case kX64I16x8ExtractLane: { |
| 2247 CpuFeatureScope sse_scope(masm(), SSE4_1); |
| 2248 Register dst = i.OutputRegister(); |
| 2249 __ pextrw(dst, i.InputSimd128Register(0), i.InputInt8(1)); |
| 2250 __ movsxwl(dst, dst); |
| 2251 break; |
| 2252 } |
| 2253 case kX64I16x8ReplaceLane: { |
| 2254 CpuFeatureScope sse_scope(masm(), SSE4_1); |
| 2255 if (instr->InputAt(2)->IsRegister()) { |
| 2256 __ pinsrw(i.OutputSimd128Register(), i.InputRegister(2), |
| 2257 i.InputInt8(1)); |
| 2258 } else { |
| 2259 __ pinsrw(i.OutputSimd128Register(), i.InputOperand(2), i.InputInt8(1)); |
| 2260 } |
| 2261 break; |
| 2262 } |
| 2263 case kX64I16x8Shl: { |
| 2264 __ psllw(i.OutputSimd128Register(), i.InputInt8(1)); |
| 2265 break; |
| 2266 } |
| 2267 case kX64I16x8ShrS: { |
| 2268 __ psraw(i.OutputSimd128Register(), i.InputInt8(1)); |
| 2269 break; |
| 2270 } |
| 2271 case kX64I16x8Add: { |
| 2272 __ paddw(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2273 break; |
| 2274 } |
| 2275 case kX64I16x8AddSaturateS: { |
| 2276 __ paddsw(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2277 break; |
| 2278 } |
| 2279 case kX64I16x8Sub: { |
| 2280 __ psubw(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2281 break; |
| 2282 } |
| 2283 case kX64I16x8SubSaturateS: { |
| 2284 __ psubsw(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2285 break; |
| 2286 } |
| 2287 case kX64I16x8Mul: { |
| 2288 CpuFeatureScope sse_scope(masm(), SSE4_1); |
| 2289 __ pmullw(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2290 break; |
| 2291 } |
| 2292 case kX64I16x8MinS: { |
| 2293 CpuFeatureScope sse_scope(masm(), SSE4_1); |
| 2294 __ pminsw(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2295 break; |
| 2296 } |
| 2297 case kX64I16x8MaxS: { |
| 2298 CpuFeatureScope sse_scope(masm(), SSE4_1); |
| 2299 __ pmaxsw(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2300 break; |
| 2301 } |
| 2302 case kX64I16x8Eq: { |
| 2303 __ pcmpeqw(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2304 break; |
| 2305 } |
| 2306 case kX64I16x8Ne: { |
| 2307 __ pcmpeqw(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2308 __ pcmpeqw(kScratchDoubleReg, kScratchDoubleReg); |
| 2309 __ pxor(i.OutputSimd128Register(), kScratchDoubleReg); |
| 2310 break; |
| 2311 } |
| 2312 case kX64I16x8ShrU: { |
| 2313 __ psrlw(i.OutputSimd128Register(), i.InputInt8(1)); |
| 2314 break; |
| 2315 } |
| 2316 case kX64I16x8AddSaturateU: { |
| 2317 __ paddusw(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2318 break; |
| 2319 } |
| 2320 case kX64I16x8SubSaturateU: { |
| 2321 __ psubusw(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2322 break; |
| 2323 } |
| 2324 case kX64I16x8MinU: { |
| 2325 CpuFeatureScope sse_scope(masm(), SSE4_1); |
| 2326 __ pminuw(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2327 break; |
| 2328 } |
| 2329 case kX64I16x8MaxU: { |
| 2330 CpuFeatureScope sse_scope(masm(), SSE4_1); |
| 2331 __ pmaxuw(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2332 break; |
| 2333 } |
| 2334 case kX64S128Select: { |
2239 // Mask used here is stored in dst. | 2335 // Mask used here is stored in dst. |
2240 XMMRegister dst = i.OutputSimd128Register(); | 2336 XMMRegister dst = i.OutputSimd128Register(); |
2241 __ movaps(kScratchDoubleReg, i.InputSimd128Register(1)); | 2337 __ movaps(kScratchDoubleReg, i.InputSimd128Register(1)); |
2242 __ xorps(kScratchDoubleReg, i.InputSimd128Register(2)); | 2338 __ xorps(kScratchDoubleReg, i.InputSimd128Register(2)); |
2243 __ andps(dst, kScratchDoubleReg); | 2339 __ andps(dst, kScratchDoubleReg); |
2244 __ xorps(dst, i.InputSimd128Register(2)); | 2340 __ xorps(dst, i.InputSimd128Register(2)); |
2245 break; | 2341 break; |
2246 } | 2342 } |
2247 case kCheckedLoadInt8: | 2343 case kCheckedLoadInt8: |
2248 ASSEMBLE_CHECKED_LOAD_INTEGER(movsxbl); | 2344 ASSEMBLE_CHECKED_LOAD_INTEGER(movsxbl); |
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3001 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 3097 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
3002 __ Nop(padding_size); | 3098 __ Nop(padding_size); |
3003 } | 3099 } |
3004 } | 3100 } |
3005 | 3101 |
3006 #undef __ | 3102 #undef __ |
3007 | 3103 |
3008 } // namespace compiler | 3104 } // namespace compiler |
3009 } // namespace internal | 3105 } // namespace internal |
3010 } // namespace v8 | 3106 } // namespace v8 |
OLD | NEW |