Mmx Instructions Essay

306 Words2 Pages
|Taimur Hassan |March 19 | | |2012 | |01-133092-218, BCE-6(A) |ACA Assignment: 3 | 3D games: computations that manipulate 3D objects use 4-by-4 matrices that are multiplied with 4-element vectors many times. Each vector has the X,Y, Z and perspective corrective information for each pixel. The 4-by-4 matrix is used to rotate, scale, translate and update the perspective corrective information for each pixel. Use the MMX instructions to demonstrate the advantage as a ratio [pic] Use the article on MMX technology to prove the following: Solution: MMX technology added 57 new instructions on x86 architecture and allow SIMD operations on 64 bit registers. In 3D games, 3D graphics are achieved by vector dot product between matrices and vectors i.e. each 3D object is manipulated by 4x4 matrices that is multiplied by 4 element vectors. In the given example, we have vector with 4 elements: x, y, z, 1 which is multiplied by the 4x4 matrix. [pic] x’=a0*x+a1*y+a2*z+a3 y’=b0*x+b1*y+b2*z+b3 z’=c0*x+c1*y+c2*z+c3 w’=d0*x+d1*y+d2*z+d3 There will be four PMADD (Packed Word Multiply-Add) MMX instructions (calculated above) needed with MMX technology for all rows while without MMX instruction, 16 instructions of MULTIPLY and 12 instructions of ADD were needed. The chart below shows the number of instruction execution required with / without MMX instructions. [pic] (Chart of Number of instructions without / with MMX Technology) So there is a significant difference if we use MMX technology. The ratio of advantage will be
Open Document