Advertisement
Guest User

Untitled

a guest
Oct 7th, 2012
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. mov eax, 6
  2. movd xmm5, eax
  3. pshufd xmm5, xmm5, 0
  4. cvtpi2ps xmm5, xmm5     ;xmm5 == 6.0
  5. mov eax, 15
  6. movd xmm6, eax
  7. pshufd xmm6, xmm6, 0
  8. cvtpi2ps xmm6, xmm6     ;xmm6 == 15.0
  9. mov eax, 10
  10. movd xmm7, eax
  11. pshufd xmm7, xmm7, 0
  12. cvtpi2ps xmm7, xmm7     ;xmm7 == 10.0
  13.  
  14. lea ecx, [result]
  15. mov eax, dword [sx]
  16. mul dword [sy]
  17. loop_top:
  18.     movaps xmm1, qword [x + ecx]
  19.    
  20.     movaps xmm2, xmm1 ;start out with t
  21.     mulps xmm2, xmm5  ;multiply by 6
  22.     subps xmm2, xmm6  ;subtract 15
  23.     mulps xmm2, xmm1  ;multiply by t
  24.     addps xmm2, xmm7  ;add 10
  25.     mulps xmm2, xmm1
  26.     mulps xmm2, xmm1
  27.     mulps xmm2, xmm1  ;multiply by t^3
  28.    
  29.     movaps xmm0, qword [x0y0 + ecx]
  30.     movaps xmm1, qword [x1y0 + ecx]
  31.     subps xmm1, xmm0
  32.     mulps xmm1, xmm2
  33.     addps xmm0, xmm1     ;xmm0 = u
  34.  
  35.     movaps xmm4, qword [x0y1 + ecx]
  36.     movaps xmm1, qword [x1y1 + ecx]
  37.     subps xmm1, xmm4
  38.     mulps xmm1, xmm2
  39.     addps xmm4, xmm1     ;xmm4 = v
  40.  
  41.     movaps xmm1, qword [y + ecx]
  42.    
  43.     movaps xmm2, xmm1
  44.     mulps xmm2, xmm5
  45.     subps xmm2, xmm6
  46.     mulps xmm2, xmm1
  47.     addps xmm2, xmm7
  48.     mulps xmm2, xmm1
  49.     mulps xmm2, xmm1
  50.     mulps xmm2, xmm1  ;xmm2 = ty
  51.     subps xmm4, xmm0
  52.     mulps xmm4, xmm2
  53.     addps xmm0, xmm4
  54.    
  55.     movaps qword [result + ecx], xmm0
  56.     add ecx, 10h
  57. dec eax
  58. jne loop_top
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement