Subversion Repositories Kolibri OS

Rev

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

Rev 9237 Rev 9512
Line 23... Line 23...
23
;----------------------         pointer to texture------
23
;----------------------         pointer to texture------
24
;----------------------         texture coordinates-----
24
;----------------------         texture coordinates-----
25
;-- Z-buffer - filled with coordinates as dword --------
25
;-- Z-buffer - filled with coordinates as dword --------
26
;-- (Z coor. as word) shl CATMULL_SHIFT ----------------
26
;-- (Z coor. as word) shl CATMULL_SHIFT ----------------
27
.b_x1	equ ebp+4   ; procedure don't save registers !!!
27
 
-
 
28
 
-
 
29
 
-
 
30
.t_y1   equ ebp+4   ; procedure don't save registers !!!
28
.b_y1	equ ebp+6   ; each coordinate as word
31
.t_x1   equ ebp+6   ; each coordinate as word
29
.b_x2	equ ebp+8
32
.e_y1   equ ebp+8              ; texture coords
-
 
33
.e_x1   equ ebp+10
-
 
34
.b_y1   equ ebp+12
-
 
35
.b_x1   equ ebp+14
30
.b_y2	equ ebp+10	 ; b - bump map coords
36
 
-
 
37
 
-
 
38
 
-
 
39
.t_y2   equ ebp+16
-
 
40
.t_x2   equ ebp+18            ; b - bump map coords
31
.b_x3	equ ebp+12	 ; e - env map coords
41
.e_y2   equ ebp+20              ; texture coords
32
.b_y3	equ ebp+14
42
.e_x2   equ ebp+22
33
.e_x1	equ ebp+16
43
.b_y2   equ ebp+24
34
.e_y1	equ ebp+18
44
.b_x2   equ ebp+26
35
.e_x2	equ ebp+20
45
 
-
 
46
 
-
 
47
 
-
 
48
 
-
 
49
.t_y3   equ ebp+28              ; e - env map coords
-
 
50
.t_x3   equ ebp+30
36
.e_y2	equ ebp+22
51
.e_y3   equ ebp+32              ; texture coords
-
 
52
.e_x3   equ ebp+34
37
.e_x3	equ ebp+24
53
.b_y3   equ ebp+36
38
.e_y3	equ ebp+26
54
.b_x3   equ ebp+38
39
.z1	equ word[ebp+28]
55
 
-
 
56
.z1     equ word[ebp+40]
40
.z2	equ word[ebp+30]
57
.z2     equ word[ebp+42]
41
.z3	equ word[ebp+32]
58
.z3     equ word[ebp+44]
42
.z_buff equ dword[ebp+34]	; pointer to Z-buffer
59
.z_buff equ dword[ebp+46]       ; pointer to Z-buffer
43
.tex_ptr equ dword[ebp+38]	; ptr to texture
60
.tex_ptr equ dword[ebp+50]      ; ptr to texture
44
.t_x1	equ ebp+42		; texture coords
61
 
45
.t_y1	equ ebp+44
-
 
46
.t_x2	equ ebp+46
-
 
47
.t_y2	equ ebp+48
-
 
48
.t_x3	equ ebp+50
-
 
49
.t_y3	equ ebp+52
-
 
50
 
-
 
Line 51... Line 62...
51
 
62
 
52
 
63
 
Line 58... Line 69...
58
.y2	equ word[ebp-16]
69
.y2     equ word[ebp-16]
59
.x3	equ word[ebp-18]
70
.x3     equ word[ebp-18]
60
.y3	equ word[ebp-20]
71
.y3     equ word[ebp-20]
61
 
72
 
Line 62... Line -...
62
if 0 ;Ext <= SSE2
-
 
Line 63... Line -...
63
 
-
 
64
.dx12	equ dword[edi-4]
-
 
65
.dz12	equ	 [edi-8]
-
 
66
.dbx12	equ dword[edi-12]
-
 
67
.dby12	equ	 [edi-16]
-
 
68
.dex12	equ dword[edi-20]
-
 
69
.dey12	equ	 [edi-24]
-
 
70
.dtx12	equ dword[edi-28]
-
 
71
.dty12	equ	 [edi-32]
-
 
72
 
-
 
73
.dx13  equ dword[ebp-52-4*1]
-
 
74
.dz13  equ	[ebp-52-4*2]
-
 
75
.dbx13 equ dword[ebp-52-4*3]
-
 
76
.dby13 equ	[ebp-52-4*4]
-
 
77
.dex13 equ dword[ebp-52-4*5]
-
 
78
.dey13 equ	[ebp-52-4*6]
-
 
79
.dtx13 equ dword[ebp-52-4*7]
-
 
Line 80... Line -...
80
.dty13 equ	[ebp-52-4*8]
-
 
81
 
-
 
82
 
-
 
83
.dx23  equ dword[ebp-(52+4*9)]
-
 
84
.dz23  equ	[ebp-(52+4*10)]
-
 
85
.dbx23 equ dword[ebp-(52+4*11)]
-
 
86
.dby23 equ	[ebp-(52+4*12)]
-
 
87
.dex23 equ dword[ebp-(52+4*13)]
-
 
88
.dey23 equ	[ebp-(52+4*14)]
-
 
89
.dtx23 equ dword[ebp-(52+4*15)]
-
 
90
.dty23 equ	[ebp-(52+4*16)]
-
 
91
 
73
 
92
else
74
 
93
 
75
 
94
.dx12	equ dword[ebp-24]
76
.dx12   equ dword[ebp-24]
95
.dz12	equ	 [ebp-28]
77
.dz12   equ      [ebp-28]
Line 118... Line 100...
118
.dey23 equ	[ebp-(52+4*14)]
100
.dey23 equ      [ebp-(52+4*14)]
119
.dtx23 equ dword[ebp-(52+4*15)]
101
.dtx23 equ dword[ebp-(52+4*15)]
120
.dty23 equ	[ebp-(52+4*16)]
102
.dty23 equ      [ebp-(52+4*16)]
121
 
103
 
Line 122... Line -...
122
end if
-
 
123
 
-
 
124
if Ext < SSE
-
 
125
 
-
 
126
.cx1   equ dword[ebp-(52+4*17)] 	; current variables
-
 
127
.cz1   equ	[ebp-(52+4*18)]
-
 
128
.cx2   equ dword[ebp-(52+4*19)]
-
 
129
.cz2   equ	[ebp-(52+4*20)]
-
 
130
.cbx1  equ dword[ebp-(52+4*21)]
-
 
131
.cby1  equ	[ebp-(52+4*22)]
-
 
132
.cbx2  equ dword[ebp-(52+4*23)]
-
 
133
.cby2  equ	[ebp-(52+4*24)]
-
 
134
.cex1  equ dword[ebp-(52+4*25)]
-
 
135
.cey1  equ	[ebp-(52+4*26)]
-
 
136
.cex2  equ dword[ebp-(52+4*27)]
-
 
137
.cey2  equ	[ebp-(52+4*28)]
-
 
138
 
-
 
139
.ctx1  equ dword[ebp-(52+4*29)]
-
 
140
.cty1  equ	[ebp-(52+4*30)]
-
 
141
.ctx2  equ dword[ebp-(52+4*31)]
-
 
142
.cty2  equ	[ebp-(52+4*32)]
-
 
Line 143... Line -...
143
 
-
 
Line 144... Line 104...
144
else
104
 
145
 
105
 
146
.cx1   equ dword[ebp-(52+4*17)] 	; current variables
106
.cx1   equ dword[ebp-(52+4*17)]         ; current variables
147
.cz1   equ	[ebp-(52+4*18)]
107
.cz1   equ      [ebp-(52+4*18)]
Line 160... Line 120...
160
.cey2  equ	[ebp-(52+4*30)]
120
.cey2  equ      [ebp-(52+4*30)]
161
.ctx2  equ dword[ebp-(52+4*31)]
121
.ctx2  equ dword[ebp-(52+4*31)]
162
.cty2  equ	[ebp-(52+4*32)]
122
.cty2  equ      [ebp-(52+4*32)]
163
 
123
 
Line -... Line 124...
-
 
124
if Ext >+ MMX
-
 
125
       emms
164
end if
126
end if
-
 
127
 
165
       cld
128
       cld
166
       mov     ebp,esp
129
       mov     ebp,esp
167
       push    edx	  ; store bump map
130
       push    edx        ; store bump map
168
       push    esi	  ; store e. map
131
       push    esi        ; store e. map
169
     ; sub     esp,120
132
     ; sub     esp,120
170
 .sort3:		  ; sort triangle coordinates...
133
 .sort3:                  ; sort triangle coordinates...
171
       cmp     ax,bx
134
       cmp     ax,bx
172
       jle     .sort1
135
       jle     .sort1
173
       xchg    eax,ebx
136
       xchg    eax,ebx
-
 
137
   if Ext >= MMX
-
 
138
       movq    mm0,[.t_y1]
-
 
139
       movq    mm1,[.t_y2]
-
 
140
       movq    [.t_y1],mm1
-
 
141
       movq    [.t_y2],mm0
-
 
142
    end if
174
       mov     edx,dword[.b_x1]
143
       mov     edx,dword[.b_y1]
175
       xchg    edx,dword[.b_x2]
144
       xchg    edx,dword[.b_y2]
176
       mov     dword[.b_x1],edx
145
       mov     dword[.b_y1],edx
-
 
146
    if Ext = NON
177
       mov     edx,dword[.e_x1]
147
       mov     edx,dword[.e_y1]
178
       xchg    edx,dword[.e_x2]
148
       xchg    edx,dword[.e_y2]
179
       mov     dword[.e_x1],edx
149
       mov     dword[.e_y1],edx
180
       mov     edx,dword[.t_x1]
150
       mov     edx,dword[.t_y1]
181
       xchg    edx,dword[.t_x2]
151
       xchg    edx,dword[.t_y2]
182
       mov     dword[.t_x1],edx
152
       mov     dword[.t_y1],edx
-
 
153
    end if
183
       mov     dx,.z1
154
       mov     dx,.z1
184
       xchg    dx,.z2
155
       xchg    dx,.z2
185
       mov     .z1,dx
156
       mov     .z1,dx
186
 .sort1:
157
 .sort1:
187
       cmp	bx,cx
158
       cmp      bx,cx
188
       jle	.sort2
159
       jle      .sort2
189
       xchg	ebx,ecx
160
       xchg     ebx,ecx
-
 
161
     if Ext >= MMX
-
 
162
       movq    mm0,[.t_y3]
-
 
163
       movq    mm1,[.t_y2]
-
 
164
       movq    [.t_y3],mm1
-
 
165
       movq    [.t_y2],mm0
-
 
166
     end if
190
       mov	edx,dword[.b_x2]
167
       mov      edx,dword[.b_y2]
191
       xchg	edx,dword[.b_x3]
168
       xchg     edx,dword[.b_y3]
192
       mov	dword[.b_x2],edx
169
       mov      dword[.b_y2],edx
-
 
170
     if Ext = NON
193
       mov	edx,dword[.e_x2]
171
       mov      edx,dword[.e_y2]
194
       xchg	edx,dword[.e_x3]
172
       xchg     edx,dword[.e_y3]
195
       mov	dword[.e_x2],edx
173
       mov      dword[.e_y2],edx
196
       mov	edx,dword[.t_x2]
174
       mov      edx,dword[.t_y2]
197
       xchg	edx,dword[.t_x3]
175
       xchg     edx,dword[.t_y3]
198
       mov	dword[.t_x2],edx
176
       mov      dword[.t_y2],edx
-
 
177
     end if
199
       mov     dx,.z2
178
       mov     dx,.z2
200
       xchg    dx,.z3
179
       xchg    dx,.z3
201
       mov     .z2,dx
180
       mov     .z2,dx
202
       jmp	.sort3
181
       jmp      .sort3
203
 .sort2:
182
 .sort2:
Line 226... Line 205...
226
 
205
 
227
       mov	bx,.y2	     ; calc delta 12
206
       mov      bx,.y2       ; calc delta 12
228
       sub	bx,.y1
207
       sub      bx,.y1
229
       jnz	.bt_dx12_make
-
 
230
if 0 ;Ext >= SSE2
-
 
231
       pxor	xmm0,xmm0
-
 
232
       movups	.dty12,xmm0
-
 
233
       movups	.dey12,xmm0
-
 
234
       sub	esp,16
208
       jnz      .bt_dx12_make
235
else
209
 
236
       mov	ecx,8
210
       mov      ecx,8
237
       xor	edx,edx
211
       xor      edx,edx
238
     @@:
212
     @@:
239
       push	edx   ;dword 0
213
       push     edx
240
       loop	@b
214
       loop     @b
241
end if
215
 
242
       jmp	.bt_dx12_done
216
       jmp      .bt_dx12_done
243
 .bt_dx12_make:
217
 .bt_dx12_make:
-
 
218
       movsx    ebx,bx
-
 
219
if Ext >= SSE2
-
 
220
       mov      eax,1 shl 15
-
 
221
       cdq
-
 
222
       idiv     ebx
Line 244... Line -...
244
       movsx	ebx,bx
-
 
245
 
-
 
246
 
223
       mov      ebx,eax
247
if Ext>=SSE
224
 
248
       sub	 esp,32
-
 
249
   ;    mov       eax,256
-
 
250
       cvtsi2ss  xmm4,[i255d]
225
 
251
       cvtsi2ss  xmm3,ebx ;rcps
226
       mov      ax,.x2
252
if 0 ;Ext >= SSE2
227
       sub      ax,.x1
253
       mov	 edi,ebp
-
 
254
       sub	 edi,512
228
       cwde
255
       or	 edi,0x0000000f
-
 
Line 256... Line -...
256
end if
-
 
257
       divss	 xmm3,xmm4
-
 
258
       shufps	 xmm3,xmm3,0
-
 
259
 
-
 
260
       movd	 mm0,[.b_x1]
-
 
261
       movd	 mm1,[.b_x2]
-
 
262
       movd	 mm2,[.e_x1]
-
 
263
       movd	 mm3,[.e_x2]
-
 
264
 
-
 
265
       pxor	  mm4,mm4
-
 
266
       punpcklwd  mm0,mm4
-
 
267
       punpcklwd  mm1,mm4
-
 
268
       punpcklwd  mm2,mm4
-
 
269
       punpcklwd  mm3,mm4
-
 
270
 
-
 
271
       psubd	  mm1,mm0
-
 
272
       psubd	  mm3,mm2
-
 
273
 
-
 
274
       cvtpi2ps  xmm1,mm1
-
 
275
       movlhps	 xmm1,xmm1
-
 
276
       cvtpi2ps  xmm1,mm3
-
 
277
 
-
 
278
       divps	 xmm1,xmm3   ;xmm1--> | dby | dbx | dey | dex |
-
 
279
 
-
 
280
       shufps	 xmm1,xmm1,10110001b
-
 
281
			     ;xmm1--> | dbx | dby | dex | dey |
-
 
282
;1       movups    .dey12,xmm1
-
 
283
       cvtps2pi  mm0,xmm1 ;mm0,xmm1          ; mm0 -> 2 delta dwords
-
 
284
       movhlps	 xmm1,xmm1
-
 
285
       cvtps2pi  mm1,xmm1 ;mm1,xmm1
-
 
286
       movq	 .dey12,mm0
-
 
287
       movq	 .dby12,mm1
-
 
288
;-------------
-
 
289
  ;    pxor      mm0,mm0
-
 
290
  ;    pxor      mm1,mm1
-
 
291
   ;/   pinsrw    mm0,.z1,1
229
       imul     ebx
292
   ;/   pinsrw    mm0,.x1,0
230
       sar      eax,15 - ROUND
293
   ;/   pinsrw    mm1,.z2,1
231
       push     eax
-
 
232
 
-
 
233
       mov      ax,.z2
-
 
234
       sub      ax,.z1
Line 294... Line -...
294
   ;/   pinsrw    mm1,.x2,0
-
 
295
       mov	 ax,.z2
235
       cwde
296
       sub	 ax,.z1
-
 
297
       cwde
-
 
298
 
236
       imul     ebx
299
       mov	dx,.x2
-
 
300
       sub	dx,.x1
237
       sar      eax,15 - ROUND
301
       movsx	edx,dx
-
 
302
 
-
 
303
   ;/    movd      mm1,eax
-
 
304
 
238
       push     eax
305
   ;/    punpcklwd  mm0,mm4
-
 
306
   ;/    punpcklwd  mm1,mm4
-
 
307
 
-
 
308
  ;     cvtpi2ps   xmm1,mm1
-
 
309
  ;     cvtpi2ps   xmm2,mm0
239
 
310
  ;     subps      xmm1,xmm2
240
       sub       esp,4*6
311
 
-
 
312
   ;/   psubd      mm1,mm0
-
 
313
 
-
 
314
       movd	  mm2,[.t_x1]
241
       movd      xmm0,ebx
315
       movd	  mm3,[.t_x2]
-
 
316
 
-
 
317
       punpcklwd  mm2,mm4
-
 
318
       punpcklwd  mm3,mm4
242
       pshuflw   xmm0,xmm0,0
319
       psubd	  mm3,mm2
-
 
320
 
243
       movlhps   xmm0,xmm0
321
   ;/  cvtpi2ps  xmm1,mm1
-
 
322
       cvtsi2ss  xmm1,eax
244
       movdqu    xmm1,[.t_y1]
323
       movlhps	 xmm1,xmm1
-
 
324
       cvtsi2ss  xmm1,edx
-
 
325
   ;    movss     xmm1,xmm4
-
 
326
       shufps	 xmm1,xmm1,00101111b
-
 
327
       cvtpi2ps  xmm1,mm3
-
 
328
 
-
 
329
       divps	 xmm1,xmm3   ; xmm1--> | dx | dz | dty | dtx |
245
       movdqu    xmm2,[.t_y2]
330
 
-
 
331
       shufps	 xmm1,xmm1,11100001b
246
       psubw     xmm2,xmm1
332
			     ; xmm1--> | dx | dz | dtx | dty |
-
 
333
;1       movlps    .dty12,xmm1
-
 
334
;1       movhps    .dz12,xmm1
-
 
335
       cvtps2pi  mm0,xmm1    ; mm0 -> 2 delta dwords  | dtx | dty |
-
 
336
       movhlps	 xmm1,xmm1
-
 
337
       cvtps2pi  mm1,xmm1
-
 
338
       movq	 .dty12,mm0
-
 
339
       movq	 .dz12,mm1
-
 
340
;----
-
 
341
;       mov       ax,.z2
-
 
342
;       sub       ax,.z1
-
 
343
;       cwde
-
 
344
;       mov       bx,.x2
-
 
345
;       sub       bx,.x1
-
 
346
;       movsx     ebx,bx
-
 
347
;       movd      mm1,eax
-
 
348
;       psllq     mm1,32
-
 
349
;       movd      mm1,ebx
-
 
350
 
-
 
351
;;       push      ebx
-
 
352
;;       push      eax
-
 
353
;;       movq      mm1,[esp]
-
 
354
;;       add       esp,8
-
 
355
;;;       mov       ax,.z1
-
 
356
;;;       mov       bx,.z2
-
 
357
;;;       shl       eax,16
-
 
358
;;;       shl       ebx,16
-
 
359
;;;       mov       ax,.x1
-
 
360
;;;       mov       bx,.x2
-
 
361
;       movd       mm2,[.t_x1]
-
 
362
;       movd       mm3,[.t_x2]
-
 
363
;;       movd      mm0,eax
-
 
364
;;       movd      mm1,ebx
247
       movdqa    xmm3,xmm2
365
 
248
       pmullw    xmm2,xmm0
366
;       pxor       mm4,mm4
-
 
367
;;       punpcklwd  mm0,mm4
249
       pmulhw    xmm3,xmm0
368
;;       punpcklwd  mm1,mm4
250
       movhlps   xmm4,xmm2
369
;       punpcklwd  mm2,mm4
-
 
370
;       punpcklwd  mm3,mm4
-
 
371
 
-
 
372
;;       psubd    mm1,mm0
-
 
373
;       psubd      mm3,mm2
-
 
374
 
-
 
375
 
-
 
376
;       cvtpi2ps  xmm1,mm1
-
 
377
;       movlhps   xmm1,xmm1
-
 
378
;       cvtpi2ps  xmm1,mm3
-
 
379
 
-
 
380
;       divps     xmm1,xmm3   ; xmm1--> | dz | dx | dty | dtx |
-
 
381
 
-
 
382
;       shufps    xmm1,xmm1,10110001b
251
       movhlps   xmm5,xmm3
383
			     ; xmm1--> | dx | dz | dtx | dty |
252
       punpcklwd xmm2,xmm3
384
;       cvtps2pi  mm0,xmm1    ; mm0 -> 2 delta dwords  | dtx | dty |
253
       punpcklwd xmm4,xmm5
-
 
254
       psrad     xmm2,15 - ROUND
385
;       movhlps   xmm1,xmm1
255
       psrad     xmm4,15 - ROUND
386
;       cvtps2pi  mm1,xmm1    ; mm1 --> 2 delta dwords | dx | dz |
256
       movdqu    .dty12,xmm2
387
;       movq      .dty12,mm0
257
       movq      .dby12,xmm4
388
;       movq      .dz12,mm1
258
else
389
else
259
 
Line 471... Line 341...
471
       jmp	.bt_dx13_done
341
       jmp      .bt_dx13_done
472
 .bt_dx13_make:
342
 .bt_dx13_make:
473
       movsx	ebx,bx
343
       movsx    ebx,bx
474
 
344
 
Line 475... Line 345...
475
if Ext>=SSE
345
if Ext >= SSE2
-
 
346
       mov      eax,1 shl 15
-
 
347
       cdq
-
 
348
       idiv     ebx
-
 
349
       mov      ebx,eax
Line 476... Line -...
476
 
-
 
477
       sub	 esp,32
-
 
478
   ;    mov       eax,256
-
 
479
       cvtsi2ss  xmm4,[i255d]
-
 
480
       cvtsi2ss  xmm3,ebx	     ;rcps
-
 
481
       divss	 xmm3,xmm4
-
 
Line 482... Line -...
482
       shufps	 xmm3,xmm3,0
-
 
483
 
350
 
484
       movd	 mm0,[.b_x1]
351
 
485
       movd	 mm1,[.b_x3]
352
       mov      ax,.x3
486
       movd	 mm2,[.e_x1]
-
 
487
       movd	 mm3,[.e_x3]
353
       sub      ax,.x1
488
 
-
 
489
       pxor	  mm4,mm4
-
 
490
       punpcklwd  mm0,mm4
-
 
491
       punpcklwd  mm1,mm4
-
 
492
       punpcklwd  mm2,mm4
-
 
493
       punpcklwd  mm3,mm4
354
       cwde
494
 
355
       imul     ebx
495
       psubd	  mm1,mm0
-
 
496
       psubd	  mm3,mm2
-
 
497
 
-
 
498
       cvtpi2ps  xmm1,mm1
-
 
499
       movlhps	 xmm1,xmm1
-
 
500
       cvtpi2ps  xmm1,mm3
-
 
501
 
-
 
502
       divps	 xmm1,xmm3   ;xmm1--> | dby | dbx | dey | dex |
-
 
503
 
-
 
504
       shufps	 xmm1,xmm1,10110001b
356
       sar      eax,15 - ROUND
505
			     ;xmm1--> | dbx | dby | dex | dey |
-
 
506
;1       movups    .dey13,xmm1
-
 
507
 
-
 
508
       cvtps2pi  mm0,xmm1 ;mm0,xmm1          ; mm0 -> 2 delta dwords
-
 
509
       movhlps	 xmm1,xmm1
-
 
510
       cvtps2pi  mm1,xmm1 ;mm1,xmm1
-
 
Line 511... Line 357...
511
       movq	 .dey13,mm0
357
       push     eax
512
       movq	 .dby13,mm1
358
    ;   mov      .dx12,eax
513
 
359
 
-
 
360
       mov      ax,.z3
-
 
361
       sub      ax,.z1
-
 
362
       cwde
Line 514... Line 363...
514
       mov	 ax,.z3
363
       imul     ebx
515
       sub	 ax,.z1
364
       sar      eax,15 - ROUND
516
       cwde
365
       push     eax
517
 
-
 
518
       mov	dx,.x3
366
 
519
       sub	dx,.x1
367
       sub       esp,4*6
520
       movsx	edx,dx
-
 
521
 
368
       movd      xmm0,ebx
522
       movd	  mm2,[.t_x1]
369
       pshuflw   xmm0,xmm0,0
523
       movd	  mm3,[.t_x3]
370
       movlhps   xmm0,xmm0
524
 
-
 
525
       punpcklwd  mm2,mm4
371
       movdqu    xmm1,[.t_y1]
526
       punpcklwd  mm3,mm4
372
       movdqu    xmm2,[.t_y3]
527
       psubd	  mm3,mm2
373
       psubw     xmm2,xmm1
528
 
-
 
529
       cvtsi2ss  xmm1,eax
374
       movdqa    xmm3,xmm2
530
       movlhps	 xmm1,xmm1
-
 
531
       cvtsi2ss  xmm1,edx
-
 
532
       shufps	 xmm1,xmm1,00101111b
-
 
533
       cvtpi2ps  xmm1,mm3
-
 
534
 
-
 
535
       divps	 xmm1,xmm3   ; xmm1--> | dx | dz | dty | dtx |
375
       pmullw    xmm2,xmm0
536
 
376
       pmulhw    xmm3,xmm0
537
       shufps	 xmm1,xmm1,11100001b
-
 
538
			     ; xmm1--> | dx | dz | dtx | dty |
-
 
539
;1       movlps    .dty13,xmm1
377
       movhlps   xmm4,xmm2
540
;1       movhps    .dz13,xmm1
378
       movhlps   xmm5,xmm3
541
 
379
       punpcklwd xmm2,xmm3
542
       cvtps2pi  mm0,xmm1    ; mm0 -> 2 delta dwords  | dtx | dty |
380
       punpcklwd xmm4,xmm5
543
       movhlps	 xmm1,xmm1
-
 
544
       cvtps2pi  mm1,xmm1
381
       psrad     xmm2,15 - ROUND
Line 545... Line 382...
545
       movq	 .dty13,mm0
382
       psrad     xmm4,15 - ROUND
546
       movq	 .dz13,mm1
383
       movdqu    .dty13,xmm2
547
 
384
       movq      .dby13,xmm4
Line 632... Line 469...
632
       loop	@b
469
       loop     @b
633
       jmp	.bt_dx23_done
470
       jmp      .bt_dx23_done
634
 .bt_dx23_make:
471
 .bt_dx23_make:
635
       movsx	ebx,bx
472
       movsx    ebx,bx
636
 
473
if Ext >= SSE2
-
 
474
 
Line -... Line 475...
-
 
475
       mov      eax,1 shl 15
637
if Ext>=SSE
476
       cdq
-
 
477
       idiv     ebx
-
 
478
    ;   push     eax
-
 
479
       mov      ebx,eax
Line 638... Line -...
638
 
-
 
639
       sub	 esp,32
-
 
640
   ;    mov       eax,256
-
 
641
       cvtsi2ss  xmm4,[i255d]
-
 
642
       cvtsi2ss  xmm3,ebx	     ;rcps
-
 
643
       divss	 xmm3,xmm4
-
 
Line 644... Line -...
644
       shufps	 xmm3,xmm3,0
-
 
645
 
480
 
646
       movd	 mm0,[.b_x2]
481
 
647
       movd	 mm1,[.b_x3]
482
       mov      ax,.x3
648
       movd	 mm2,[.e_x2]
-
 
649
       movd	 mm3,[.e_x3]
483
       sub      ax,.x2
650
 
-
 
651
       pxor	  mm4,mm4
-
 
652
       punpcklwd  mm0,mm4
-
 
653
       punpcklwd  mm1,mm4
-
 
654
       punpcklwd  mm2,mm4
-
 
655
       punpcklwd  mm3,mm4
484
       cwde
656
 
485
       imul     ebx
657
       psubd	  mm1,mm0
-
 
658
       psubd	  mm3,mm2
-
 
659
 
-
 
660
       cvtpi2ps  xmm1,mm1
-
 
661
       movlhps	 xmm1,xmm1
-
 
662
       cvtpi2ps  xmm1,mm3
-
 
663
 
-
 
664
       divps	 xmm1,xmm3   ;xmm1--> | dby | dbx | dey | dex |
-
 
665
 
-
 
666
       shufps	 xmm1,xmm1,10110001b
486
       sar      eax,15 - ROUND
667
			     ;xmm1--> | dbx | dby | dex | dey |
-
 
668
;1       movups    .dey23,xmm1
-
 
669
 
-
 
670
       cvtps2pi  mm0,xmm1 ;mm0,xmm1          ; mm0 -> 2 delta dwords
-
 
671
       movhlps	 xmm1,xmm1
-
 
672
       cvtps2pi  mm1,xmm1 ;mm1,xmm1
-
 
Line 673... Line 487...
673
       movq	 .dey23,mm0
487
       push     eax
674
       movq	 .dby23,mm1
488
    ;   mov      .dx12,eax
675
 
489
 
-
 
490
       mov      ax,.z3
-
 
491
       sub      ax,.z2
-
 
492
       cwde
Line 676... Line 493...
676
       mov	 ax,.z3
493
       imul     ebx
677
       sub	 ax,.z2
494
       sar      eax,15 - ROUND
678
       cwde
495
       push     eax
679
 
-
 
680
       mov	dx,.x3
496
 
681
       sub	dx,.x2
497
       sub       esp,4*6
682
       movsx	edx,dx
-
 
683
 
498
       movd      xmm0,ebx
684
       movd	  mm2,[.t_x2]
499
       pshuflw   xmm0,xmm0,0
685
       movd	  mm3,[.t_x3]
500
       movlhps   xmm0,xmm0
686
 
-
 
687
       punpcklwd  mm2,mm4
501
       movdqu    xmm1,[.t_y2]
688
       punpcklwd  mm3,mm4
502
       movdqu    xmm2,[.t_y3]
689
       psubd	  mm3,mm2
503
       psubw     xmm2,xmm1
690
 
-
 
691
       cvtsi2ss  xmm1,eax
504
       movdqa    xmm3,xmm2
692
       movlhps	 xmm1,xmm1
-
 
693
       cvtsi2ss  xmm1,edx
-
 
694
       shufps	 xmm1,xmm1,00101111b
-
 
695
       cvtpi2ps  xmm1,mm3
505
       pmullw    xmm2,xmm0
696
 
-
 
697
       divps	 xmm1,xmm3   ; xmm1--> | dx | dz | dty | dtx |
506
       pmulhw    xmm3,xmm0
698
 
507
       movhlps   xmm4,xmm2
699
       shufps	 xmm1,xmm1,11100001b
-
 
700
			    ; xmm1--> | dx | dz | dtx | dty |
508
       movhlps   xmm5,xmm3
701
;       movlps    .dty23,xmm1
-
 
702
;       movhps    .dz23,xmm1
509
       punpcklwd xmm2,xmm3
703
       cvtps2pi  mm0,xmm1    ; mm0 -> 2 delta dwords  | dtx | dty |
510
       punpcklwd xmm4,xmm5
704
       movhlps	 xmm1,xmm1
-
 
705
       cvtps2pi  mm1,xmm1    ; mm1 --> 2 delta dwords | dx  |  dz |
-
 
706
       movq	 .dty23,mm0
511
       psrad     xmm2,15 - ROUND
707
       movq	 .dz23,mm1
512
       psrad     xmm4,15 - ROUND
708
 
513
       movdqu    .dty23,xmm2
709
 
514
       movq      .dby23,xmm4
710
else
515
else
Line 780... Line 585...
780
       idiv	ebx
585
       idiv     ebx
781
 ;     mov      .dty23,eax
586
 ;     mov      .dty23,eax
782
       push	 eax
587
       push      eax
783
end if
588
end if
784
      ;  sub     esp,40
589
 
785
   .bt_dx23_done:
-
 
-
 
590
 
-
 
591
   .bt_dx23_done:
786
       sub	 esp,64
592
 
-
 
593
       sub       esp,64
787
 
594
 
Line 788... Line 595...
788
       movsx	eax,.x1
595
       movsx    eax,.x1
789
       shl	eax,ROUND
596
       shl      eax,ROUND
790
       mov	.cx1,eax
597
       mov      .cx1,eax
Line 841... Line 648...
841
       mov	.cty2,edx
648
       mov      .cty2,edx
842
      ; push     edx
649
      ; push     edx
843
      ; push     edx
650
      ; push     edx
844
 
651
 
Line 845... Line 652...
845
if Ext >= SSE2
652
if 0 ;Ext >= SSE2
846
       movups  xmm0,.cby1
653
       movups  xmm0,.cby1
847
       movups  xmm1,.cty1
654
       movups  xmm1,.cty1
848
       movups  xmm2,.cby2
655
       movups  xmm2,.cby2
849
       movups  xmm3,.cty2
656
       movups  xmm3,.cty2
850
       movups  xmm4,.dby13
657
       movups  xmm4,.dby13
851
       movups  xmm5,.dty13
658
       movups  xmm5,.dty13
852
       movups  xmm6,.dby12
659
       movups  xmm6,.dby12
853
       movups  xmm7,.dty12
660
       movups  xmm7,.dty12
854
       .scby1  equ [edi]
661
  ;     .scby1  equ [edi]
855
       .scty1  equ [edi+16]
662
  ;     .scty1  equ [edi+16]
856
       .scby2  equ [edi+32]
663
  ;     .scby2  equ [edi+32]
857
       .scty2  equ [edi+48]
664
  ;     .scty2  equ [edi+48]
858
       .sdby13 equ [edi+64]
665
  ;     .sdby13 equ [edi+64]
859
       .sdty13 equ [edi+80]
666
  ;     .sdty13 equ [edi+80]
860
       .sdby12 equ [edi+96]
667
  ;     .sdby12 equ [edi+96]
861
       .sdty12 equ [edi+128]
668
  ;     .sdty12 equ [edi+128]
862
       push    edi
669
  ;     push    edi
863
       mov     edi,sse_repository
670
       mov     edi,sse_repository
864
       movaps  .scby1,xmm0
671
       movaps  .scby1,xmm0
865
       movaps  .scty1,xmm1
672
       movaps  .scty1,xmm1
866
       movaps  .scby2,xmm2
673
       movaps  .scby2,xmm2
867
       movaps  .scty2,xmm3
674
       movaps  .scty2,xmm3
Line 871... Line 678...
871
       movaps  .sdty12,xmm7
678
       movaps  .sdty12,xmm7
872
       pop     edi
679
       pop     edi
873
 
680
 
Line 874... Line 681...
874
end if
681
end if
-
 
682
 
875
       movsx	ecx,.y1
683
       movsx    ecx,.y1
876
       cmp	cx,.y2
684
       cmp      cx,.y2
877
       jge	.loop12_done
685
       jge      .loop12_done
878
  .loop12:
686
  .loop12:
879
;if Ext >= SSE2
-
 
880
;       fxsave  [sse_repository]
-
 
881
;end if
-
 
882
       call	.call_line
687
       call     .call_line
-
 
688
 
883
if Ext >= SSE2
689
if  Ext >= SSE2
884
;       fxrstor [sse_repository]
-
 
-
 
690
 
885
       movups  xmm0,.cby1
691
       movups  xmm0,.cby1
886
       movups  xmm1,.cty1
692
       movups  xmm1,.cty1
887
       movups  xmm2,.cby2
693
       movups  xmm2,.cby2
888
       movups  xmm3,.cty2
694
       movups  xmm3,.cty2
889
    ;   movups  xmm4,.dby13
695
       movups  xmm4,.dby13
890
    ;   movups  xmm5,.dty13
696
       movups  xmm5,.dty13
891
    ;   movups  xmm6,.dby12
697
       movups  xmm6,.dby12
892
    ;   movups  xmm7,.dty12
698
       movups  xmm7,.dty12
893
    ;   paddd   xmm0,xmm4
699
       paddd   xmm0,xmm4
894
    ;   paddd   xmm1,xmm5
700
       paddd   xmm1,xmm5
895
    ;   paddd   xmm2,xmm6
701
       paddd   xmm2,xmm6
896
    ;   paddd   xmm3,xmm7
702
       paddd   xmm3,xmm7
897
       push    edi
-
 
898
       mov     edi,sse_repository
-
 
899
       paddd   xmm0,.sdby13
-
 
900
       paddd   xmm1,.sdty13
-
 
901
       paddd   xmm2,.sdby12
-
 
902
       paddd   xmm3,.sdty12
-
 
903
       pop     edi
-
 
904
       movups  .cby1,xmm0
703
       movups  .cby1,xmm0
905
       movups  .cty1,xmm1
704
       movups  .cty1,xmm1
906
       movups  .cby2,xmm2
705
       movups  .cby2,xmm2
907
       movups  .cty2,xmm3
706
       movups  .cty2,xmm3
908
end if
707
end if
Line 909... Line 708...
909
 
708
 
910
if (Ext = MMX) | (Ext = SSE)
709
if  (Ext = MMX)
911
       movq	mm0,.cby2
710
       movq     mm0,.cby2
912
       movq	mm1,.cby1
711
       movq     mm1,.cby1
913
       movq	mm2,.cey2
712
       movq     mm2,.cey2
914
       movq	mm3,.cey1
713
       movq     mm3,.cey1
Line 1010... Line 809...
1010
 
809
 
Line 1011... Line 810...
1011
       movzx	ebx,word[.t_y2]
810
       movzx    ebx,word[.t_y2]
1012
       shl	ebx,ROUND
811
       shl      ebx,ROUND
1013
       mov	.cty2,ebx
812
       mov      .cty2,ebx
1014
if Ext >= SSE2
-
 
1015
       movups  xmm2,.cby2
-
 
1016
       movups  xmm3,.cty2
-
 
1017
   ;    movups  xmm4,.dby13
-
 
1018
   ;    movups  xmm5,.dty13
-
 
1019
       movups  xmm6,.dby23
-
 
1020
       movups  xmm7,.dty23
-
 
1021
;       .scby1  equ [edi]
-
 
1022
;       .scty1  equ [edi+16]
-
 
1023
;       .scby2  equ [edi+32]
-
 
1024
;       .scty2  equ [edi+48]
-
 
1025
;       .sdby13 equ [edi+64]
-
 
1026
;       .sdty13 equ [edi+80]
-
 
1027
       .sdby23 equ [edi+160]
-
 
1028
       .sdty23 equ [edi+192]
-
 
1029
       push    edi
-
 
1030
       mov     edi,sse_repository
-
 
1031
;       movaps  .scby1,xmm0
-
 
1032
;       movaps  .scty1,xmm1
-
 
1033
       movaps  .scby2,xmm2
-
 
1034
       movaps  .scty2,xmm3
-
 
1035
;       movaps  .sdby13,xmm4
-
 
1036
;       movaps  .sdty13,xmm5
-
 
1037
       movaps  .sdby23,xmm6
-
 
1038
       movaps  .sdty23,xmm7
-
 
1039
       pop     edi
-
 
1040
 
-
 
1041
end if
-
 
Line 1042... Line 813...
1042
 
813
 
1043
     .loop23:
-
 
1044
;if Ext >= SSE2
-
 
1045
;       fxsave  [sse_repository]
-
 
1046
;end if
814
     .loop23:
Line 1047... Line 815...
1047
       call	.call_line
815
       call     .call_line
1048
 
-
 
-
 
816
 
1049
if Ext >= SSE2
817
if  Ext >= SSE2
1050
 
818
;       fxrstor [sse_repository]
1051
       movups  xmm0,.cby1
819
       movups  xmm0,.cby1
1052
       movups  xmm1,.cty1
820
       movups  xmm1,.cty1
-
 
821
       movups  xmm2,.cby2
-
 
822
       movups  xmm3,.cty2
-
 
823
       movups  xmm4,.dby13
-
 
824
       movups  xmm5,.dty13
-
 
825
       movups  xmm6,.dby23
-
 
826
       movups  xmm7,.dty23
1053
       movups  xmm2,.cby2
-
 
1054
       movups  xmm3,.cty2
-
 
-
 
827
       paddd   xmm0,xmm4
-
 
828
       paddd   xmm1,xmm5
1055
 
829
       paddd   xmm2,xmm6
1056
 
830
       paddd   xmm3,xmm7
1057
       push    edi
831
    ;   push    edi
1058
       mov     edi,sse_repository
832
    ;   mov     edi,sse_repository
1059
       paddd   xmm0,.sdby13
833
    ;   paddd   xmm0,.sdby13
1060
       paddd   xmm1,.sdty13
834
    ;   paddd   xmm1,.sdty13
1061
       paddd   xmm2,.sdby23
835
    ;   paddd   xmm2,.sdby12
1062
       paddd   xmm3,.sdty23
836
    ;   paddd   xmm3,.sdty12
1063
       pop     edi
837
    ;   pop     edi
1064
       movups  .cby1,xmm0
838
       movups  .cby1,xmm0
1065
       movups  .cty1,xmm1
839
       movups  .cty1,xmm1
-
 
840
       movups  .cby2,xmm2
Line 1066... Line -...
1066
       movups  .cby2,xmm2
-
 
1067
       movups  .cty2,xmm3
-
 
1068
 
-
 
1069
 
-
 
1070
 
-
 
1071
 
-
 
1072
;       fxrstor [sse_repository]
-
 
1073
;       movups  xmm0,.cby1
-
 
1074
;       movups  xmm1,.cty1
-
 
1075
;       movups  xmm2,.cby2
-
 
1076
;       movups  xmm3,.cty2
-
 
1077
;       movups  xmm4,.dby13
-
 
1078
;       movups  xmm5,.dty13
-
 
1079
;       movups  xmm6,.dby23
-
 
1080
;       movups  xmm7,.dty23
-
 
1081
;       paddd   xmm0,xmm4
-
 
1082
;       paddd   xmm1,xmm5
-
 
1083
;       paddd   xmm2,xmm6
-
 
1084
 ;      paddd   xmm3,xmm7
-
 
1085
 ;      movups  .cby1,xmm0
-
 
1086
 ;      movups  .cty1,xmm1
-
 
1087
 ;      movups  .cby2,xmm2
841
       movups  .cty2,xmm3
1088
 ;      movups  .cty2,xmm3
842
end if
1089
;
843
 
1090
end if
844
 
1091
if (Ext = MMX) | (Ext = SSE)
845
if (Ext = MMX)
1092
       movq	mm0,.cby2
846
       movq     mm0,.cby2
Line 1161... Line 915...
1161
 
915
 
Line 1162... Line 916...
1162
.call_line:
916
.call_line:
Line 1163... Line 917...
1163
 
917
 
1164
       pushad
-
 
1165
       ; xmm0= cby1,cbx1,cz1,cx1
-
 
1166
       ; xmm1= cty1,ctx1,cey1,cex1
-
 
1167
if Ext >= SSE2
-
 
1168
       sub	esp,8
-
 
1169
       shufps	xmm1,xmm1,10110001b
-
 
1170
       shufps	xmm3,xmm3,10110001b
-
 
1171
       movlps	[esp],xmm1
-
 
1172
else
918
       pushad
1173
       push	dword .cty1
919
       push     dword .cty1
1174
       push	.ctx1
920
       push     .ctx1
1175
end if
921
 
1176
       push	dword .cz1
-
 
1177
if Ext>=SSE2
-
 
1178
       sub	esp,8
-
 
1179
       movlps	[esp],xmm3
-
 
1180
else
922
       push     dword .cz1
1181
       push	dword .cty2
923
       push     dword .cty2
1182
       push	.ctx2
924
       push     .ctx2
1183
end if
925
 
1184
       push	dword .cz2
-
 
1185
if Ext>=SSE2
-
 
1186
       sub	esp,32
-
 
1187
       movhps	[esp+24],xmm3
-
 
1188
       shufps	xmm2,xmm2,10110001b
-
 
1189
       movlps	[esp+16],xmm2
-
 
1190
       movhps	[esp+8],xmm1
-
 
1191
       shufps	xmm0,xmm0,10110001b
-
 
Line 1192... Line -...
1192
       movlps	[esp],xmm0 ;================================
-
 
1193
 
926
       push     dword .cz2
1194
else
927
 
1195
       push	dword .cey2
928
       push     dword .cey2
1196
       push	.cex2
929
       push     .cex2
1197
       push	dword .cby2
930
       push     dword .cby2
1198
       push	.cbx2
931
       push     .cbx2
1199
       push	dword .cey1
932
       push     dword .cey1
1200
       push	.cex1
933
       push     .cex1
1201
       push	dword .cby1
934
       push     dword .cby1
Line 1202... Line 935...
1202
       push	.cbx1
935
       push     .cbx1
1203
end if
936
 
1204
 
937
 
1205
       push	.tex_ptr
938
       push     .tex_ptr
Line 1216... Line 949...
1216
 
949
 
Line 1217... Line 950...
1217
       call	bump_tex_line_z
950
       call     bump_tex_line_z
Line 1218... Line 951...
1218
 
951
 
1219
       popad
952
       popad
1220
;end if
953
 
1221
ret
954
ret
1222
bump_tex_line_z:
955
bump_tex_line_z:
1223
;--------------in: eax - x1
956
;--------------in: eax - x1
1224
;--------------    ebx - x2
957
;--------------    ebx - x2
Line 1332... Line 1065...
1332
	movq	mm1,.tx2
1065
        movq    mm1,.tx2
1333
	movq	.tx1,mm1
1066
        movq    .tx1,mm1
1334
	movq	.tx2,mm0
1067
        movq    .tx2,mm0
1335
end if
1068
end if
1336
;if Ext>=SSE2
1069
 
1337
;        movaps  xmm4,xmm0
-
 
1338
;        movaps  xmm0,xmm2
-
 
1339
;        movaps  xmm2,xmm4
-
 
1340
;        movaps  xmm5,xmm1
-
 
1341
;        movaps  xmm1,xmm3
-
 
1342
;        movaps  xmm3,xmm5
-
 
1343
;else
-
 
1344
 
-
 
Line 1345... Line 1070...
1345
	xchg	eax,ebx
1070
        xchg    eax,ebx
1346
	mov	edx,.z1
1071
        mov     edx,.z1
1347
	xchg	edx,.z2
1072
        xchg    edx,.z2
1348
	mov	.z1,edx
1073
        mov     .z1,edx
1349
;end if
-
 
1350
  .bl_ok:
-
 
1351
;if Ext >= SSE2
-
 
1352
;        shufps  xmm0,xmm0,11100001b
-
 
1353
;        shufps  xmm2,xmm2,11100001b
-
 
1354
;        movlps  .bx1,xmm0
-
 
1355
;        movlps  .bx2,xmm2
-
 
1356
 
-
 
1357
 
-
 
1358
;        shufps  xmm0,xmm0,00011011b
-
 
1359
;        shufps  xmm2,xmm2,00011011b
-
 
1360
;        movd    eax,xmm0
-
 
1361
;        movd    ebx,xmm2
-
 
1362
;        shufps  xmm0,xmm0,11000110b
-
 
1363
;        shufps  xmm2,xmm2,11000110b
-
 
1364
;        movd    .z1,xmm0
-
 
1365
;        movd    .z2,xmm2
-
 
1366
;        shufps  xmm1,xmm1,10110001b
-
 
1367
;        shufps  xmm3,xmm3,10110001b
-
 
1368
;        movlps  .ex1,xmm1
-
 
1369
;        movlps  .ex2,xmm2
-
 
1370
;        movhps  .tx1,xmm1
-
 
1371
;        movhps  .tx2,xmm2
-
 
1372
 
-
 
1373
;        xchg    eax,ebx
-
 
1374
;        mov     edx,.z1
-
 
1375
;        xchg    edx,.z2
-
 
1376
;        mov     .z1,edx
-
 
1377
 
-
 
Line 1378... Line 1074...
1378
 
1074
 
Line 1379... Line 1075...
1379
;end if
1075
  .bl_ok:
1380
 
1076
 
1381
	push	eax
1077
        push    eax
1382
	push	ebx	      ;store x1, x2
1078
        push    ebx           ;store x1, x2
Line 1389... Line 1085...
1389
 
1085
 
Line 1390... Line 1086...
1390
	mov	ebx,.x2
1086
        mov     ebx,.x2
1391
	sub	ebx,.x1
1087
        sub     ebx,.x1
Line 1392... Line -...
1392
 
-
 
1393
if Ext>=SSE
-
 
1394
 
-
 
1395
       sub	 esp,28
1088
 
1396
       cvtsi2ss  xmm3,ebx	     ;rcps
1089
       mov      eax,1 shl 15
1397
       shufps	 xmm3,xmm3,0
-
 
1398
; float using SSE variant  ::-->
1090
       cdq
1399
;       movups    xmm0,.bx1  ; new
1091
       idiv     ebx
Line 1400... Line -...
1400
;       movups    xmm1,.bx2  ; new
-
 
1401
 
-
 
1402
       cvtpi2ps  xmm0,.bx1 ;mm0    ; variant fixed point
-
 
1403
       movlhps	 xmm0,xmm0
-
 
1404
       cvtpi2ps  xmm0,.ex1 ;mm2
-
 
1405
       cvtpi2ps  xmm1,.bx2 ;mm1
-
 
1406
       movlhps	 xmm1,xmm1
-
 
1407
       cvtpi2ps  xmm1,.ex2 ;mm3
-
 
1408
       subps	 xmm1,xmm0
-
 
1409
 
-
 
1410
       divps	 xmm1,xmm3
-
 
1411
 
-
 
1412
       shufps	 xmm1,xmm1,10110001b
-
 
1413
;       movups    .dey,xmm1  ; new
-
 
1414
       cvtps2pi  mm0,xmm1	   ; mm0 -> 2 delta dwords
-
 
1415
       movhlps	 xmm1,xmm1
-
 
1416
       cvtps2pi  mm1,xmm1
-
 
Line 1417... Line 1092...
1417
       movq	 .dey,mm0
1092
       mov      ebx,eax
-
 
1093
 
-
 
1094
 
-
 
1095
       mov      eax,.bx2
-
 
1096
       sub      eax,.bx1
1418
       movq	 .dby,mm1
1097
       sar      eax,ROUND
Line 1419... Line -...
1419
 
-
 
1420
       movd	 mm2,.z1
-
 
1421
       movd	 mm3,.z2
-
 
1422
 
-
 
1423
       cvtpi2ps  xmm0,.tx1 ;mm0
-
 
1424
       movlhps	 xmm0,xmm0
-
 
1425
       cvtpi2ps  xmm0,mm2
-
 
1426
       cvtpi2ps  xmm1,.tx2 ;mm1
-
 
1427
       movlhps	 xmm1,xmm1
-
 
1428
       cvtpi2ps  xmm1,mm3
-
 
1429
;       movups    xmm0,,z1  ; new
-
 
1430
;       movups    xmm1,.z2  ; new
-
 
1431
       subps	 xmm1,xmm0
-
 
1432
 
-
 
1433
       divps	 xmm1,xmm3
-
 
1434
 
-
 
1435
;       movups    .dz,xmm1  ;new
-
 
1436
 
-
 
1437
       shufps	 xmm1,xmm1,10110100b
-
 
1438
       cvtps2pi  mm0,xmm1	   ; mm0 -> 2 delta dwords
-
 
Line 1439... Line -...
1439
       movhlps	 xmm1,xmm1
-
 
Line 1440... Line -...
1440
       cvtps2pi  mm1,xmm1
-
 
1441
       movd	 .dz,mm0
-
 
1442
       movq	 .dty,mm1
-
 
1443
 
-
 
1444
else
-
 
Line 1445... Line 1098...
1445
 
1098
       imul     ebx
1446
	mov	eax,.bx2       ; calc .dbx
1099
       sar      eax,15 - ROUND
1447
	sub	eax,.bx1
1100
       push     eax
1448
	cdq
1101
 
-
 
1102
 
1449
	idiv	ebx
1103
 
Line -... Line 1104...
-
 
1104
 
-
 
1105
       mov      eax,.by2
1450
	push	eax
1106
       sub      eax,.by1
1451
 
1107
       sar      eax,ROUND
1452
	mov	eax,.by2       ; calc .dby
1108
       imul     ebx
1453
	sub	eax,.by1
1109
       sar      eax,15 - ROUND
-
 
1110
       push     eax
1454
	cdq
1111
 
Line -... Line 1112...
-
 
1112
 
-
 
1113
 
1455
	idiv	ebx
1114
       mov      eax,.ex2
1456
	push	eax
1115
       sub      eax,.ex1
1457
 
1116
       sar      eax,ROUND
1458
	mov	eax,.ex2       ; calc .dex
1117
       imul     ebx
-
 
1118
       sar      eax,15 - ROUND
1459
	sub	eax,.ex1
1119
       push     eax
Line 1460... Line 1120...
1460
	cdq
1120
 
1461
	idiv	ebx
1121
 
1462
	push	eax
1122
 
1463
 
1123
       mov      eax,.ey2
-
 
1124
       sub      eax,.ey1
1464
	mov	eax,.ey2       ; calc .dey
1125
       sar      eax,ROUND
Line 1465... Line 1126...
1465
	sub	eax,.ey1
1126
       imul     ebx
1466
	cdq
1127
       sar      eax,15 - ROUND
1467
	idiv	ebx
1128
       push     eax
1468
	push	eax
1129
 
-
 
1130
 
1469
 
1131
       mov      eax,.z2
Line -... Line 1132...
-
 
1132
       sub      eax,.z1
1470
 
1133
       sar      eax,ROUND
1471
	mov	eax,.z2        ; calc .dz
1134
       imul     ebx
1472
	sub	eax,.z1
1135
       sar      eax,15 - ROUND
1473
	cdq
1136
       push     eax
-
 
1137
 
1474
	idiv	ebx
1138
       mov      eax,.tx2
Line 1475... Line 1139...
1475
	push	eax
1139
       sub      eax,.tx1
1476
 
1140
       sar      eax,ROUND
1477
	mov	eax,.tx2       ; calc .dtx
1141
       imul     ebx
1478
	sub	eax,.tx1
1142
       sar      eax,15 - ROUND
1479
	cdq
1143
       push     eax
1480
	idiv	ebx
1144