© Jo Van Hoey 2019
J. Van HoeyBeginning x64 Assembly Programminghttps://doi.org/10.1007/978-1-4842-5076-1_37

37. Matrix Transpose

Jo Van Hoey1 
(1)
Hamme, Belgium
 

Let’s do one last matrix operation that is useful: transposing. We have coded two versions, one using unpacking and one using shuffling.

Example Transposing Code

Listing 37-1 shows the code.
; transpose4x4.asm
extern printf
section .data
      fmt0   db      "4x4 DOUBLE PRECISION FLOATING POINT MATRIX TRANSPOSE",10,0
      fmt1   db      10,"This is the matrix:",10,0
      fmt2   db      10,"This is the transpose (unpack):",10,0
      fmt3   db      10,"This is the transpose (shuffle):",10,0
      align  32
      matrix dq       1.,     2.,     3.,     4.
             dq       5.,     6.,     7.,     8. ...

Get Beginning x64 Assembly Programming: From Novice to AVX Professional now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.