Closed Bug 1656226 Opened 4 years ago Closed 4 years ago

Support experimental wasm SIMD opcodes supported by LLVM+V8

Categories

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

x86_64
All
enhancement

Tracking

()

RESOLVED FIXED
81 Branch
Tracking Status
firefox81 --- fixed

People

(Reporter: lth, Assigned: lth)

References

Details

Attachments

(1 file)

Experimental opcodes that are supported by both LLVM (as __builtin type functions) and by V8 are worth supporting since it allows us and others to test our implementation on experimental content created for Chrome.

There are a number of instructions supported in varying degree by LLVM, Binaryen, and V8, and they have a varying likelihood of making it into the spec. For example, QFMA is supported by all three but is unlikely to make it into the spec because its results are platform-dependent.

The instruction groups that are likely to make it are:

  • pmax / pmin
  • rounding instructions
  • integer widening dot product (pairwise multiply i16x8 and sum adjacent products into a single i32x4)
  • load lane zero and zero extend

The patch will therefore provide these. Additional instructions may be added later.

Implement some of the experimental SIMD opcodes that are supported by
all of V8, LLVM, and Binaryen, for maximum compatibility with test
content we might be exposed to. Most/all of these will probably make
it into the spec, as they lead to substantial speedups in some
programs, and they are deterministic.

For spec and cpu mapping details, see:

https://github.com/WebAssembly/simd/pull/122 (pmax/pmin)
https://github.com/WebAssembly/simd/pull/232 (rounding)
https://github.com/WebAssembly/simd/pull/127 (dot product)
https://github.com/WebAssembly/simd/pull/237 (load zero)

The wasm bytecode values used here come from the binaryen changes that
are linked from those tickets, that's the best documentation right
now. Current binaryen opcode mappings are here:
https://github.com/WebAssembly/binaryen/blob/master/src/wasm-binary.h

Also: Drive-by fix for signatures of vroundss and vroundsd, these are
unary operations and should follow the conventions for these with
src/dest arguments, not src0/src1/dest.

Also: Drive-by fix to add variants of vmovss and vmovdd on x64 that
take Operand source and FloatRegister destination.

Depends on D85981

Pushed by lhansen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2e7ddb00c8f9 Implement the experimental opcodes. r=jseward
Pushed by lhansen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2d73a015caaa Implement the experimental opcodes. r=jseward
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: