Commit 1d2726dd authored by Ng Zhi An's avatar Ng Zhi An Committed by Commit Bot

[wasm-simd] Stage SIMD

SIMD has been pretty stable for a while now, we are not expecting big
changes (like opcode renumbers), there might be new instructions added,
and they will all be backwards-compatible.

The reference interpreter in the SIMD proposal is now capable of
generating JS files for all test cases, so we can now run them.

There is a bit of tweaking necessary, since SIMD tests are in
tests/core/simd subfolder in the spec, so we need to change the glob
into a find that will traverse into subdirectory.

Bug: v8:10835
Change-Id: I1f7e3cf37f21b2aa2537d1e34242da2373bbf626
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2378587
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69793}
parent 5ef20e28
...@@ -15,11 +15,6 @@ ...@@ -15,11 +15,6 @@
/* V8 side owner: clemensb */ \ /* V8 side owner: clemensb */ \
V(eh, "exception handling opcodes", false) \ V(eh, "exception handling opcodes", false) \
\ \
/* Fixed-width SIMD operations. */ \
/* https://github.com/webassembly/simd */ \
/* V8 side owner: gdeepti */ \
V(simd, "SIMD opcodes", false) \
\
/* No official proposal (yet?). */ \ /* No official proposal (yet?). */ \
/* V8 side owner: clemensb */ \ /* V8 side owner: clemensb */ \
V(compilation_hints, "compilation hints section", false) \ V(compilation_hints, "compilation hints section", false) \
...@@ -56,6 +51,12 @@ ...@@ -56,6 +51,12 @@
/* Staged in v8.7 * */ \ /* Staged in v8.7 * */ \
V(return_call, "return call opcodes", false) \ V(return_call, "return call opcodes", false) \
\ \
/* Fixed-width SIMD operations. */ \
/* https://github.com/webassembly/simd */ \
/* V8 side owner: gdeepti, zhin */ \
/* Staged in v8.7 * */ \
V(simd, "SIMD opcodes", false) \
\
/* Threads proposal. */ \ /* Threads proposal. */ \
/* https://github.com/webassembly/threads */ \ /* https://github.com/webassembly/threads */ \
/* NOTE: This is enabled via chromium flag on desktop systems since v7.4 */ \ /* NOTE: This is enabled via chromium flag on desktop systems since v7.4 */ \
......
...@@ -310,8 +310,6 @@ void WasmExecutionFuzzer::FuzzWasmModule(Vector<const uint8_t> data, ...@@ -310,8 +310,6 @@ void WasmExecutionFuzzer::FuzzWasmModule(Vector<const uint8_t> data,
FlagScope<bool> enable_##feat(&FLAG_experimental_wasm_##feat, true); FlagScope<bool> enable_##feat(&FLAG_experimental_wasm_##feat, true);
FOREACH_WASM_STAGING_FEATURE_FLAG(ENABLE_STAGED_FEATURES) FOREACH_WASM_STAGING_FEATURE_FLAG(ENABLE_STAGED_FEATURES)
#undef ENABLE_STAGED_FEATURES #undef ENABLE_STAGED_FEATURES
// SIMD is not included in staging yet, so we enable it here for fuzzing.
EXPERIMENTAL_FLAG_SCOPE(simd);
// Strictly enforce the input size limit. Note that setting "max_len" on the // Strictly enforce the input size limit. Note that setting "max_len" on the
// fuzzer target is not enough, since different fuzzers are used and not all // fuzzer target is not enough, since different fuzzers are used and not all
......
...@@ -34,6 +34,11 @@ proposal_flags = [{ ...@@ -34,6 +34,11 @@ proposal_flags = [{
'flags': ['--experimental-wasm-tail-call', 'flags': ['--experimental-wasm-tail-call',
'--wasm-staging'] '--wasm-staging']
}, },
{
'name': 'simd',
'flags': ['--experimental-wasm-simd',
'--wasm-staging']
},
] ]
......
e17c5119c343be682a2783156c4a56c2528333a3 a7c9db6002250f90f4b316649b2915791ff389a8
\ No newline at end of file \ No newline at end of file
...@@ -27,6 +27,11 @@ proposal_flags = [{ ...@@ -27,6 +27,11 @@ proposal_flags = [{
'flags': ['--experimental-wasm-return-call', 'flags': ['--experimental-wasm-return-call',
'--wasm-staging'] '--wasm-staging']
}, },
{
'name': 'simd',
'flags': ['--experimental-wasm-simd',
'--wasm-staging']
},
] ]
class TestLoader(testsuite.JSTestLoader): class TestLoader(testsuite.JSTestLoader):
......
10a6b24d01b5124f14658e7a4b8c354138d62386 d4b9b276a7d0608e3a9bb2d62e6d2b877d05da0c
\ No newline at end of file \ No newline at end of file
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
# TODO(wasm) Investigate failing spec tests after update. # TODO(wasm) Investigate failing spec tests after update.
'binary': [FAIL], 'binary': [FAIL],
'proposals/js-types/binary-leb128': [FAIL], 'proposals/js-types/binary-leb128': [FAIL],
'proposals/bulk-memory-operations/binary': [FAIL],
'proposals/bulk-memory-operations/binary-leb128': [FAIL], 'proposals/bulk-memory-operations/binary-leb128': [FAIL],
# TODO(v8:9144): The MVP behavior when bounds-checking segments changed in # TODO(v8:9144): The MVP behavior when bounds-checking segments changed in
...@@ -35,6 +36,34 @@ ...@@ -35,6 +36,34 @@
# This test requires the reftypes flag to be disabled. # This test requires the reftypes flag to be disabled.
'proposals/bulk-memory-operations/imports': [FAIL], 'proposals/bulk-memory-operations/imports': [FAIL],
# SIMD test cases
# Scalar lowering is incomplete, we skip these and selectively enable as
# we finish the implementation, see v8:10507.
'proposals/simd/simd_bit_shift' : [PASS, FAIL],
'proposals/simd/simd_boolean' : [PASS, FAIL],
'proposals/simd/simd_const' : [PASS, FAIL],
'proposals/simd/simd_conversions' : [PASS, FAIL],
'proposals/simd/simd_f32x4': [PASS, FAIL],
'proposals/simd/simd_f32x4_arith': [PASS, FAIL],
'proposals/simd/simd_f64x2': [PASS, FAIL],
'proposals/simd/simd_f64x2_arith' : [PASS, FAIL],
'proposals/simd/simd_f64x2_cmp' : [PASS, FAIL],
'proposals/simd/simd_i16x8_arith' : [PASS, FAIL],
'proposals/simd/simd_i16x8_arith2' : [PASS, FAIL],
'proposals/simd/simd_i16x8_cmp' : [PASS, FAIL],
'proposals/simd/simd_i16x8_sat_arith' : [PASS, FAIL],
'proposals/simd/simd_i64x2_arith' : [PASS, FAIL],
'proposals/simd/simd_i8x16_arith' : [PASS, FAIL],
'proposals/simd/simd_i8x16_arith2' : [PASS, FAIL],
'proposals/simd/simd_i8x16_cmp' : [PASS, FAIL],
'proposals/simd/simd_i8x16_sat_arith' : [PASS, FAIL],
'proposals/simd/simd_lane' : [PASS, FAIL],
'proposals/simd/simd_load' : [PASS, FAIL],
'proposals/simd/simd_load_extend' : [PASS, FAIL],
'proposals/simd/simd_load_splat' : [PASS, FAIL],
'proposals/simd/simd_splat' : [PASS, FAIL],
}], # ALWAYS }], # ALWAYS
['arch == mipsel or arch == mips64el or arch == mips or arch == mips64', { ['arch == mipsel or arch == mips64el or arch == mips or arch == mips64', {
......
...@@ -71,7 +71,7 @@ log_and_run cp -r ${TMP_DIR}/spec/test/js-api/* ${JS_API_TEST_DIR}/tests ...@@ -71,7 +71,7 @@ log_and_run cp -r ${TMP_DIR}/spec/test/js-api/* ${JS_API_TEST_DIR}/tests
# Generate the proposal tests. # Generate the proposal tests.
############################################################################### ###############################################################################
repos='bulk-memory-operations reference-types js-types tail-call' repos='bulk-memory-operations reference-types js-types tail-call simd'
for repo in ${repos}; do for repo in ${repos}; do
echo "Process ${repo}" echo "Process ${repo}"
...@@ -86,9 +86,8 @@ for repo in ${repos}; do ...@@ -86,9 +86,8 @@ for repo in ${repos}; do
# Iterate over all proposal tests. Those which differ from the spec tests are # Iterate over all proposal tests. Those which differ from the spec tests are
# copied to the output directory and converted to .js tests. # copied to the output directory and converted to .js tests.
for abs_filename in ${TMP_DIR}/${repo}/test/core/*.wast; do for rel_filename in $(find . -name '*.wast'); do
rel_filename="$(basename -- $abs_filename)" abs_filename=$(realpath $rel_filename)
test_name=${rel_filename%.wast}
spec_filename=${TMP_DIR}/spec/test/core/${rel_filename} spec_filename=${TMP_DIR}/spec/test/core/${rel_filename}
if [ ! -f "$spec_filename" ] || ! cmp -s $abs_filename $spec_filename ; then if [ ! -f "$spec_filename" ] || ! cmp -s $abs_filename $spec_filename ; then
log_and_run cp ${rel_filename} ${SPEC_TEST_DIR}/tests/proposals/${repo}/ log_and_run cp ${rel_filename} ${SPEC_TEST_DIR}/tests/proposals/${repo}/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment