• Ng Zhi An's avatar
    [wasm-simd] New macro to build using vector of bytes · 1e40c682
    Ng Zhi An authored
    Introduces a new macro BUILD_V (v is for vector) that pushes bytes into
    a vector (instead of directly in an array initializer, see BUILD). This
    has the positive effect of being able to handle opcodes of multiple
    bytes (e.g. SIMD opcodes bigger that 0xfd80). Because of this "API"
    change, our helper macros in test-run-wasm-simd.cc and wasm-run-utils.h
    need to change too. So, we introduce new macros (suffixed by _V), that
    will call the appropriate lambdas defined in BUILD_V, that knows how to
    push bytes into the vector, and also can handle multi-byte opcodes.
    
    This design has a bit of duplication and ugliness, but was chosen to
    reduce the impact of existing tests. No restructuring of test code is
    required, we only need to add suffix _V.
    
    Note that we do not have multi-byte opcodes yet (in wasm-opcodes.h),
    this change will be breaking, and requires all the tests to be updated
    to use _V macros first.
    
    Bug: v8:10258
    Change-Id: I86638a548fe2f9714c1cfb3bd691fb7b49bfd652
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2107650
    Commit-Queue: Zhi An Ng <zhin@chromium.org>
    Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#66812}
    1e40c682
wasm-run-utils.h 22.5 KB