Skip to content
Steven Munroe edited this page May 31, 2024 · 22 revisions

Welcome to the pveclib wiki!

This is the landing page for the POWER Vector Library (pveclib for short).

Full source is available from: https://github.com/open-power-sdk/pveclib.git

A library of useful vector functions for POWER. This library fills in the gap between the instructions defined in the POWER Instruction Set Architecture (PowerISA) and higher level library APIs. The intent is to improve the productivity of application developers who need to optimize their applications or dependent libraries for POWER.

Rationale

The C/C++ language compilers (that support PowerISA) may implement vector intrinsic functions (compiler built-ins as embodied by altivec.h). These vector intrinsics offer an alternative to assembler programming, but do little to reduce the complexity of the underlying PowerISA. Higher level vector intrinsic operations are needed to improve productivity and encourage developers to optimize their applications for PowerISA. Another key goal is to smooth over the complexity of the evolving PowerISA and compiler support.

POWER Vector Library Goals

Obviously many useful operations can be constructed from existing PowerISA operations and GCC <altivec.h> built-ins but the implementation may not be obvious. The optimum sequence will vary across the PowerISA levels as new instructions are added. And finally the compiler's built-in support for new PowerISA instructions evolves with the compiler's release cycle.

So the goal of this project is to provide well crafted implementations of useful vector and large number operations.

  • Provide equivalent functions across versions of the PowerISA. This includes some of the most useful vector instructions added to POWER9 (PowerISA 3.0B). Many of these operations can be implemented as inline function in a few vector instructions on earlier PowerISA versions.
  • Provide equivalent functions across versions of the compiler. For example built-ins provided in later versions of the compiler can be implemented as inline functions with inline asm in earlier compiler versions.
  • Provide complete arithmetic operations across supported C types. For example multiply modulo and even/odd for char, short, int, long, and __int128. Another example inline versions for POSIX floating-point classification (isinf, isnan, isfininte, ...) functions across float, double, and __float128.
  • Provide complete extended arithmetic (carry / extend / multiple high) operations across supported C types. For example add / subtract with carry and extend for int, long, and __int128.
  • Provide higher order functions not provided directly by the PowerISA. For example vector SIMD implementation for ASCII __isalpha, etc. As another example full __int128 implementations of Count Leading Zeros, Population Count, Shift left/right immediate, and integer divide (or multiplicative inverse).
  • Such implementations should be small enough to inline and allow the compiler opportunity to apply common optimization techniques.
  • Larger Implementations should be built into platform specific object archives and dynamic shared objects. Shared objects should use IFUNC resolvers to bind the dynamic symbol to best implementation for the platform Putting the Library into PVECLIB

Current status

Tagged v1.0.3 for release. This version is included as package in Fedora 31.

  • Operations Implemented: 386
  • POWER9 Specific cases: 112
  • POWER8 Specific cases: 112
  • GCC version specific cases: 59
  • Endian Specific cases: 87

Includes updates for vector BCD arithmetic and conversions. Also vector quadword divide/modulo by 1031 and 1032.

Tagged v1.0.4 Release.

  • Operations Implemented: 452
  • Runtime library Symbols: 14
  • POWER9 Specific cases: 122
  • POWER8 Specific cases: 119
  • GCC version specific cases: 63
  • Clang specific cases: 26
  • Endian Specific cases: 121

This version adds run-time libraries for large order multiplies (512x512, 1024x1024, and 2048x2048) with interfaces defined in vec_int512_ppc.h. These library support static linkage to platform specific implementations using platform suffixes (ie vec_mul2048x4048_PWR9) and dynamic linkage with IFUNC platform binding (simply vec_mul2048x4048).

Work in progress.

  • Operations Implemented: 679
  • Runtime library Symbols: 36
  • POWER10 Specific cases: 91
  • POWER9 Specific cases: 191
  • POWER8 Specific cases: 171
  • GCC version specific cases: 281
  • Clang specific cases: 43
  • Endian Specific cases: 150

Updates so far include; New POWER10 instruction support including new quadword operations, Word/Doubleword scatter/gather implementations for float and integer type, Additional _Float128 support for POWER10/9/8.

The active documentation can be found here: POWER Vector Library Manual HTML and POWER Vector Library Manual PDF This is the temporary home until we get to official 1.0.4 documentation under open-power-sdk/pveclib.github.io.

Clone this wiki locally