• Ng Zhi An's avatar
    [wasm] Fix wasm decoder for multi-byte opcodes · b48b82e7
    Ng Zhi An authored
    SIMD opcodes consist of the prefix byte, then an LEB128 encoded int. We
    were decoding this incorrectly as a fixed uint8. This fixes the decoder
    to properly handle multi bytes.
    
    In some cases, the multi byte logic is applied to all prefixed opcodes.
    This is not a problem, since for values < 0x80, the LEB encoding is a
    single byte, and decodes to the same int. If the prefix opcode has
    instructions with index >= 0x80, it would be required to be LEB128
    encoded anyway.
    
    There are a bunch of trivial changes to test-run-wasm-simd, to change
    the macro from BUILD to BUILD_V, the former only works for single byte
    opcodes, the latter is a new template-based macro that correct handles
    multi-byte opcodes. The only unchanged test is the shuffle fuzzer test,
    which builds its own sequence of bytes without using the BUILD macro.
    
    Bug: v8:10258
    Change-Id: Ie7377e899a7eab97ecf28176fd908babc08d0f19
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2118476
    Commit-Queue: Zhi An Ng <zhin@chromium.org>
    Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
    Reviewed-by: 's avatarDeepti Gandluri <gdeepti@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#67186}
    b48b82e7
Name
Last commit
Last update
..
OWNERS Loading commit data...
test-c-wasm-entry.cc Loading commit data...
test-compilation-cache.cc Loading commit data...
test-grow-memory.cc Loading commit data...
test-jump-table-assembler.cc Loading commit data...
test-liftoff-inspection.cc Loading commit data...
test-run-wasm-64.cc Loading commit data...
test-run-wasm-asmjs.cc Loading commit data...
test-run-wasm-atomics.cc Loading commit data...
test-run-wasm-atomics64.cc Loading commit data...
test-run-wasm-bulk-memory.cc Loading commit data...
test-run-wasm-exceptions.cc Loading commit data...
test-run-wasm-interpreter.cc Loading commit data...
test-run-wasm-js.cc Loading commit data...
test-run-wasm-module.cc Loading commit data...
test-run-wasm-sign-extension.cc Loading commit data...
test-run-wasm-simd-liftoff.cc Loading commit data...
test-run-wasm-simd.cc Loading commit data...
test-run-wasm.cc Loading commit data...
test-streaming-compilation.cc Loading commit data...
test-wasm-breakpoints.cc Loading commit data...
test-wasm-codegen.cc Loading commit data...
test-wasm-debug-evaluate.cc Loading commit data...
test-wasm-import-wrapper-cache.cc Loading commit data...
test-wasm-interpreter-entry.cc Loading commit data...
test-wasm-serialization.cc Loading commit data...
test-wasm-shared-engine.cc Loading commit data...
test-wasm-stack.cc Loading commit data...
test-wasm-trap-position.cc Loading commit data...
wasm-atomics-utils.h Loading commit data...
wasm-run-utils.cc Loading commit data...
wasm-run-utils.h Loading commit data...