This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Prototype i8x16.popcnt
ClosedPublic

Authored by tlively on Oct 14 2020, 8:39 PM.

Details

Summary

As proposed at https://github.com/WebAssembly/simd/pull/379. Use a target
builtin and intrinsic rather than normal codegen patterns to make the
instruction opt-in until it is merged to the proposal and stabilized in engines.

Diff Detail

Event Timeline

tlively created this revision.Oct 14 2020, 8:39 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptOct 14 2020, 8:39 PM
tlively requested review of this revision.Oct 14 2020, 8:39 PM
aheejin accepted this revision.Oct 15 2020, 4:46 AM
aheejin added inline comments.
clang/include/clang/Basic/BuiltinsWebAssembly.def
117
  • Even if there's only one vector type for a builtin, it seems others still have type postfix attached.
  • Is the result also a vector? Does that mean this instruction count each 16 slot separately?
This revision is now accepted and ready to land.Oct 15 2020, 4:46 AM
tlively updated this revision to Diff 298457.Oct 15 2020, 1:53 PM
  • Update builtin function name
tlively marked an inline comment as done.Oct 15 2020, 1:54 PM
tlively added inline comments.
clang/include/clang/Basic/BuiltinsWebAssembly.def
117

Yes, the it does a popcnt on each 1-byte lane individually.

This revision was landed with ongoing or failed builds.Oct 15 2020, 2:18 PM
This revision was automatically updated to reflect the committed changes.
tlively marked an inline comment as done.