Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: src/wasm/function-body-decoder-impl.h

Issue 2847663005: [WASM SIMD] Replace primitive shuffles with general Shuffle. (Closed)
Patch Set: Rebase. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/wasm/function-body-decoder.cc ('k') | src/wasm/wasm-opcodes.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 the V8 project authors. All rights reserved. 1 // Copyright 2017 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 #ifndef V8_WASM_FUNCTION_BODY_DECODER_IMPL_H_ 5 #ifndef V8_WASM_FUNCTION_BODY_DECODER_IMPL_H_
6 #define V8_WASM_FUNCTION_BODY_DECODER_IMPL_H_ 6 #define V8_WASM_FUNCTION_BODY_DECODER_IMPL_H_
7 7
8 #include "src/wasm/decoder.h" 8 #include "src/wasm/decoder.h"
9 #include "src/wasm/wasm-opcodes.h" 9 #include "src/wasm/wasm-opcodes.h"
10 10
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 template <bool checked> 315 template <bool checked>
316 struct SimdShiftOperand { 316 struct SimdShiftOperand {
317 uint8_t shift; 317 uint8_t shift;
318 unsigned length = 1; 318 unsigned length = 1;
319 319
320 inline SimdShiftOperand(Decoder* decoder, const byte* pc) { 320 inline SimdShiftOperand(Decoder* decoder, const byte* pc) {
321 shift = decoder->read_u8<checked>(pc + 2, "shift"); 321 shift = decoder->read_u8<checked>(pc + 2, "shift");
322 } 322 }
323 }; 323 };
324 324
325 // Operand for SIMD concatenation operations. 325 // Operand for SIMD shuffle operations.
326 template <bool checked> 326 template <bool checked>
327 struct SimdConcatOperand { 327 struct SimdShuffleOperand {
328 uint8_t bytes; 328 uint8_t shuffle[16];
329 unsigned length; 329 unsigned lanes;
330 330
331 inline SimdConcatOperand(Decoder* decoder, const byte* pc) { 331 inline SimdShuffleOperand(Decoder* decoder, const byte* pc, unsigned lanes_) {
332 bytes = decoder->read_u8<checked>(pc + 2, "bytes"); 332 lanes = lanes_;
333 length = 1; 333 for (unsigned i = 0; i < lanes; i++) {
334 shuffle[i] = decoder->read_u8<checked>(pc + 2 + i, "shuffle");
335 }
334 } 336 }
335 }; 337 };
336 338
337 #undef CHECKED_COND 339 #undef CHECKED_COND
338 340
339 } // namespace wasm 341 } // namespace wasm
340 } // namespace internal 342 } // namespace internal
341 } // namespace v8 343 } // namespace v8
342 344
343 #endif // V8_WASM_FUNCTION_BODY_DECODER_IMPL_H_ 345 #endif // V8_WASM_FUNCTION_BODY_DECODER_IMPL_H_
OLDNEW
« no previous file with comments | « src/wasm/function-body-decoder.cc ('k') | src/wasm/wasm-opcodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698