• 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
..
api Loading commit data...
asmjs Loading commit data...
assembler Loading commit data...
base Loading commit data...
codegen Loading commit data...
compiler Loading commit data...
compiler-dispatcher Loading commit data...
date Loading commit data...
diagnostics Loading commit data...
execution Loading commit data...
heap Loading commit data...
interpreter Loading commit data...
libplatform Loading commit data...
logging Loading commit data...
numbers Loading commit data...
objects Loading commit data...
parser Loading commit data...
profiler Loading commit data...
regress Loading commit data...
strings Loading commit data...
tasks Loading commit data...
torque Loading commit data...
utils Loading commit data...
wasm Loading commit data...
zone Loading commit data...
BUILD.gn Loading commit data...
DEPS Loading commit data...
run-all-unittests.cc Loading commit data...
test-helpers.cc Loading commit data...
test-helpers.h Loading commit data...
test-utils.cc Loading commit data...
test-utils.h Loading commit data...
testcfg.py Loading commit data...
unittests.status Loading commit data...