Rev 8014 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8014 | Rev 8232 | ||
---|---|---|---|
Line 9... | Line 9... | ||
9 | ;----------------------in: -------------------------------- |
9 | ;----------------------in: -------------------------------- |
10 | ;------------------------ esi - pointer to 1st 3d point --- |
10 | ;------------------------ esi - pointer to 1st 3d point --- |
11 | ;------------------------ edi - pointer to 2nd 3d point --- |
11 | ;------------------------ edi - pointer to 2nd 3d point --- |
12 | ;------------------------ ebx - pointer to result vector -- |
12 | ;------------------------ ebx - pointer to result vector -- |
13 | ;---------------------- out : none ------------------------ |
13 | ;---------------------- out : none ------------------------ |
14 | if 0 |
- | |
15 | make_vector: |
- | |
16 | fninit |
- | |
17 | fild word[edi+x3d] ;edi+x3d |
- | |
18 | fisub word[esi+x3d] ;esi+x3d |
- | |
19 | fstp dword[ebx+vec_x] |
- | |
20 | - | ||
21 | fild word[edi+y3d] |
- | |
22 | fisub word[esi+y3d] |
- | |
23 | fstp dword[ebx+vec_y] |
- | |
24 | - | ||
25 | fild word[edi+z3d] |
- | |
26 | fisub word[esi+z3d] |
- | |
27 | fstp dword[ebx+vec_z] |
- | |
28 | - | ||
29 | ret |
- | |
30 | end if |
- | |
31 | reverse_mx_3x3: |
14 | reverse_mx_3x3: |
32 | ; esi - source matrix |
15 | ; esi - source matrix |
33 | ; edi - desired reversed matrix |
16 | ; edi - desired reversed matrix |
Line 34... | Line 17... | ||
34 | 17 | ||
Line 213... | Line 196... | ||
213 | ret |
196 | ret |
214 | ;----------------------- in: ------------------------------ |
197 | ;----------------------- in: ------------------------------ |
215 | ;---------------------------- edi - pointer to vector ----- |
198 | ;---------------------------- edi - pointer to vector ----- |
216 | ;----------------------- out : none |
199 | ;----------------------- out : none |
217 | normalize_vector: |
200 | normalize_vector: |
- | 201 | if Ext >= SSE3 |
|
- | 202 | movups xmm0,[edi] |
|
- | 203 | andps xmm0,[zero_hgst_dd] |
|
- | 204 | movups xmm1,xmm0 |
|
- | 205 | mulps xmm0,xmm0 |
|
- | 206 | haddps xmm0,xmm0 |
|
- | 207 | haddps xmm0,xmm0 |
|
- | 208 | rsqrtps xmm0,xmm0 |
|
- | 209 | mulps xmm0,xmm1 |
|
- | 210 | movlps [edi],xmm0 |
|
- | 211 | movhlps xmm0,xmm0 |
|
- | 212 | movss [edi+8],xmm0 |
|
- | 213 | else |
|
- | 214 | ||
218 | fninit |
215 | fninit |
219 | fld dword [edi+vec_x] |
216 | fld dword [edi+vec_x] |
220 | fmul st, st |
217 | fmul st, st |
221 | fld dword [edi+vec_y] |
218 | fld dword [edi+vec_y] |
222 | fmul st, st |
219 | fmul st, st |
Line 242... | Line 239... | ||
242 | fstp dword [edi+vec_x] |
239 | fstp dword [edi+vec_x] |
243 | fdivr dword [edi+vec_y] |
240 | fdivr dword [edi+vec_y] |
244 | fstp dword [edi+vec_y] |
241 | fstp dword [edi+vec_y] |
245 | fdivr dword [edi+vec_z] |
242 | fdivr dword [edi+vec_z] |
246 | fstp dword [edi+vec_z] |
243 | fstp dword [edi+vec_z] |
- | 244 | end if |
|
247 | ret |
245 | ret |
248 | ;------------------in: ------------------------- |
246 | ;------------------in: ------------------------- |
249 | ;------------------ esi - pointer to 1st vector |
247 | ;------------------ esi - pointer to 1st vector |
250 | ;------------------ edi - pointer to 2nd vector |
248 | ;------------------ edi - pointer to 2nd vector |
251 | ;------------------out: ------------------------ |
249 | ;------------------out: ------------------------ |
252 | ;------------------ st0 - dot-product |
250 | ;------------------ st0 - dot-product |
253 | dot_product: |
251 | dot_product: |
254 | fninit |
252 | fninit |
- | 253 | ;if Ext >=SSE3 |
|
- | 254 | ; movups xmm0,[esi] |
|
- | 255 | ; movups xmm1,[edi] |
|
- | 256 | ; andps xmm0,[zero_hgst_dd] |
|
- | 257 | ; mulps xmm0,xmm1 |
|
- | 258 | ; haddps xmm0,xmm0 |
|
- | 259 | ; haddps xmm0,xmm0 |
|
- | 260 | ; movss [esp-4],xmm0 |
|
- | 261 | ; fld dword[esp-4] |
|
- | 262 | ;else |
|
255 | fld dword [esi+vec_x] |
263 | fld dword [esi+vec_x] |
256 | fmul dword [edi+vec_x] |
264 | fmul dword [edi+vec_x] |
257 | fld dword [esi+vec_y] |
265 | fld dword [esi+vec_y] |
258 | fmul dword [edi+vec_y] |
266 | fmul dword [edi+vec_y] |
259 | fld dword [esi+vec_z] |
267 | fld dword [esi+vec_z] |
260 | fmul dword [edi+vec_z] |
268 | fmul dword [edi+vec_z] |
261 | faddp |
269 | faddp |
262 | faddp |
270 | faddp |
- | 271 | ;end if |
|
263 | ret |
272 | ret |
Line 264... | Line 273... | ||
264 | 273 | ||
265 | ; DOS version Coded by Mikolaj Felix aka Majuma |
274 | ; DOS version Coded by Mikolaj Felix aka Majuma |
266 | ; mfelix@polbox.com |
275 | ; mfelix@polbox.com |