Advertisement
Ember

ssemul

Nov 26th, 2015
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.84 KB | None | 0 0
  1. // Splat x, y, z and w
  2. Vector vX = Permute<0, 0, 0, 0>(vector);
  3. Vector vY = Permute<1, 1, 1, 1>(vector);
  4. Vector vZ = Permute<2, 2, 2, 2>(vector);
  5. Vector vW = Permute<3, 3, 3, 3>(vector);
  6. // Mul by the matrix
  7. vX = _mm_mul_ps(vX, matrix[0]);
  8. vY = _mm_mul_ps(vY, matrix[1]);
  9. vZ = _mm_mul_ps(vZ, matrix[2]);
  10. vW = _mm_mul_ps(vW, matrix[3]);
  11. // Add them all together
  12. vX = _mm_add_ps(vX, vY);
  13. vZ = _mm_add_ps(vZ, vW);
  14. vX = _mm_add_ps(vX, vZ);
  15. return vX;
  16.  
  17. // COMPILES INTO //
  18.  
  19. shufps      xmm2,xmm4,0FFh
  20. mulps       xmm2,xmmword ptr [rbp+90h]
  21. shufps      xmm0,xmm4,0AAh
  22. shufps      xmm1,xmm4,55h
  23. mulps       xmm0,xmmword ptr [rbp+80h]
  24. mulps       xmm1,xmmword ptr [rbp+70h]
  25. shufps      xmm3,xmm3,0
  26. addps       xmm2,xmm0
  27. mulps       xmm3,xmmword ptr [rbp+60h]
  28. addps       xmm1,xmm3
  29. addps       xmm2,xmm1
  30. movaps      xmmword ptr [rbp-70h],xmm2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement