Closed Bug 1478632 Opened 6 years ago Closed 4 years ago

Implement wasm SIMD for x64 baseline

Categories

(Core :: JavaScript: WebAssembly, task, P3)

task

Tracking

()

RESOLVED FIXED
mozilla78
Tracking Status
firefox63 --- wontfix
firefox78 --- fixed

People

(Reporter: bbouvier, Assigned: lth)

References

(Blocks 1 open bug)

Details

Attachments

(11 files, 3 obsolete files)

47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
149.44 KB, application/gzip
Details
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
Current spec lives there at the moment: https://github.com/webassembly/simd
Depends on: 1064540
Depends on: 1074102
Depends on: 1532927

These are all the non-compilation, non-verification, non-parsing bits:
type and constant definitions, opcode dispatch, classification, etc.
There's a fair amount of fallout from adding a new V128 type but
within reason.

For the time being, use MIRType::Int8x16 as the MIRType for all SIMD
values. This only shows up in a couple of places in this patch,
notably where we convert Scalar to MIRType, and we can change it
easily.

Depends on D22295

Attachment #9048835 - Attachment description: Bug 1478632 - Fundamental SIMD support → Bug 1478632 - Fundamental SIMD support WIP

Depends on D22296

Type: enhancement → task
Priority: -- → P3
Assignee: nobody → lhansen
Status: NEW → ASSIGNED

Depends on D57940

Depends on D57942

Depends on: 1607440
Attachment #9117186 - Attachment description: Bug 1478632 - wasm simd, part 3: opcodes + rabaldr → Bug 1478632 - wasm simd, part 3: opcodes and validator
Attachment #9117187 - Attachment description: Bug 1478632 - wasm simd, part 4: text->binary WIP → Bug 1478632 - wasm simd, part 4: text->binary
Depends on: 1608791
Depends on: 1609381
Keywords: meta
Summary: [meta] Implement the WebAssembly SIMD proposal → Implement the WebAssembly SIMD proposal
Attachment #9048835 - Attachment is obsolete: true
Attachment #9052853 - Attachment is obsolete: true

Taking a dependency on compiler gating, since SIMD will be not-ion and we'll need a way to fall back from Ion to baseline if we go straight to Ion compilation.

Depends on: 1566427
Depends on: 1610770
Attachment #9117184 - Attachment description: Bug 1478632 - wasm simd, part 1: feature gating → Bug 1478632 - wasm simd, part 1: feature gating and related prep
Attachment #9119817 - Attachment description: Bug 1478632 - wasm simd, part 6: baseline compiler and x64 support, WIP → Bug 1478632 - wasm simd, part 7: baseline compiler and x64 support, WIP

Rebased; dead i64<->f64 opcodes removed; new integer abs opcodes added (as stubs).

Rebased; updated to new gating logic; working on remaining operations.

Depends on: 1624258
Attachment #9117187 - Attachment is obsolete: true

All operations have been implemented. In the process of cleaning up the porting APIs, and adding missing run-time support. The work has been re-scoped: x64 only, SSE4.1 required, no AVX support required or expected.

Blocks: wasm-simd
No longer depends on: 1074102, 1609381, 1610770, 1624258
Summary: Implement the WebAssembly SIMD proposal → Implement wasm SIMD for x64 baseline
Depends on: 1625660
Attachment #9119383 - Attachment description: Bug 1478632 - wasm simd, part 5: test cases for the validator → Bug 1478632 - wasm simd, part 4: test cases for the validator
Attachment #9122672 - Attachment description: Bug 1478632 - wasm simd, part 6: extract porting interfaces and x86 impls → Bug 1478632 - wasm simd, part 5: extract porting interfaces and x86 impls
Attachment #9119817 - Attachment description: Bug 1478632 - wasm simd, part 7: baseline compiler and x64 support, WIP → Bug 1478632 - wasm simd, part 6: baseline compiler and x64 support
Depends on: 1626170
Attachment #9122672 - Attachment description: Bug 1478632 - wasm simd, part 5: extract porting interfaces and x86 impls → Bug 1478632 - wasm simd, part 5a: extract porting interfaces and x86 impls
Attachment #9136858 - Attachment description: Bug 1478632 - wasm simd, part 7: JS API tests + bug fixes, WIP → Bug 1478632 - wasm simd, part 7: functional test cases
Attachment #9117184 - Attachment description: Bug 1478632 - wasm simd, part 1: feature gating and related prep → Bug 1478632 - wasm simd, part 1: feature gating and related prep. r?rhunt
Attachment #9117185 - Attachment description: Bug 1478632 - wasm simd, part 2: the v128 type → Bug 1478632 - wasm simd, part 2: the v128 type. r?rhunt
Attachment #9117186 - Attachment description: Bug 1478632 - wasm simd, part 3: opcodes and validator → Bug 1478632 - wasm simd, part 3: opcodes and validator. r?rhunt
Attachment #9119383 - Attachment description: Bug 1478632 - wasm simd, part 4: test cases for the validator → Bug 1478632 - wasm simd, part 4: test cases for the validator. r?rhunt
Attachment #9122672 - Attachment description: Bug 1478632 - wasm simd, part 5a: extract porting interfaces and x86 impls → Bug 1478632 - wasm simd, part 5a: extract porting interfaces and x86/x64 impls. r?bbouvier
Attachment #9137744 - Attachment description: Bug 1478632 - wasm simd, part 5b: new porting interfaces and assembler work → Bug 1478632 - wasm simd, part 5b: new porting interfaces and x86/x64 assembler work. r?bbouvier
Attachment #9119817 - Attachment description: Bug 1478632 - wasm simd, part 6: baseline compiler and x64 support → Bug 1478632 - wasm simd, part 6: baseline compiler support. r?jseward
Attachment #9136858 - Attachment description: Bug 1478632 - wasm simd, part 7: functional test cases → Bug 1478632 - wasm simd, part 7: functional test cases. r?rhunt
Attached file simd_tests.tar.gz

JS versions of the test cases in the SIMD spec, translated using the script at https://github.com/lars-t-hansen/run_wast.

Patches updated this morning with misc fixes.

Current state of patches:

  • all currently spec'd instructions are implemented
  • code passes all our own tests and almost all the non-NaN-generating SIMD spec tests
  • there is a known (as-yet undiagnosed) bug in i8x16.shr_s, uncovered by the SIMD spec tests
  • the NaN-generating spec tests are not failing per se, they're just currently excluded by the test translator until equality testing can be got right

Also:

  • There is some remaining work around proper #ifdeffery (to make sure we don't pay for SIMD when it's not enabled, esp on x86-32) and some related vetting of register saving / restoring, this will affect mainly part 1.
  • We may want to import the spec tests in their non-canonically translated state as a new part 8, since the canonical import is not currently possible (no interpreter support in the SIMD repo).

For other things, see the SIMD worksheet (google doc).

Depends on D68853

Depends on: 1630359
Blocks: 1631228

Patches rebased and updated with review comments, only some detailed cleanup remaining.

Attachment #9117184 - Attachment description: Bug 1478632 - wasm simd, part 1: feature gating and related prep. r?rhunt → Bug 1478632 - wasm simd, part 1: feature gating and related prep. r=rhunt
Attachment #9117185 - Attachment description: Bug 1478632 - wasm simd, part 2: the v128 type. r?rhunt → Bug 1478632 - wasm simd, part 2: the v128 type. r=rhunt
Attachment #9117186 - Attachment description: Bug 1478632 - wasm simd, part 3: opcodes and validator. r?rhunt → Bug 1478632 - wasm simd, part 3: opcodes and validator. r=rhunt
Attachment #9119383 - Attachment description: Bug 1478632 - wasm simd, part 4: test cases for the validator. r?rhunt → Bug 1478632 - wasm simd, part 4: test cases for the validator. r=rhunt
Attachment #9122672 - Attachment description: Bug 1478632 - wasm simd, part 5a: extract porting interfaces and x86/x64 impls. r?bbouvier → Bug 1478632 - wasm simd, part 5a: extract porting interfaces and x86/x64 impls. r=bbouvier
Attachment #9137744 - Attachment description: Bug 1478632 - wasm simd, part 5b: new porting interfaces and x86/x64 assembler work. r?bbouvier → Bug 1478632 - wasm simd, part 5b: new porting interfaces and x86/x64 assembler work. r=bbouvier
Attachment #9119817 - Attachment description: Bug 1478632 - wasm simd, part 6: baseline compiler support. r?jseward → Bug 1478632 - wasm simd, part 6: baseline compiler support. r=jseward
Attachment #9136858 - Attachment description: Bug 1478632 - wasm simd, part 7: functional test cases. r?rhunt → Bug 1478632 - wasm simd, part 7: functional test cases. r=rhunt
Attachment #9140700 - Attachment description: Bug 1478632 - wasm simd, part 8: spec test cases. r?rhunt → Bug 1478632 - wasm simd, part 8: spec test cases. r=rhunt
Attachment #9143590 - Attachment description: Bug 1478632 - wasm simd, part 9: shell switches. r?bbouvier → Bug 1478632 - wasm simd, part 9: shell switches. r=bbouvier

Patch set is complete, testing is finished, try run is green. Will rebase daily until after the freeze and then land.

Blocks: 1635091
Pushed by lhansen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b48f9d171983
wasm simd, part 1: feature gating and related prep. r=rhunt
https://hg.mozilla.org/integration/autoland/rev/dede8f837d1d
wasm simd, part 2: the v128 type.  r=rhunt
https://hg.mozilla.org/integration/autoland/rev/6d61cc7132d6
wasm simd, part 3: opcodes and validator.  r=rhunt
https://hg.mozilla.org/integration/autoland/rev/fbe341549522
wasm simd, part 4: test cases for the validator. r=rhunt
https://hg.mozilla.org/integration/autoland/rev/5e3c6893e69f
wasm simd, part 5a: extract porting interfaces and x86/x64 impls. r=bbouvier
https://hg.mozilla.org/integration/autoland/rev/deb81ad6bfc2
wasm simd, part 5b: new porting interfaces and x86/x64 assembler work.  r=bbouvier
https://hg.mozilla.org/integration/autoland/rev/587a9c21cec1
wasm simd, part 6: baseline compiler support.  r=jseward
https://hg.mozilla.org/integration/autoland/rev/a95567deaf98
wasm simd, part 7: functional test cases.  r=rhunt
https://hg.mozilla.org/integration/autoland/rev/0f3e454359c9
wasm simd, part 8: spec test cases.  r=rhunt
https://hg.mozilla.org/integration/autoland/rev/643507d65bdd
wasm simd, part 9: shell switches.  r=bbouvier
Blocks: 1637328
Blocks: 1637506
Regressions: 1653977
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: