Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
https://bugs.webkit.org/show_bug.cgi?id=249357 Reviewed by Yusuke Suzuki. Increase simd test coverage: 1) Add a new testing mode to force every function to be conservative w.r.t. treating floating point registers as vectors 2) Allow tier-up directly to OMG for SIMD functions 3) Remove extra test options implied when using SIMD. Note that we now assume all functions might use SIMD if the LLInt is disabled. 4) Add new (currently failing) tests: simd-exception.js, simd-osr.js, simd-tiny-loop.js. Note that these all pass in v8. 5) Update dont-stack-overflow-in-air.js. It uses f64 locals, which become 128-bit when the LLInt is disabled. This is a real regression introduced by this patch, but this mode is not very important for performance so we force the LLInt to be enabled in this mode. * JSTests/wasm/assert.js: * JSTests/wasm/stress/simd-const-spill.js: * JSTests/wasm/stress/simd-const.js: * JSTests/wasm/stress/simd-exception.js: Added. (let.wat.module.import.string_appeared_here.string_appeared_here.tag.e.i32.param.i32.func.test_throw.export.string_appeared_here.param.sz.i32.local.i.i32.local.i.i32.const.0.loop.loop.local.i.i32.const.1.i32.add.local.i.local.i.local.sz.i32.eq.then.throw.e.i32.local.i.local.i.i32.const.1000.i32.lt_s.br_if.loop.func.test_catch.export.string_appeared_here.result.i32.v128.const.i32x4.1337.1337.1337.1337.try.call.test_throw.i32.const.500.catch.e.i32.i32.const.500.i32.ne.then.unreachable.i32x4.extract_lane.3.async test): * JSTests/wasm/stress/simd-kitchen-sink.js: * JSTests/wasm/stress/simd-load.js: * JSTests/wasm/stress/simd-register-allocation.js: * JSTests/wasm/stress/simd-return-value-alignment.js: * JSTests/wasm/v8/exceptions-simd.js: (TestThrowS128Default): * JSTests/wasm/v8/liftoff-simd-params.js: * JSTests/wasm/v8/multi-value-simd.js: * JSTests/wasm/v8/regress/regress-10309.js: * JSTests/wasm/v8/regress/regress-1054466.js: * JSTests/wasm/v8/regress/regress-1065599.js: * JSTests/wasm/v8/regress/regress-1070078.js: * JSTests/wasm/v8/regress/regress-1081030.js: * JSTests/wasm/v8/regress/regress-10831.js: * JSTests/wasm/v8/regress/regress-1111522.js: * JSTests/wasm/v8/regress/regress-1112124.js: * JSTests/wasm/v8/regress/regress-1116019.js: * JSTests/wasm/v8/regress/regress-1124885.js: * JSTests/wasm/v8/regress/regress-1132461.js: * JSTests/wasm/v8/regress/regress-1161555.js: * JSTests/wasm/v8/regress/regress-1161654.js: * JSTests/wasm/v8/regress/regress-1161954.js: * JSTests/wasm/v8/regress/regress-1165966.js: * JSTests/wasm/v8/regress/regress-1179182.js: * JSTests/wasm/v8/regress/regress-1187831.js: * JSTests/wasm/v8/regress/regress-1188975.js: * JSTests/wasm/v8/regress/regress-1199662.js: * JSTests/wasm/v8/regress/regress-1231950.js: * JSTests/wasm/v8/regress/regress-1242300.js: * JSTests/wasm/v8/regress/regress-1242689.js: * JSTests/wasm/v8/regress/regress-1264462.js: * JSTests/wasm/v8/regress/regress-1271244.js: * JSTests/wasm/v8/regress/regress-1271456.js: * JSTests/wasm/v8/regress/regress-1271538.js: * JSTests/wasm/v8/regress/regress-1282224.js: * JSTests/wasm/v8/regress/regress-1283042.js: * JSTests/wasm/v8/regress/regress-1283395.js: * JSTests/wasm/v8/regress/regress-1284980.js: * JSTests/wasm/v8/regress/regress-1286253.js: * JSTests/wasm/v8/regress/regress-1289678.js: * JSTests/wasm/v8/regress/regress-1290079.js: * JSTests/wasm/v8/regress/regress-9447.js: * JSTests/wasm/v8/regress/regress-crbug-1338980.js: * JSTests/wasm/v8/regress/regress-crbug-1355070.js: * JSTests/wasm/v8/regress/regress-crbug-1356718.js: * JSTests/wasm/v8/simd-call.js: * JSTests/wasm/v8/simd-errors.js: * JSTests/wasm/v8/simd-globals.js: * JSTests/wasm/v8/simd-i64x2-mul.js: * Source/JavaScriptCore/b3/B3Procedure.h: (JSC::B3::Procedure::usesSIMD const): * Source/JavaScriptCore/runtime/Options.cpp: (JSC::Options::notifyOptionsChanged): * Source/JavaScriptCore/runtime/OptionsList.h: * Source/JavaScriptCore/wasm/WasmSlowPaths.cpp: (JSC::LLInt::jitCompileSIMDFunction): * Tools/Scripts/run-jsc-stress-tests: Canonical link: https://commits.webkit.org/257974@main
- Loading branch information
1 parent
0b27858
commit a11ede1
Showing
62 changed files
with
237 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
//@ requireOptions("--useWebAssemblySIMD=1") | ||
//@ skip if $architecture != "arm64" && $architecture != "x86_64" | ||
//@ skip | ||
//FIXME: this test is currently failing. | ||
import { instantiate } from "../wabt-wrapper.js" | ||
import * as assert from "../assert.js" | ||
|
||
const tag = new WebAssembly.Tag({ parameters: ["i32"] }); | ||
|
||
let wat = ` | ||
(module | ||
(import "m" "tag" (tag $e-i32 (param i32))) | ||
(func $test_throw (export "test_throw") (param $sz i32) | ||
(local $i i32) | ||
(local.set $i (i32.const 0)) | ||
(loop $loop | ||
local.get $i | ||
i32.const 1 | ||
i32.add | ||
local.set $i | ||
local.get $i | ||
local.get $sz | ||
(if (i32.eq) (then (throw $e-i32 (local.get $i)))) | ||
local.get $i | ||
i32.const 1000 | ||
i32.lt_s | ||
br_if $loop) | ||
) | ||
(func $test_catch (export "test_catch") (result i32) | ||
(v128.const i32x4 1337 1337 1337 1337) | ||
(try | ||
(do | ||
(call $test_throw (i32.const 500))) | ||
(catch $e-i32 | ||
(i32.const 500) | ||
(if (i32.ne) (then (unreachable))) | ||
)) | ||
(i32x4.extract_lane 3)) | ||
) | ||
` | ||
|
||
async function test() { | ||
const instance = await instantiate(wat, { m: { tag } }, { simd: true, exceptions: true }) | ||
const { test_throw, test_catch } = instance.exports | ||
|
||
for (let i = 0; i < 10000; ++i) { | ||
try { | ||
test_throw(42) | ||
assert.truthy(false) | ||
} catch (e) { | ||
assert.truthy(e.is(tag)) | ||
assert.eq(e.getArg(tag, 0), 42) | ||
} | ||
assert.eq(test_catch(), 1337) | ||
} | ||
} | ||
|
||
assert.asyncTest(test()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
//@ requireOptions("--useWebAssemblySIMD=1") | ||
//@ skip if $architecture != "arm64" && $architecture != "x86_64" | ||
//@ skip | ||
//FIXME: this test is currently broken. | ||
import { instantiate } from "../wabt-wrapper.js" | ||
import * as assert from "../assert.js" | ||
|
||
let wat = ` | ||
(module | ||
(func (export "test") (result i32) | ||
(local $r v128) | ||
(local $i i32) | ||
(v128.const i32x4 42 42 42 42) | ||
(loop $loop | ||
local.get $i | ||
i32.const 1 | ||
i32.add | ||
local.set $i | ||
(i32x4.add (local.get $r) (v128.const i32x4 1 2 3 4)) | ||
local.set $r | ||
local.get $i | ||
i32.const 1000 | ||
i32.lt_s | ||
br_if $loop) | ||
(i32x4.extract_lane 0) | ||
(i32x4.extract_lane 3 (local.get $r)) | ||
i32.add | ||
) | ||
) | ||
` | ||
|
||
async function test() { | ||
const instance = await instantiate(wat, {}, { simd: true }) | ||
const { test } = instance.exports | ||
|
||
for (let i = 0; i < 10000; ++i) { | ||
assert.eq(test(), 1000*4 + 42) | ||
} | ||
} | ||
|
||
assert.asyncTest(test()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
//@ requireOptions("--useWebAssemblySIMD=1", "--watchdog=1000", "--watchdog-exception-ok") | ||
//@ skip if $architecture != "arm64" && $architecture != "x86_64" | ||
//@ skip | ||
//FIXME: this test is currently broken. | ||
import { instantiate } from "../wabt-wrapper.js" | ||
import * as assert from "../assert.js" | ||
|
||
let wat = ` | ||
(module | ||
(func (export "test") (;0;) | ||
(local v128) | ||
loop (result v128) ;; label = @1 | ||
br 0 (;@1;) | ||
end | ||
local.set 0 | ||
) | ||
) | ||
` | ||
|
||
async function test() { | ||
const instance = await instantiate(wat, {}, { simd: true }) | ||
const { test } = instance.exports | ||
|
||
for (let i = 0; i < 10000; ++i) { | ||
test() | ||
} | ||
} | ||
|
||
assert.asyncTest(test()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.