Altivec

From Applepedia

Jump to: navigation, search

Contents

What is Altivec?

The Velocity Engine, embodied in the G4 and G5 processors, expands the current PowerPC architecture through addition of a 128-bit vector execution unit that operates concurrently with existing integer and floating-point units. This provides for highly parallel operations, allowing for simultaneous execution of up to 16 operations in a single clock cycle. This new approach expands the processor's capabilities to concurrently address high-bandwidth data processing (such as streaming video) and the algorithmic intensive computations which today are handled off-chip by other devices, such as graphics, audio, and modem functions.The AltiVec instruction set allows operation on multiple bits within the 128-bit wide registers. This combination of new instructions, operation in parallel on multiple bits, and wider registers, provide speed enhancements of up to 30x on operations that are common in media processing.[1]

Links

Introduction

Apple's Documents



Tutorials

Reference

Papers

Articles

High Level APIs Already In OS X

Using Apple's high level Accelerate.Framework APIs are recommended to ensure portability to OS X - x86, as Altivec instructions will not execute even on Rosetta!

  • vDSP: A collection of digital signal processing functions such as FFTs, convolutions and squares. It uses the vector engine when available and certain criteria are met on G4 equipped computers, and it uses the scalar unit on G3 equipped computers. vDSP also provides basic vector and matrix operations. vDSP is x86 compatible.
  • vImage: Image processing functions, fast as hell.
  • BLAS: Basic Linear Algebra Subprograms with vector, matrix, and scalar functions.
  • LAPACK: LAPACK provides routines for solving systems of simultaneous linear equations, least-squares solutions of linear systems of equations, eigenvalue problems, and singular value problems. The associated matrix factorizations (LU, Cholesky, QR, SVD, Schur, generalized Schur) are also provided, as are related computations such as reordering of the Schur factorizations and estimating condition numbers. Dense and banded matrices are handled, but not general sparse matrices. In all areas, similar functionality is provided for real and complex matrices, in both single and double precision.

Other Libraries

  • LibMotoVec Freescale's Altivec libraries
  • LibFreeVec (In development) Vectorized replacements for a tiny amount of standard C library functions
  • zlib-altivec Vectorized replacement for zlib, 25% speed increase
  • macstl (In development) Vectorized replacement for C++ STL

Examples and Samples

  • Velocity Engine FFT
  • Velocity Engine Wavelet
  • Xcode Programming Examples
  • vDSP Examples
  • vBLAS Samples
  • Basic Vectorized Algorithms
  • Vector Math Library: Apple provides source for vMathLib for educational purposes. If you intend to use this code in your application, it is suggested that you use the routines in vecLib.framework instead. They are likely to be more optimized and more correct. The Accelerate.framework version also include x86 versions.
  • Basic Algebraic Operations: Apple provides source for vBasicOps for educational purposes. If you intend to use this code in your application, it is suggested that you use the routines in vecLib.framework instead. They are likely to be more optimized.
  • Vector Big Number Library: Apple provides source for the vBigNum library for educational purposes. If you intend to use this code in your application, it is suggested that you use the routines in vecLib.framework instead. They are likely to be more optimized.

Community

Personal tools