Skip to content
Portable C++ SIMD library
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
utils
.gitignore Initial commit Nov 1, 2017
BUILD.bazel
CONTRIBUTING.md
LICENSE
README.md
WORKSPACE
clang_integration_test.cc Rebase Dimsum onto the libcxx P0214 implementation. Apr 10, 2018
dimsum.h
dimsum_fuzz.cc
dimsum_test.cc Rebase Dimsum onto the libcxx P0214 implementation. Apr 10, 2018
dimsum_x86.h
dimsum_x86_test.cc Rebase Dimsum onto the libcxx P0214 implementation. Apr 10, 2018
index_sequence.h Initial commit Nov 1, 2017
operations.h
port.h Rebase Dimsum onto the libcxx P0214 implementation. Apr 10, 2018
simd
simd_avx.h
simd_neon.h Rebase Dimsum onto the libcxx P0214 implementation. Apr 10, 2018
simd_sse.h Rebase Dimsum onto the libcxx P0214 implementation. Apr 10, 2018
simd_vsx.h Rebase Dimsum onto the libcxx P0214 implementation. Apr 10, 2018
simulated.h
test.sh Rebase Dimsum onto the libcxx P0214 implementation. Apr 10, 2018
types.h Rebase Dimsum onto the libcxx P0214 implementation. Apr 10, 2018

README.md

This is not an official Google product.

Background

Dimsum is a portable C++ SIMD library, that is heavily influenced by the C++ standard library proposal P0214. Currently, the library does not implement P0214, but its ultimate state is a standard conforming implementation.

During the implementation, we examined all the differences our our intended interfaces and P0214, and provided a feedback proposal P0820.

Due to prioritization, Dimsum does not currently implement the following list of features from P0214, including but not limited to:

  • simd_mask<>
  • simd_abi::fixed_size<>
  • simd_abi::compatible<>
  • Non-power-of-two sizes
  • SIMD version of <cmath>

Dimsum provides an extra set of opreations, mostly as free functions in the namespace "dimsum" and namespace "dimsum::x86". The extra operations in "dimsum" include many "horizontal" operations like shuffle, zip, and reduce-add; the extra operations in "x86" provides some x86-specific semantics, with native implementations on x86 and emulations on other architectures.

Documentation

Refer to standard proposals for designs and public interfaces.

For the implementation, all the public interfaces should be documented in comments.

Status

The above mentioned proposals are not part of the standard yet, nor is this implementation fully conforming to the proposals. Any part of the API is subject to change, without providing a fixing tool.

Some functionalities are with strawman implementations, with non-optimal performance, due to prioritization.

Requirements

Build system:

  • Bazel

Compiler:

  • Clang 3.8 or newer

The following sub-architectures are planed to be supported:

  • x86 SSE 4.1 or newer
  • x86 AVX2
  • Power v2.07 VSX

We are also interested in supporting the following toolchain and architectures in the future:

  • (WIP) GCC 4.9 or newer
  • (WIP) ARMv8 NEON (64-bit)

Build and Test

The project is header-only, therefore no build is needed.

For testing, use "CC=clang bazel test --copt='...' <>" to run the unit tests.

For example:

  • CC=clang bazel test --copt='-msse4.1' ... # x86 host
  • CC=clang bazel test --copt='-mavx2' ... # x86 host
  • CC=clang bazel test --copt='-maltivec' ... # Power host

Cross compilation is a bit tricky, but we found the following working, as long as the toolchains support cross compilation:

  • CC=clang bazel build --copt='-target' --copt='powerpc64le-linux-gnu' --copt='-maltivec' --linkopt='-target' --linkopt='powerpc64le-linux-gnu' ... # x86 host

Fuzzing

Link dimsum_fuzz against fuzz engines like libFuzzer, then run the result binary.

(TODO) Add it to OSS-Fuzz

You can’t perform that action at this time.