Subversion Repositories Kolibri OS

Rev

Rev 8666 | Rev 9237 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8666 Rev 8719
Line 196... Line 196...
196
ret
196
ret
197
;----------------------- in: ------------------------------
197
;----------------------- in: ------------------------------
198
;---------------------------- edi - pointer to vector -----
198
;---------------------------- edi - pointer to vector -----
199
;----------------------- out : none
199
;----------------------- out : none
200
normalize_vector:
200
normalize_vector:
201
if Ext = SSE2 | Ext = SSE | Ext = SSE3
-
 
202
        movups  xmm0,[edi]
-
 
203
        andps   xmm0,[zero_hgst_dd]
-
 
204
        movups  xmm1,xmm0
-
 
205
        mulps   xmm0,xmm0
-
 
206
        movhlps xmm2,xmm0
-
 
207
        addps   xmm0,xmm2
-
 
208
        movaps  xmm2,xmm0
-
 
209
        shufps  xmm2,xmm2,11100001b
-
 
210
        addps   xmm0,xmm2
-
 
211
        shufps  xmm0,xmm0,0
-
 
212
        rsqrtps xmm0,xmm0
-
 
213
        mulps   xmm0,xmm1
-
 
214
        movlps  [edi],xmm0
-
 
215
        movhlps xmm0,xmm0
-
 
216
        movss   [edi+8],xmm0
-
 
217
end if
-
 
218
if 0 ; Ext >= SSE3
201
if Ext >= SSE3
219
        movups  xmm0,[edi]
202
        movups  xmm0,[edi]
220
        andps   xmm0,[zero_hgst_dd]
203
        andps   xmm0,[zero_hgst_dd]
221
        movups  xmm1,xmm0
204
        movups  xmm1,xmm0
222
        mulps   xmm0,xmm0
205
        mulps   xmm0,xmm0
223
        haddps  xmm0,xmm0
206
        haddps  xmm0,xmm0
Line 225... Line 208...
225
        rsqrtps xmm0,xmm0
208
        rsqrtps xmm0,xmm0
226
        mulps   xmm0,xmm1
209
        mulps   xmm0,xmm1
227
        movlps  [edi],xmm0
210
        movlps  [edi],xmm0
228
        movhlps xmm0,xmm0
211
        movhlps xmm0,xmm0
229
        movss   [edi+8],xmm0
212
        movss   [edi+8],xmm0
230
end if
213
else
231
if Ext < SSE
-
 
Line 232... Line 214...
232
 
214
 
233
        fninit
215
        fninit
234
        fld     dword [edi+vec_x]
216
        fld     dword [edi+vec_x]
235
        fmul    st, st
217
        fmul    st, st