Difference between revisions of "Power ISA/Vector Operations"

From RCS Wiki
Jump to navigation Jump to search
(→‎Github / Gitlab pages: Fix capitalization)
 
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The Power Architecture ISA includes a specification of vector or SIMD operations. Prior to the Power ISA, i.e. PowerPC, some of these operations were available, but defined in an external standard, called Altivec by Freescale (Motorola spin-off), Vector Multimedia Extension (VMX) by IBM, and Velocity Engine by Apple.
+
The [[Power ISA]] includes a specification of vector or SIMD operations. Prior to the Power ISA, i.e. PowerPC, some of these operations were available, but defined in an external standard, called Altivec by Freescale (Motorola spin-off), Vector Multimedia Extension (VMX) by IBM, and Velocity Engine by Apple.
  
 
The Vector operations are classified as Vector Facility and Vector Scalar Extension (VSX) in current versions of the Power ISA.
 
The Vector operations are classified as Vector Facility and Vector Scalar Extension (VSX) in current versions of the Power ISA.
Line 8: Line 8:
  
 
According to [[File:POWER9-Features-and-Specifications.pdf]] page 7, the Vector Scalar Unit (VSU)'s 128-bit hardware is dedicated per super-slice (2 threads).  This may indicate that trying to aggressively use 128-bit VSX instructions in two threads that use the same super-slice will be inefficient.  It is possible that clever usage of <code>taskset</code> may improve this situation.
 
According to [[File:POWER9-Features-and-Specifications.pdf]] page 7, the Vector Scalar Unit (VSU)'s 128-bit hardware is dedicated per super-slice (2 threads).  This may indicate that trying to aggressively use 128-bit VSX instructions in two threads that use the same super-slice will be inefficient.  It is possible that clever usage of <code>taskset</code> may improve this situation.
 +
 +
Power ISA v3.1 adds an optional VSX extension, MMA (Matrix-Multiply Assist), targeted at matrix math applications.
  
 
== External Links ==
 
== External Links ==
Line 13: Line 15:
 
* Seebach, Peter. [https://web.archive.org/web/20080614023936/https://www.ibm.com/developerworks/library/pa-unrollav1/ Unrolling AltiVec, Part 1, Introducing the PowerPC SIMD unit]. Published March 01, 2005
 
* Seebach, Peter. [https://web.archive.org/web/20080614023936/https://www.ibm.com/developerworks/library/pa-unrollav1/ Unrolling AltiVec, Part 1, Introducing the PowerPC SIMD unit]. Published March 01, 2005
 
* Seebach, Peter. [https://www.sucs.org/~grepwood/ps3/altivec/pa-unrollav2-pdf.pdf Unrolling AltiVec, Part 2, Optimize code for SIMD processing]. Published March 16, 2005
 
* Seebach, Peter. [https://www.sucs.org/~grepwood/ps3/altivec/pa-unrollav2-pdf.pdf Unrolling AltiVec, Part 2, Optimize code for SIMD processing]. Published March 16, 2005
* Gschwind, Michael. [https://www.researchgate.net/publication/299472451_Workload_acceleration_with_the_IBM_POWER_vector-scalar_architecture Workload acceleration with the IBM POWER vector-scalar architecture]. IBM Journal of Research and Development. Published March, 2016
+
* Gschwind, Michael. [https://www.researchgate.net/publication/299472451_Workload_acceleration_with_the_IBM_POWER_vector-scalar_architecture Workload acceleration with the IBM POWER vector-scalar architecture]. Published March, 2016
 
* Clarke, Paul. [https://www.ibm.com/support/pages/vectorizing-fun-and-performance Vectorizing for fun and performance]. Published January 24, 2018
 
* Clarke, Paul. [https://www.ibm.com/support/pages/vectorizing-fun-and-performance Vectorizing for fun and performance]. Published January 24, 2018
 
* OpenPOWER. [https://openpowerfoundation.org/specifications/vectorintrinsicportingguide/ Vector Intrinsics Porting Guide]. Published March 13, 2018
 
* OpenPOWER. [https://openpowerfoundation.org/specifications/vectorintrinsicportingguide/ Vector Intrinsics Porting Guide]. Published March 13, 2018
Line 20: Line 22:
 
* Ruzhu Chen. [https://developer.ibm.com/learningpaths/port-your-app-to-lop/migrate-app-on-lop/ Linux on IBM Power Systems application porting and tuning guide]. Published September 27, 2020
 
* Ruzhu Chen. [https://developer.ibm.com/learningpaths/port-your-app-to-lop/migrate-app-on-lop/ Linux on IBM Power Systems application porting and tuning guide]. Published September 27, 2020
 
* OpenPOWER. [https://openpowerfoundation.org/compliance/vectorintrinsicprogrammingreference/ Vector Intrinsic Programming Reference Compliance Specification]. Published March 28, 2021
 
* OpenPOWER. [https://openpowerfoundation.org/compliance/vectorintrinsicprogrammingreference/ Vector Intrinsic Programming Reference Compliance Specification]. Published March 28, 2021
 +
* José E. Moreira. [https://arxiv.org/abs/2104.03142 A matrix math facility for Power ISA(TM) processors]. Published April 7, 2021
 +
* José E. Moreira. [https://www.redbooks.ibm.com/Redbooks.nsf/RedpieceAbstracts/redp5612.html Matrix-Multiply Assist Best Practices Guide]. Published April 15, 2021
 +
* Sridhar Venkat. [https://community.ibm.com/community/user/powerdeveloper/blogs/sridhar-venkat1/2022/08/29/power10-mma MMA in IBM Power10 processor]. Published August 29, 2022
 +
* VectorCamp. [https://simd.info/ SIMD.info], an online searchable reference tool for C intrinsics of all major SIMD engines (including VSX).
 +
* VectorCamp. [https://simd.ai/ Advanced SIMD Porting Intelligence]. LLM that helps optimize and port code to SIMD architectures in seconds.
  
== Github pages ==
+
== GitHub / GitLab pages ==
 
 
[https://github.com/ermig1979/Simd C++ image processing and machine learning library with using of SIMD]
 
 
 
[https://github.com/simd-everywhere/simde Implementations of SIMD instruction sets for systems which don't natively support them]
 
 
 
[https://github.com/jfalcou/eve Expressive Vector Engine - SIMD in C++]
 
  
[https://github.com/VectorChief/UniSIMD-assembler SIMD macro assembler unified for ARM, MIPS, PPC and x86]
+
=== Translation from other architectures ===
  
[https://github.com/powturbo/Turbo-Base64 Turbo Base64 - Fastest Base64 SIMD:SSE/AVX2/AVX512/Neon/Altivec]
+
Implementations of non-POWER instruction sets for POWER.
  
[https://github.com/berenger-eu/inastemp Intrinsics as template - is a basic library to use vectorization easily in C++]
+
* [https://github.com/gcc-mirror/gcc/blob/master/gcc/config/rs6000 GCC]. x86 to VSX.
 +
* [https://github.com/llvm/llvm-project/tree/main/clang/lib/Headers/ppc_wrappers Clang]. x86 to VSX.
 +
* [https://github.com/simd-everywhere/simde SIMD Everywhere]. x86/ARM/WASM to VSX (and other arches).
  
[https://github.com/p12tic/libsimdpp Portable header-only C++ low level SIMD library]
+
=== SIMD libraries and frameworks ===
  
[https://github.com/open-power-sdk/pveclib Power Vector Library]
+
* Eigen. [https://gitlab.com/libeigen/eigen A C++ template library for linear algebra: matrices, vectors, numerical solvers and related algorithms]
 +
* EVE - the Expressive Vector Engine. [https://github.com/jfalcou/eve SIMD in C++]
 +
* Highway. [https://github.com/google/highway C++ library that provides portable SIMD/vector intrinsics]
 +
* Simd Library. [https://github.com/ermig1979/Simd C++ image processing and machine learning library with using of SIMD]
 +
* pveclib. [https://github.com/open-power-sdk/pveclib Power Vector Library]
 +
* UniSIMD Assembler. [https://github.com/VectorChief/UniSIMD-assembler SIMD macro assembler unified for ARM, MIPS, PPC and x86]
 +
* libsimdpp. [https://github.com/p12tic/libsimdpp Portable header-only C++ low level SIMD library]
 +
* inastemp. [https://gitlab.inria.fr/bramas/inastemp Intrinsics as template - is a basic library to use vectorization easily in C++]
  
[https://github.com/shibatch/sleef SIMD Library for Evaluating Elementary Functions, vectorized libm and DFT]
+
=== Specialized implementations ===
  
[https://github.com/VectorCamp/libfreevec SIMD optimized C library]
+
* simdutf. [https://github.com/simdutf/simdutf C++ library for fast Unicode transcoding using SIMD]
 +
* libjpeg-turbo. [https://github.com/libjpeg-turbo/libjpeg-turbo A JPEG image codec that uses SIMD instructions to accelerate baseline JPEG compression and decompression]
 +
* Vectorscan. [https://github.com/VectorCamp/vectorscan A portable fork of the high-performance regular expression matching library]
 +
* SLEEF. [https://github.com/shibatch/sleef SIMD Library for Evaluating Elementary Functions, vectorized libm and DFT]
 +
* Turbo Base64. [https://github.com/powturbo/Turbo-Base64 Fastest Base64 SIMD:SSE/AVX2/AVX512/Neon/Altivec]
 +
* Camellia cipher. [https://github.com/jkivilin/camellia-simd-aesni SIMD vector implementations ... for POWER (with VMX+VSX+crypto instructions)]
 +
* libvpx. [https://github.com/lu-zero/libvpx Video codec library with specific optimizations for ppc64le]
 +
* lamevmx. [https://github.com/classilla/lamevmx Altivec optimized MP3 encoder]
 +
* libfreevec. [https://github.com/VectorCamp/libfreevec SIMD optimized GNU C library]

Latest revision as of 15:12, 1 July 2025

The Power ISA includes a specification of vector or SIMD operations. Prior to the Power ISA, i.e. PowerPC, some of these operations were available, but defined in an external standard, called Altivec by Freescale (Motorola spin-off), Vector Multimedia Extension (VMX) by IBM, and Velocity Engine by Apple.

The Vector operations are classified as Vector Facility and Vector Scalar Extension (VSX) in current versions of the Power ISA.

Power ISA v2.07 still refers to some instructions as VMX in its summary of changes since the previous version, but the rest of the document avoids mentioning VMX completely.

Power ISA v3.0 no longer mentions VMX at all.

According to File:POWER9-Features-and-Specifications.pdf page 7, the Vector Scalar Unit (VSU)'s 128-bit hardware is dedicated per super-slice (2 threads). This may indicate that trying to aggressively use 128-bit VSX instructions in two threads that use the same super-slice will be inefficient. It is possible that clever usage of taskset may improve this situation.

Power ISA v3.1 adds an optional VSX extension, MMA (Matrix-Multiply Assist), targeted at matrix math applications.

External Links

GitHub / GitLab pages

Translation from other architectures

Implementations of non-POWER instruction sets for POWER.

SIMD libraries and frameworks

Specialized implementations