OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/wasm-compiler.h" | 5 #include "src/compiler/wasm-compiler.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/isolate-inl.h" | 9 #include "src/isolate-inl.h" |
10 | 10 |
(...skipping 3333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3344 Int32Constant(value), Int32Constant(value)); | 3344 Int32Constant(value), Int32Constant(value)); |
3345 } | 3345 } |
3346 | 3346 |
3347 Node* WasmGraphBuilder::SimdOp(wasm::WasmOpcode opcode, | 3347 Node* WasmGraphBuilder::SimdOp(wasm::WasmOpcode opcode, |
3348 const NodeVector& inputs) { | 3348 const NodeVector& inputs) { |
3349 has_simd_ = true; | 3349 has_simd_ = true; |
3350 switch (opcode) { | 3350 switch (opcode) { |
3351 case wasm::kExprF32x4Splat: | 3351 case wasm::kExprF32x4Splat: |
3352 return graph()->NewNode(jsgraph()->machine()->CreateFloat32x4(), | 3352 return graph()->NewNode(jsgraph()->machine()->CreateFloat32x4(), |
3353 inputs[0], inputs[0], inputs[0], inputs[0]); | 3353 inputs[0], inputs[0], inputs[0], inputs[0]); |
3354 case wasm::kExprF32x4FromInt32x4: | 3354 case wasm::kExprF32x4SConvertI32x4: |
3355 return graph()->NewNode(jsgraph()->machine()->Float32x4FromInt32x4(), | 3355 return graph()->NewNode(jsgraph()->machine()->Float32x4FromInt32x4(), |
3356 inputs[0]); | 3356 inputs[0]); |
3357 case wasm::kExprF32x4FromUint32x4: | 3357 case wasm::kExprF32x4UConvertI32x4: |
3358 return graph()->NewNode(jsgraph()->machine()->Float32x4FromUint32x4(), | 3358 return graph()->NewNode(jsgraph()->machine()->Float32x4FromUint32x4(), |
3359 inputs[0]); | 3359 inputs[0]); |
3360 case wasm::kExprF32x4Abs: | 3360 case wasm::kExprF32x4Abs: |
3361 return graph()->NewNode(jsgraph()->machine()->Float32x4Abs(), inputs[0]); | 3361 return graph()->NewNode(jsgraph()->machine()->Float32x4Abs(), inputs[0]); |
3362 case wasm::kExprF32x4Neg: | 3362 case wasm::kExprF32x4Neg: |
3363 return graph()->NewNode(jsgraph()->machine()->Float32x4Neg(), inputs[0]); | 3363 return graph()->NewNode(jsgraph()->machine()->Float32x4Neg(), inputs[0]); |
3364 case wasm::kExprF32x4Add: | 3364 case wasm::kExprF32x4Add: |
3365 return graph()->NewNode(jsgraph()->machine()->Float32x4Add(), inputs[0], | 3365 return graph()->NewNode(jsgraph()->machine()->Float32x4Add(), inputs[0], |
3366 inputs[1]); | 3366 inputs[1]); |
3367 case wasm::kExprF32x4Sub: | 3367 case wasm::kExprF32x4Sub: |
3368 return graph()->NewNode(jsgraph()->machine()->Float32x4Sub(), inputs[0], | 3368 return graph()->NewNode(jsgraph()->machine()->Float32x4Sub(), inputs[0], |
3369 inputs[1]); | 3369 inputs[1]); |
3370 case wasm::kExprF32x4Eq: | 3370 case wasm::kExprF32x4Eq: |
3371 return graph()->NewNode(jsgraph()->machine()->Float32x4Equal(), inputs[0], | 3371 return graph()->NewNode(jsgraph()->machine()->Float32x4Equal(), inputs[0], |
3372 inputs[1]); | 3372 inputs[1]); |
3373 case wasm::kExprF32x4Ne: | 3373 case wasm::kExprF32x4Ne: |
3374 return graph()->NewNode(jsgraph()->machine()->Float32x4NotEqual(), | 3374 return graph()->NewNode(jsgraph()->machine()->Float32x4NotEqual(), |
3375 inputs[0], inputs[1]); | 3375 inputs[0], inputs[1]); |
3376 case wasm::kExprI32x4Splat: | 3376 case wasm::kExprI32x4Splat: |
3377 return graph()->NewNode(jsgraph()->machine()->CreateInt32x4(), inputs[0], | 3377 return graph()->NewNode(jsgraph()->machine()->CreateInt32x4(), inputs[0], |
3378 inputs[0], inputs[0], inputs[0]); | 3378 inputs[0], inputs[0], inputs[0]); |
3379 case wasm::kExprI32x4FromFloat32x4: | 3379 case wasm::kExprI32x4SConvertF32x4: |
3380 return graph()->NewNode(jsgraph()->machine()->Int32x4FromFloat32x4(), | 3380 return graph()->NewNode(jsgraph()->machine()->Int32x4FromFloat32x4(), |
3381 inputs[0]); | 3381 inputs[0]); |
3382 case wasm::kExprUi32x4FromFloat32x4: | 3382 case wasm::kExprI32x4UConvertF32x4: |
3383 return graph()->NewNode(jsgraph()->machine()->Uint32x4FromFloat32x4(), | 3383 return graph()->NewNode(jsgraph()->machine()->Uint32x4FromFloat32x4(), |
3384 inputs[0]); | 3384 inputs[0]); |
3385 case wasm::kExprI32x4Add: | 3385 case wasm::kExprI32x4Add: |
3386 return graph()->NewNode(jsgraph()->machine()->Int32x4Add(), inputs[0], | 3386 return graph()->NewNode(jsgraph()->machine()->Int32x4Add(), inputs[0], |
3387 inputs[1]); | 3387 inputs[1]); |
3388 case wasm::kExprI32x4Sub: | 3388 case wasm::kExprI32x4Sub: |
3389 return graph()->NewNode(jsgraph()->machine()->Int32x4Sub(), inputs[0], | 3389 return graph()->NewNode(jsgraph()->machine()->Int32x4Sub(), inputs[0], |
3390 inputs[1]); | 3390 inputs[1]); |
3391 case wasm::kExprI32x4Eq: | 3391 case wasm::kExprI32x4Eq: |
3392 return graph()->NewNode(jsgraph()->machine()->Int32x4Equal(), inputs[0], | 3392 return graph()->NewNode(jsgraph()->machine()->Int32x4Equal(), inputs[0], |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3873 Smi::FromInt(instruction.instr_offset)); | 3873 Smi::FromInt(instruction.instr_offset)); |
3874 fn_protected->set(Code::kTrapDataSize * i + Code::kTrapLandingOffset, | 3874 fn_protected->set(Code::kTrapDataSize * i + Code::kTrapLandingOffset, |
3875 Smi::FromInt(instruction.landing_offset)); | 3875 Smi::FromInt(instruction.landing_offset)); |
3876 } | 3876 } |
3877 return fn_protected; | 3877 return fn_protected; |
3878 } | 3878 } |
3879 | 3879 |
3880 } // namespace compiler | 3880 } // namespace compiler |
3881 } // namespace internal | 3881 } // namespace internal |
3882 } // namespace v8 | 3882 } // namespace v8 |
OLD | NEW |