| 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 1988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1999 EmitOOLTrapIfNeeded(zone(), this, opcode, instr->InputCount(), i, | 1999 EmitOOLTrapIfNeeded(zone(), this, opcode, instr->InputCount(), i, |
| 2000 __ pc_offset()); | 2000 __ pc_offset()); |
| 2001 if (instr->HasOutput()) { | 2001 if (instr->HasOutput()) { |
| 2002 __ Movsd(i.OutputDoubleRegister(), i.MemoryOperand()); | 2002 __ Movsd(i.OutputDoubleRegister(), i.MemoryOperand()); |
| 2003 } else { | 2003 } else { |
| 2004 size_t index = 0; | 2004 size_t index = 0; |
| 2005 Operand operand = i.MemoryOperand(&index); | 2005 Operand operand = i.MemoryOperand(&index); |
| 2006 __ Movsd(operand, i.InputDoubleRegister(index)); | 2006 __ Movsd(operand, i.InputDoubleRegister(index)); |
| 2007 } | 2007 } |
| 2008 break; | 2008 break; |
| 2009 case kX64Movdqu: { |
| 2010 CpuFeatureScope sse_scope(masm(), SSSE3); |
| 2011 EmitOOLTrapIfNeeded(zone(), this, opcode, instr->InputCount(), i, |
| 2012 __ pc_offset()); |
| 2013 if (instr->HasOutput()) { |
| 2014 __ movdqu(i.OutputSimd128Register(), i.MemoryOperand()); |
| 2015 } else { |
| 2016 size_t index = 0; |
| 2017 Operand operand = i.MemoryOperand(&index); |
| 2018 __ movdqu(operand, i.InputSimd128Register(index)); |
| 2019 } |
| 2020 break; |
| 2021 } |
| 2009 case kX64BitcastFI: | 2022 case kX64BitcastFI: |
| 2010 if (instr->InputAt(0)->IsFPStackSlot()) { | 2023 if (instr->InputAt(0)->IsFPStackSlot()) { |
| 2011 __ movl(i.OutputRegister(), i.InputOperand(0)); | 2024 __ movl(i.OutputRegister(), i.InputOperand(0)); |
| 2012 } else { | 2025 } else { |
| 2013 __ Movd(i.OutputRegister(), i.InputDoubleRegister(0)); | 2026 __ Movd(i.OutputRegister(), i.InputDoubleRegister(0)); |
| 2014 } | 2027 } |
| 2015 break; | 2028 break; |
| 2016 case kX64BitcastDL: | 2029 case kX64BitcastDL: |
| 2017 if (instr->InputAt(0)->IsFPStackSlot()) { | 2030 if (instr->InputAt(0)->IsFPStackSlot()) { |
| 2018 __ movq(i.OutputRegister(), i.InputOperand(0)); | 2031 __ movq(i.OutputRegister(), i.InputOperand(0)); |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2180 break; | 2193 break; |
| 2181 } | 2194 } |
| 2182 case kX64I32x4ShrS: { | 2195 case kX64I32x4ShrS: { |
| 2183 __ psrad(i.OutputSimd128Register(), i.InputInt8(1)); | 2196 __ psrad(i.OutputSimd128Register(), i.InputInt8(1)); |
| 2184 break; | 2197 break; |
| 2185 } | 2198 } |
| 2186 case kX64I32x4Add: { | 2199 case kX64I32x4Add: { |
| 2187 __ paddd(i.OutputSimd128Register(), i.InputSimd128Register(1)); | 2200 __ paddd(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2188 break; | 2201 break; |
| 2189 } | 2202 } |
| 2203 case kX64I32x4AddHoriz: { |
| 2204 CpuFeatureScope sse_scope(masm(), SSSE3); |
| 2205 __ phaddd(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2206 break; |
| 2207 } |
| 2190 case kX64I32x4Sub: { | 2208 case kX64I32x4Sub: { |
| 2191 __ psubd(i.OutputSimd128Register(), i.InputSimd128Register(1)); | 2209 __ psubd(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2192 break; | 2210 break; |
| 2193 } | 2211 } |
| 2194 case kX64I32x4Mul: { | 2212 case kX64I32x4Mul: { |
| 2195 CpuFeatureScope sse_scope(masm(), SSE4_1); | 2213 CpuFeatureScope sse_scope(masm(), SSE4_1); |
| 2196 __ pmulld(i.OutputSimd128Register(), i.InputSimd128Register(1)); | 2214 __ pmulld(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2197 break; | 2215 break; |
| 2198 } | 2216 } |
| 2199 case kX64I32x4MinS: { | 2217 case kX64I32x4MinS: { |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2269 break; | 2287 break; |
| 2270 } | 2288 } |
| 2271 case kX64I16x8Add: { | 2289 case kX64I16x8Add: { |
| 2272 __ paddw(i.OutputSimd128Register(), i.InputSimd128Register(1)); | 2290 __ paddw(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2273 break; | 2291 break; |
| 2274 } | 2292 } |
| 2275 case kX64I16x8AddSaturateS: { | 2293 case kX64I16x8AddSaturateS: { |
| 2276 __ paddsw(i.OutputSimd128Register(), i.InputSimd128Register(1)); | 2294 __ paddsw(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2277 break; | 2295 break; |
| 2278 } | 2296 } |
| 2297 case kX64I16x8AddHoriz: { |
| 2298 CpuFeatureScope sse_scope(masm(), SSSE3); |
| 2299 __ phaddw(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2300 break; |
| 2301 } |
| 2279 case kX64I16x8Sub: { | 2302 case kX64I16x8Sub: { |
| 2280 __ psubw(i.OutputSimd128Register(), i.InputSimd128Register(1)); | 2303 __ psubw(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2281 break; | 2304 break; |
| 2282 } | 2305 } |
| 2283 case kX64I16x8SubSaturateS: { | 2306 case kX64I16x8SubSaturateS: { |
| 2284 __ psubsw(i.OutputSimd128Register(), i.InputSimd128Register(1)); | 2307 __ psubsw(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2285 break; | 2308 break; |
| 2286 } | 2309 } |
| 2287 case kX64I16x8Mul: { | 2310 case kX64I16x8Mul: { |
| 2288 CpuFeatureScope sse_scope(masm(), SSE4_1); | 2311 CpuFeatureScope sse_scope(masm(), SSE4_1); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2403 case kX64I8x16MinU: { | 2426 case kX64I8x16MinU: { |
| 2404 CpuFeatureScope sse_scope(masm(), SSE4_1); | 2427 CpuFeatureScope sse_scope(masm(), SSE4_1); |
| 2405 __ pminub(i.OutputSimd128Register(), i.InputSimd128Register(1)); | 2428 __ pminub(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2406 break; | 2429 break; |
| 2407 } | 2430 } |
| 2408 case kX64I8x16MaxU: { | 2431 case kX64I8x16MaxU: { |
| 2409 CpuFeatureScope sse_scope(masm(), SSE4_1); | 2432 CpuFeatureScope sse_scope(masm(), SSE4_1); |
| 2410 __ pmaxub(i.OutputSimd128Register(), i.InputSimd128Register(1)); | 2433 __ pmaxub(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2411 break; | 2434 break; |
| 2412 } | 2435 } |
| 2436 case kX64S128And: { |
| 2437 __ pand(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2438 break; |
| 2439 } |
| 2440 case kX64S128Or: { |
| 2441 __ por(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2442 break; |
| 2443 } |
| 2444 case kX64S128Xor: { |
| 2445 __ pxor(i.OutputSimd128Register(), i.InputSimd128Register(1)); |
| 2446 break; |
| 2447 } |
| 2448 case kX64S128Not: { |
| 2449 XMMRegister dst = i.OutputSimd128Register(); |
| 2450 __ pcmpeqd(dst, dst); |
| 2451 __ pxor(dst, i.InputSimd128Register(1)); |
| 2452 break; |
| 2453 } |
| 2413 case kX64S128Select: { | 2454 case kX64S128Select: { |
| 2414 // Mask used here is stored in dst. | 2455 // Mask used here is stored in dst. |
| 2415 XMMRegister dst = i.OutputSimd128Register(); | 2456 XMMRegister dst = i.OutputSimd128Register(); |
| 2416 __ movaps(kScratchDoubleReg, i.InputSimd128Register(1)); | 2457 __ movaps(kScratchDoubleReg, i.InputSimd128Register(1)); |
| 2417 __ xorps(kScratchDoubleReg, i.InputSimd128Register(2)); | 2458 __ xorps(kScratchDoubleReg, i.InputSimd128Register(2)); |
| 2418 __ andps(dst, kScratchDoubleReg); | 2459 __ andps(dst, kScratchDoubleReg); |
| 2419 __ xorps(dst, i.InputSimd128Register(2)); | 2460 __ xorps(dst, i.InputSimd128Register(2)); |
| 2420 break; | 2461 break; |
| 2421 } | 2462 } |
| 2422 case kCheckedLoadInt8: | 2463 case kCheckedLoadInt8: |
| (...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3176 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 3217 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
| 3177 __ Nop(padding_size); | 3218 __ Nop(padding_size); |
| 3178 } | 3219 } |
| 3179 } | 3220 } |
| 3180 | 3221 |
| 3181 #undef __ | 3222 #undef __ |
| 3182 | 3223 |
| 3183 } // namespace compiler | 3224 } // namespace compiler |
| 3184 } // namespace internal | 3225 } // namespace internal |
| 3185 } // namespace v8 | 3226 } // namespace v8 |
| OLD | NEW |