Skip to content
Steven Munroe edited this page Jul 17, 2020 · 2 revisions

Welcome to the pveclib.github.io 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.

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.

Development continues for v1.0.4.

  • Operations Implemented: 414
  • POWER9 Specific cases: 114
  • POWER8 Specific cases: 116
  • GCC version specific cases: 59
  • Endian Specific cases: 130

This version adds run-time libraries for large order multiplies (512x512, 1024x1024, and 2048x2048) with interfaces defined invec_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).

The active documentation can be found here: POWER Vector Library Manual and POWER Vector Library Manual PDF This is the home of the official 1.0.4 release.

Clone this wiki locally