freevec.org

  • about
  • benchmarks
Home › Algorithms › Algebra

Search

Primary links

  • About
    • History of libfreevec
  • Benchmarks
    • libfreevec

Please donate to libfreevec to ensure its continuing development! Donations are done via Paypal.





Matrix operations

Inverse of Matrix 4x4 using partitioning

markos — Fri, 18/04/2008 - 17:31

We tackle the 4x4 matrix inversion using the matrix partitioning method, as described in the "Numerical Recipes in C" book (2nd ed., though I guess it will be similar in the 3rd edition). Using the AltiVec SIMD unit, we achieve almost 300% increase in performance, making the routine the fastest -at least known to us, matrix inversion method!

  • AltiVec
  • Matrix operations
  • simdX86
  • Login or register to post comments
  • Read more
  • 1 attachment

Matrix 4x4 Translation of a vector

markos — Sat, 01/03/2008 - 20:56

Getting the translation matrix of a vector is essential to do movements of a vector in 3D space.

For the theory behind translation matrices please see [url=http://en.wikipedia.org/wiki/Translation_(geometry)]here[/url].

  • AltiVec
  • Matrix operations
  • simdX86
  • Login or register to post comments
  • Read more

Matrix 4x4 Identity matrix

markos — Sat, 01/03/2008 - 20:54

The nice thing about the identity matrix, is that we don't have to do any reading of the matrix. And since the form of the identity matrix is already known:

  • AltiVec
  • Matrix operations
  • simdX86
  • Login or register to post comments
  • Read more

Matrix 4x4 Multiply with Vector (floats)

markos — Sat, 01/03/2008 - 20:45

(Please see Matrix 4x4 addition/subtraction (floats) for the typedefs and definitions used.)

void Mat44MulVec(Vec3f vout, Mat44 mat, Vec4f vin)
{
        vector float vm_1, vm_2, vm_3, vm_4,
                     vec, vec_1, vec_2, vec_3, 
                     vr, vr_1, vr_2, vr_3, v0;
 
        // Load matrix and vector
        LOAD_ALIGNED_MATRIX(mat, vm_1, vm_2, vm_3, vm_4);
        LOAD_ALIGNED_VECTOR(vec, vin);
 
        v0 = (vector float) vec_splat_u32(0);
        vec = vec_ld(0, (float *)vec);
        vec_1 = vec_splat(vec, 0);
        vec_2 = vec_splat(vec, 1);
        vec_3 = vec_splat(ve0, 2);
 
        // Do the vector x matrix multiplication
        vr_1 = vec_madd(vm_1, vec_1, v0);
        vr_2 = vec_madd(vm_2, vec_2, vr_1);
        vr_3 = vec_madd(vm_3, vec_3, vr_2);
        vr   = vec_add(vr_3, vm_4);
 
        // Store back the result
        STORE_ALIGNED_VECTOR(vr, vout);
}

  • AltiVec
  • Matrix operations
  • simdX86
  • Login or register to post comments

Matrix 4x4 Transpose (floats)

markos — Sat, 01/03/2008 - 20:13

For the theory behind matrix transposition, please see here.

So, the 4x4 transpose would be:

  • AltiVec
  • Matrix operations
  • simdX86
  • Login or register to post comments
  • Read more
  • 1
  • 2
  • next ›
  • last »
Syndicate content

SIMD

  • Algorithms (31)
    • Algebra (9)
      • Matrix operations (8)
    • Bit operations (0)
    • Codecs (0)
      • Audio (0)
      • Video (0)
    • Comparison (0)
      • image comparison (0)
      • Levenshtein (0)
    • Compression (0)
      • Bzip2 (0)
      • Gzip (0)
      • LZMA (0)
      • LZW (0)
      • Squashfs (0)
      • Zlib (0)
    • Encryption (0)
      • AES (0)
      • DES (0)
      • RSA (0)
      • Salsa (0)
      • SSL (0)
    • Hashing (1)
      • CRC (0)
      • TCP/IP checksum (0)
      • UMAC (0)
    • Memory operations (15)
    • Multiprecision (0)
    • Searching (5)
      • String searching (5)
    • Sorting (0)
  • Software (32)
    • Benchmarking (2)
    • Libraries (30)
      • Eigen2 (0)
      • libfreevec (22)
      • simdX86 (8)
  • Architecture (32)
    • AltiVec (32)
    • ARM NEON (0)
    • CELL SPU (0)
    • SSE (0)
    • VIS (0)

User login

  • Create new account
  • Request new password
  • about
  • benchmarks

Copyright (c)2008 by CODEX.
Powered by Drupal. Using theme Deco.
All Google charts have been created by the CSV Chart and Chart API Drupal modules.