BIGMATH::SIMD is a portable header-only zero-overhead C++ low level SIMD library. The library presents a single interface over SIMD instruction sets present in x86, ARM, PowerPC and MIPS architectures. On architectures that support different SIMD instruction sets the library allows the same source code files to be compiled for each SIMD instruction set and then hooked into an internal or third-party dynamic dispatch mechanism. This allows the capabilities of the processor to be queried on runtime and the most efficient implementation to be selected.
The library sits somewhere in the middle between programming directly in SIMD intrinsics and even higher-level SIMD libraries. As much control as possible is given to the developer, so that it's possible to exactly predict what code the compiler will generate.
Online documentation is provided here.
The library supports the following architectures and instruction sets:
- x86, x86-64: SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, SSE4a, AVX, AVX2, FMA3, FMA4, AVX512F, AVX512BW, AVX512DQ, AVX512VL, XOP, popcnt
- ARM 32-bit: NEON, NEONv2
- ARM 64-bit: NEON, NEONv2
- PowerPC 32-bit big-endian: Altivec, VSX v2.06, VSX v2.07
- PowerPC 64-bit little-endian: Altivec, VSX v2.06, VSX v2.07
- MIPS 32-bit little-endian: MSA
- MIPS 64-bit little-endian: MSA
Supported compilers:
- C++11 version:
- GCC: 4.8-7.x
- Clang: 3.3-4.0
- Xcode 7.0-9.x
- MSVC: 2013, 2015, 2017
- ICC (on both Linux and Windows): 2013, 2015, 2016, 2017
Various compiler versions are not supported on various instruction sets due to compiler bugs or incompletely implemented instruction sets. See simd/detail/workarounds.h for more details.
-
MSVC and ICC are only supported on x86 and x86-64.
-
AVX is not supported on Clang 3.6 or GCC 4.4
-
AVX2 is not supported on Clang 3.6.
-
AVX512F is not supported on:
- GCC 5.x and older
- Clang 5.0 and older
- MSVC
-
NEON armv7 is not supported on Clang 3.3 and older.
-
NEON aarch64 is not supported on GCC 4.8 and older
-
Altivec on little-endian PPC is not suppported on GCC 5.x and older.
-
VSX on big-endian PPC is not supported on GCC 5.x and older.
-
MSA is not supported on GCC 6.x and older.
Contributions are welcome. Please see CONTRIBUTING for more information.
Copyright (C) 2016-2018 BIGMATH CORPORATION, All Rights Reserved.
@Author: Simon Zhang on 19 Oct 2018
@EMail: [email protected]
@Version: $SIMD_LIB_VERSION
These source codes are subject to the terms and conditions defined in 'LICENSE' on behalf of AGPL 3.0, which is part of this source code package. Write to [email protected] for more authorization requirements, or obtain an entire copy of license agreement at http://bigmath.com/license.
Permission is hereby granted, free of charge, to permitted person or organization obtaining a copy of the software and accompanying documentation covered by this license (the "Software") to use, reproduce, display, distribute, execute, and transmit the Software, and to prepare derivative works of the Software, and to permit third-parties to whom the Software is furnished to do so, all subject to the following:
The copyright notices in the Software and this entire statement, including the above license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software, unless such copies or derivative works are solely in the form of machine-executable object code generated by a source language processor.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.