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/signature.h" | 5 #include "src/signature.h" |
6 | 6 |
7 #include "src/bit-vector.h" | 7 #include "src/bit-vector.h" |
8 #include "src/flags.h" | 8 #include "src/flags.h" |
9 #include "src/handles.h" | 9 #include "src/handles.h" |
10 #include "src/zone/zone-containers.h" | 10 #include "src/zone/zone-containers.h" |
(...skipping 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1241 Value val = Pop(1, type); | 1241 Value val = Pop(1, type); |
1242 Value index = Pop(0, kAstI32); | 1242 Value index = Pop(0, kAstI32); |
1243 BUILD(StoreMem, mem_type, index.node, operand.offset, operand.alignment, | 1243 BUILD(StoreMem, mem_type, index.node, operand.offset, operand.alignment, |
1244 val.node, position()); | 1244 val.node, position()); |
1245 return 1 + operand.length; | 1245 return 1 + operand.length; |
1246 } | 1246 } |
1247 | 1247 |
1248 unsigned DecodeSimdOpcode(WasmOpcode opcode) { | 1248 unsigned DecodeSimdOpcode(WasmOpcode opcode) { |
1249 unsigned len = 0; | 1249 unsigned len = 0; |
1250 switch (opcode) { | 1250 switch (opcode) { |
1251 case kExprI32x4ExtractLane: { | 1251 case kExprI32x4ReplaceLane: { |
1252 compiler::NodeVector inputs(3, zone_); | |
1253 inputs[2] = Pop(1, LocalType::kWord32).node; | |
1252 uint8_t lane = this->checked_read_u8(pc_, 2, "lane number"); | 1254 uint8_t lane = this->checked_read_u8(pc_, 2, "lane number"); |
1253 if (lane < 0 || lane > 3) { | 1255 if (lane < 0 || lane > 3) { |
1254 error(pc_, pc_ + 2, "invalid extract lane value"); | 1256 error(pc_, pc_ + 2, "invalid extract lane value"); |
bbudge
2016/10/04 20:34:26
s/extract/replace
I think there are enough SIMD i
gdeepti
2016/11/22 01:15:20
Using LaneOperand as introduced in the ScalarLower
| |
1255 } | 1257 } |
1256 TFNode* input = Pop(0, LocalType::kSimd128).node; | 1258 inputs[1] = builder_->Int32Constant(lane); |
1257 TFNode* node = BUILD(SimdExtractLane, opcode, lane, input); | 1259 inputs[0] = Pop(0, LocalType::kSimd128).node; |
1260 TFNode* node = BUILD(SimdOp, opcode, inputs); | |
1261 Push(LocalType::kSimd128, node); | |
1262 len++; | |
1263 break; | |
1264 } | |
1265 case kExprI32x4ExtractLane: { | |
1266 compiler::NodeVector inputs(2, zone_); | |
1267 inputs[0] = Pop(0, LocalType::kSimd128).node; | |
1268 uint8_t lane = this->checked_read_u8(pc_, 2, "lane number"); | |
1269 if (lane < 0 || lane > 3) { | |
1270 error(pc_, pc_ + 2, "invalid extract lane value"); | |
1271 } | |
1272 inputs[1] = builder_->Int32Constant(lane); | |
1273 TFNode* node = BUILD(SimdOp, opcode, inputs); | |
1258 Push(LocalType::kWord32, node); | 1274 Push(LocalType::kWord32, node); |
1259 len++; | 1275 len++; |
1260 break; | 1276 break; |
1261 } | 1277 } |
1262 default: { | 1278 default: { |
1263 FunctionSig* sig = WasmOpcodes::Signature(opcode); | 1279 FunctionSig* sig = WasmOpcodes::Signature(opcode); |
1264 if (sig != nullptr) { | 1280 if (sig != nullptr) { |
1265 compiler::NodeVector inputs(sig->parameter_count(), zone_); | 1281 compiler::NodeVector inputs(sig->parameter_count(), zone_); |
1266 for (size_t i = sig->parameter_count(); i > 0; i--) { | 1282 for (size_t i = sig->parameter_count(); i > 0; i--) { |
1267 Value val = Pop(static_cast<int>(i - 1), sig->GetParam(i - 1)); | 1283 Value val = Pop(static_cast<int>(i - 1), sig->GetParam(i - 1)); |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1933 BitVector* AnalyzeLoopAssignmentForTesting(Zone* zone, size_t num_locals, | 1949 BitVector* AnalyzeLoopAssignmentForTesting(Zone* zone, size_t num_locals, |
1934 const byte* start, const byte* end) { | 1950 const byte* start, const byte* end) { |
1935 FunctionBody body = {nullptr, nullptr, nullptr, start, end}; | 1951 FunctionBody body = {nullptr, nullptr, nullptr, start, end}; |
1936 WasmFullDecoder decoder(zone, nullptr, body); | 1952 WasmFullDecoder decoder(zone, nullptr, body); |
1937 return decoder.AnalyzeLoopAssignmentForTesting(start, num_locals); | 1953 return decoder.AnalyzeLoopAssignmentForTesting(start, num_locals); |
1938 } | 1954 } |
1939 | 1955 |
1940 } // namespace wasm | 1956 } // namespace wasm |
1941 } // namespace internal | 1957 } // namespace internal |
1942 } // namespace v8 | 1958 } // namespace v8 |
OLD | NEW |