This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Prototype extending multiplication SIMD instructions
ClosedPublic

Authored by tlively on Oct 27 2020, 10:48 AM.

Details

Summary

As proposed in https://github.com/WebAssembly/simd/pull/376. This commit
implements new builtin functions and intrinsics for these instructions, but does
not yet add them to wasm_simd128.h because they have not yet been merged to the
proposal. The opcodes used in this commit are those used in V8 rather than those in the proposal. However, in anticipation of switching to the proposed opcodes at some point, this commit updates the MC layer and disassembler to handle opcodes greater than 0xff correctly.

Diff Detail

Event Timeline

tlively created this revision.Oct 27 2020, 10:48 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptOct 27 2020, 10:48 AM
tlively requested review of this revision.Oct 27 2020, 10:48 AM
tlively edited the summary of this revision. (Show Details)Oct 27 2020, 5:37 PM
aheejin accepted this revision.Oct 28 2020, 4:01 AM
aheejin added inline comments.
llvm/include/llvm/IR/IntrinsicsWebAssembly.td
263

It seems there is one already?

llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCCodeEmitter.cpp
72

encodeULEB128 isn't capable of encoding numbers larger than or equal to 256?

This revision is now accepted and ready to land.Oct 28 2020, 4:01 AM
tlively added inline comments.Oct 28 2020, 9:34 AM
llvm/include/llvm/IR/IntrinsicsWebAssembly.td
263

Ah, I was confused and thought that one did the opposite of what I needed. Thanks!

llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCCodeEmitter.cpp
72

It is capable of encoding any uint64_t value. Large values need extra logic because the prefix byte (which is not part of the LEB128) is in a different location.

This revision was landed with ongoing or failed builds.Oct 28 2020, 9:39 AM
This revision was automatically updated to reflect the committed changes.