Closed Bug 1656226 Opened 2 months ago Closed 2 months ago

Support experimental wasm SIMD opcodes supported by LLVM+V8


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




81 Branch
Tracking Status
firefox81 --- fixed


(Reporter: lth, Assigned: lth)




(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: (pmax/pmin) (rounding) (dot product) (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:

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
Implement the experimental opcodes.  r=jseward
Pushed by
Implement the experimental opcodes.  r=jseward
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch
You need to log in before you can comment on or make changes to this bug.