|
|
1.1 root 1: /* These are optimized x86 assembly versions of pfield_linetoscr.
2: * Feel free to send me Sparc/PPC/Alpha versions of this... :)
3: * [it's not necessarily a win to code these in assembler, though - Paul
4: * Liss says this code is slower than the generic C stuff in custom.c on
5: * a PPro]
6: */
7:
8: #include "config.h"
9:
10: /*#define X86_PPRO_OPT*/
11: #ifdef X86_PPRO_OPT
12: #define PARTIAL_REG(a,b) a
13: #define BYTE_MOVE movzbl
14: #define WORD_MOVE movzwl
15: #define CLEAR_FOR_BYTE_MOVE(a)
16: #else
17: #define PARTIAL_REG(a,b) b
18: #define BYTE_MOVE movb
19: #define WORD_MOVE movw
20: #define CLEAR_FOR_BYTE_MOVE(a) xorl a,a
21: #endif
22:
23: #ifndef USE_UNDERSCORE
24: #define SYM(NAME) NAME
25: #define FUNCTION_ALIGN .align 16
26: #define FUNCTYPE(NAME) .type NAME,@function
27: #else
28: #define SYM(NAME) _##NAME
29: #define FUNCTION_ALIGN .align 4
30: #define FUNCTYPE(NAME)
31: #endif
32:
33: .text
34:
35: .globl pfield_linetoscr_asm8
36: FUNCTYPE (pfield_linetoscr_asm8)
37: FUNCTION_ALIGN
38: pfield_linetoscr_asm8:
39: pushl %ebp
40: pushl %edi
41: pushl %esi
42: pushl %ebx
43: movl 24(%esp),%esi /* start */
44: movl 28(%esp),%edi /* lframe_end */
45:
46: movl SYM(colors_for_drawing),%eax
47: movl 20(%esp),%ebx
48: movl SYM(xlinebuffer),%ecx
49: jmp .La_do_start_line
50: FUNCTION_ALIGN
51: .La_start_line:
52: movl %eax,(%ecx,%esi)
53: addl $4,%esi
54: .La_do_start_line:
55: cmpl %esi,%edi
56: jnbe .La_start_line
57:
58: call %ebx
59:
60: /* Finish off the line */
61:
62: movl SYM(xlinebuffer),%ecx
63: movl 36(%esp),%edi /* stoppos */
64: movl SYM(colors_for_drawing),%eax
65: jmp .La_do_end_line
66: FUNCTION_ALIGN
67: .La_end_line:
68: movl %eax,(%ecx,%esi)
69: addl $4,%esi
70: .La_do_end_line:
71: cmpl %esi,%edi
72: jnbe .La_end_line
73:
74: popl %ebx
75: popl %esi
76: popl %edi
77: popl %ebp
78: ret
79:
80: .globl pfield_linetoscr_ham6_asm8
81: FUNCTYPE (pfield_linetoscr_ham6_asm8)
82: FUNCTION_ALIGN
83: pfield_linetoscr_ham6_asm8:
84: movl 36(%esp),%edi /* diw_end */
85: .Laa_hamloop:
86: cmpl %esi,%edi
87: jbe .Laa_hamend
88:
89: movl SYM(ham_linebuf)+12(,%esi,4),%eax
90: movb SYM(xcolors)(,%eax,4),%bh
91: movl SYM(ham_linebuf)+8(,%esi,4),%eax
92: movb SYM(xcolors)(,%eax,4),%bl
93: sall $16,%ebx
94: movl SYM(ham_linebuf)+4(,%esi,4),%eax
95: movb SYM(xcolors)(,%eax,4),%bh
96: movl SYM(ham_linebuf)(,%esi,4),%eax
97: movb SYM(xcolors)(,%eax,4),%bl
98: movl %ebx,(%ecx,%esi)
99: addl $4,%esi
100: jmp .Laa_hamloop
101:
102: .Laa_hamend:
103: ret
104:
105: .globl pfield_linetoscr_dualpf_asm8
106: FUNCTYPE (pfield_linetoscr_dualpf_asm8)
107: FUNCTION_ALIGN
108: pfield_linetoscr_dualpf_asm8:
109: xorl %edx,%edx
110: movl 44(%esp),%ebp /* lookup_no */
111: .Lab_dp_loop:
112: movl 36(%esp),%eax /* diw_end */
113: xorl %edx,%edx
114: cmpl %esi,%eax
115: jbe .La_dp_done
116:
117: movl SYM(pixdata)(%esi),%eax
118:
119: BYTE_MOVE %al,PARTIAL_REG(%edx,%dl)
120: BYTE_MOVE (%ebp,%edx,4),PARTIAL_REG(%edx,%dl)
121: movb SYM(colors_for_drawing)(,%edx,4),%cl
122: BYTE_MOVE %ah,PARTIAL_REG(%edx,%dl)
123: BYTE_MOVE (%ebp,%edx,4),PARTIAL_REG(%edx,%dl)
124: movb SYM(colors_for_drawing)(,%edx,4),%ch
125: bswapl %eax
126: bswapl %ecx
127: BYTE_MOVE %al,PARTIAL_REG(%edx,%dl)
128: BYTE_MOVE (%ebp,%edx,4),PARTIAL_REG(%edx,%dl)
129: movb SYM(colors_for_drawing)(,%edx,4),%cl
130: BYTE_MOVE %ah,PARTIAL_REG(%edx,%dl)
131: BYTE_MOVE (%ebp,%edx,4),PARTIAL_REG(%edx,%dl)
132: movb SYM(colors_for_drawing)(,%edx,4),%ch
133: bswapl %ecx
134:
135: movl SYM(xlinebuffer),%eax
136: movl %ecx,(%eax,%esi)
137: addl $4,%esi
138: jmp .Lab_dp_loop
139: .La_dp_done:
140: ret
141:
142: .globl pfield_linetoscr_ehb_asm8
143: FUNCTYPE (pfield_linetoscr_ehb_asm8)
144: FUNCTION_ALIGN
145: pfield_linetoscr_ehb_asm8:
146: xorl %edx,%edx
147: movl SYM(xlinebuffer),%ebx
148: .La_ehb_loop:
149: movl 36(%esp),%edi /* diw_end */
150: cmpl %esi,%edi
151: jbe .La_ehb_end
152:
153: movl SYM(pixdata)(%esi),%eax
154: BYTE_MOVE %al,PARTIAL_REG(%edx,%dl)
155: cmpb $32,%al
156: movb SYM(colors_for_drawing)(,%edx,4),%cl
157: jc .La_ehb1
158: movw SYM(colors_for_drawing)+32*4-32*2(,%edx,2),%di
159: shrl $1,%edi
160: andl $0x777,%edi
161: movb SYM(xcolors)(,%edi,4),%cl
162: .La_ehb1:
163: BYTE_MOVE %ah,PARTIAL_REG(%edx,%dl)
164: cmpb $32,%ah
165: movb SYM(colors_for_drawing)(,%edx,4),%ch
166: jc .La_ehb2
167: movw SYM(colors_for_drawing)+32*4-32*2(,%edx,2),%di
168: shrl $1,%edi
169: andl $0x777,%edi
170: movb SYM(xcolors)(,%edi,4),%ch
171: .La_ehb2:
172: sarl $16,%eax
173: sall $16,%ecx
174: BYTE_MOVE %al,PARTIAL_REG(%edx,%dl)
175: cmpb $32,%al
176: movb SYM(colors_for_drawing)(,%edx,4),%cl
177: jc .La_ehb3
178: movw SYM(colors_for_drawing)+32*4-32*2(,%edx,2),%di
179: shrl $1,%edi
180: andl $0x777,%edi
181: movb SYM(xcolors)(,%edi,4),%cl
182: .La_ehb3:
183: BYTE_MOVE %ah,PARTIAL_REG(%edx,%dl)
184: cmpb $32,%ah
185: movb SYM(colors_for_drawing)(,%edx,4),%ch
186: jc .La_ehb4
187: movw SYM(colors_for_drawing)+32*4-32*2(,%edx,2),%di
188: shrl $1,%edi
189: andl $0x777,%edi
190: movb SYM(xcolors)(,%edi,4),%ch
191: .La_ehb4:
192: roll $16,%ecx
193:
194: movl %ecx,(%ebx,%esi)
195: addl $4,%esi
196: jmp .La_ehb_loop
197:
198: .La_ehb_end:
199: ret
200:
201: .globl pfield_linetoscr_normal_asm8
202: FUNCTYPE (pfield_linetoscr_normal_asm8)
203: FUNCTION_ALIGN
204: pfield_linetoscr_normal_asm8:
205: xorl %edx,%edx
206: xorl %ebx,%ebx
207: movl 36(%esp),%edi /* diw_end */
208: movl SYM(xlinebuffer),%ebp
209: jmp .La_normal_doloop
210: FUNCTION_ALIGN
211: .La_normal_loop:
212: BYTE_MOVE SYM(pixdata)(%esi),PARTIAL_REG(%edx,%dl)
213: BYTE_MOVE SYM(pixdata)+4(%esi),PARTIAL_REG(%ebx,%bl)
214: movb SYM(colors_for_drawing)(,%edx,4),%cl
215: movb SYM(colors_for_drawing)(,%ebx,4),%al
216: BYTE_MOVE SYM(pixdata)+1(%esi),PARTIAL_REG(%edx,%dl)
217: BYTE_MOVE SYM(pixdata)+5(%esi),PARTIAL_REG(%ebx,%bl)
218: movb SYM(colors_for_drawing)(,%edx,4),%ch
219: movb SYM(colors_for_drawing)(,%ebx,4),%ah
220:
221: sall $16,%ecx
222: BYTE_MOVE SYM(pixdata)+2(%esi),PARTIAL_REG(%edx,%dl)
223: sall $16,%eax
224:
225: BYTE_MOVE SYM(pixdata)+6(%esi),PARTIAL_REG(%ebx,%bl)
226: movb SYM(colors_for_drawing)(,%edx,4),%cl
227: movb SYM(colors_for_drawing)(,%ebx,4),%al
228: BYTE_MOVE SYM(pixdata)+3(%esi),PARTIAL_REG(%edx,%dl)
229: BYTE_MOVE SYM(pixdata)+7(%esi),PARTIAL_REG(%ebx,%bl)
230: movb SYM(colors_for_drawing)(,%edx,4),%ch
231: addl $4,%esi
232: roll $16,%ecx
233: movb SYM(colors_for_drawing)(,%ebx,4),%ah
234: roll $16,%eax
235:
236: movl %ecx,-4(%ebp,%esi)
237: cmpl %esi,%edi
238: jbe .La_normal_end
239: movl %eax,(%ebp,%esi)
240: addl $4,%esi
241: .La_normal_doloop:
242: cmpl %esi,%edi
243: jnbe .La_normal_loop
244:
245: .La_normal_end:
246: ret
247:
248: .globl pfield_linetoscr_hdouble_asm8
249: FUNCTYPE (pfield_linetoscr_hdouble_asm8)
250: FUNCTION_ALIGN
251: pfield_linetoscr_hdouble_asm8:
252: shrl $1,%esi
253: xorl %edx,%edx
254: xorl %ebx,%ebx
255: movl 36(%esp),%edi /* diw_end */
256: shrl $1,%edi
257: movl SYM(xlinebuffer),%ebp
258: jmp .La_hdouble_doloop
259: FUNCTION_ALIGN
260: .La_hdouble_loop:
261: BYTE_MOVE SYM(pixdata)+1(%esi),PARTIAL_REG(%edx,%dl)
262: BYTE_MOVE SYM(pixdata)+3(%esi),PARTIAL_REG(%ebx,%bl)
263: movl SYM(colors_for_drawing)(,%edx,4),%ecx
264: movl SYM(colors_for_drawing)(,%ebx,4),%eax
265: BYTE_MOVE SYM(pixdata)+0(%esi),PARTIAL_REG(%edx,%dl)
266: BYTE_MOVE SYM(pixdata)+2(%esi),PARTIAL_REG(%ebx,%bl)
267: movw SYM(colors_for_drawing)(,%edx,4),%cx
268: movw SYM(colors_for_drawing)(,%ebx,4),%ax
269: addl $2,%esi
270:
271: movl %ecx,-4(%ebp,%esi,2)
272: cmpl %esi,%edi
273: jbe .La_hdouble_end
274: movl %eax,(%ebp,%esi,2)
275: addl $2,%esi
276: .La_hdouble_doloop:
277: cmpl %esi,%edi
278: jnbe .La_hdouble_loop
279:
280: .La_hdouble_end:
281: addl %esi,%esi
282: ret
283:
284: .globl pfield_linetoscr_hdouble_dpf_asm8
285: FUNCTYPE (pfield_linetoscr_hdouble_dpf_asm8)
286: FUNCTION_ALIGN
287: pfield_linetoscr_hdouble_dpf_asm8:
288: shrl $1,%esi
289: xorl %edx,%edx
290: xorl %ebx,%ebx
291: movl 36(%esp),%edi /* diw_end */
292: movl 44(%esp),%ebp
293: shrl $1,%edi
294: jmp .La_hdouble_dpf_doloop
295: FUNCTION_ALIGN
296: .La_hdouble_dpf_loop:
297: BYTE_MOVE SYM(pixdata)+1(%esi),PARTIAL_REG(%edx,%dl)
298: CLEAR_FOR_BYTE_MOVE(%ebx)
299: BYTE_MOVE SYM(pixdata)+3(%esi),PARTIAL_REG(%ebx,%bl)
300: BYTE_MOVE (%ebp,%edx,4),PARTIAL_REG(%edx,%dl)
301: BYTE_MOVE (%ebp,%ebx,4),PARTIAL_REG(%ebx,%bl)
302: movl SYM(colors_for_drawing)(,%edx,4),%ecx
303: movl SYM(colors_for_drawing)(,%ebx,4),%eax
304: BYTE_MOVE SYM(pixdata)+0(%esi),PARTIAL_REG(%edx,%dl)
305: BYTE_MOVE SYM(pixdata)+2(%esi),PARTIAL_REG(%ebx,%bl)
306: BYTE_MOVE (%ebp,%edx,4),PARTIAL_REG(%edx,%dl)
307: addl $2,%esi
308: BYTE_MOVE (%ebp,%ebx,4),PARTIAL_REG(%ebx,%bl)
309: movw SYM(colors_for_drawing)(,%edx,4),%cx
310: movw SYM(colors_for_drawing)(,%ebx,4),%ax
311:
312: movl SYM(xlinebuffer),%ebx
313: movl %ecx,-4(%ebx,%esi,2)
314: cmpl %esi,%edi
315: jbe .La_hdouble_dpf_end
316: movl %eax,(%ebx,%esi,2)
317: addl $2,%esi
318: .La_hdouble_dpf_doloop:
319: cmpl %esi,%edi
320: jnbe .La_hdouble_dpf_loop
321:
322: .La_hdouble_dpf_end:
323: addl %esi,%esi
324: ret
325:
326: .globl pfield_linetoscr_hdouble_ehb_asm8
327: FUNCTYPE (pfield_linetoscr_hdouble_ehb_asm8)
328: FUNCTION_ALIGN
329: pfield_linetoscr_hdouble_ehb_asm8:
330: shrl $1,%esi
331: movl 36(%esp),%edi /* diw_end */
332: shrl $1,%edi
333: xorl %edx,%edx
334: movl SYM(xlinebuffer),%ebp
335: jmp .La_hdouble_ehb_doloop
336: FUNCTION_ALIGN
337: .La_hdouble_ehb_loop:
338: BYTE_MOVE SYM(pixdata)+1(%esi),PARTIAL_REG(%edx,%dl)
339: cmpb $32,%dl
340: movl SYM(colors_for_drawing)(,%edx,4),%ecx
341: jc .La_dehb1
342: WORD_MOVE SYM(colors_for_drawing)+32*4-32*2(,%edx,2),PARTIAL_REG(%ebx,%bx)
343: shrl $1,%ebx
344: andl $0x777,%ebx
345: movl SYM(xcolors)(,%ebx,4),%ecx
346: .La_dehb1:
347:
348: BYTE_MOVE SYM(pixdata)+3(%esi),PARTIAL_REG(%edx,%dl)
349: cmpb $32,%dl
350: movl SYM(colors_for_drawing)(,%edx,4),%eax
351: jc .La_dehb2
352: WORD_MOVE SYM(colors_for_drawing)+32*4-32*2(,%edx,2),PARTIAL_REG(%ebx,%bx)
353: shrl $1,%ebx
354: andl $0x777,%ebx
355: movl SYM(xcolors)(,%ebx,4),%eax
356: .La_dehb2:
357:
358: BYTE_MOVE SYM(pixdata)+0(%esi),PARTIAL_REG(%edx,%dl)
359: cmpb $32,%dl
360: movw SYM(colors_for_drawing)(,%edx,4),%cx
361: jc .La_dehb3
362: WORD_MOVE SYM(colors_for_drawing)+32*4-32*2(,%edx,2),PARTIAL_REG(%ebx,%bx)
363: shrl $1,%ebx
364: andl $0x777,%ebx
365: movw SYM(xcolors)(,%ebx,4),%cx
366: .La_dehb3:
367:
368: BYTE_MOVE SYM(pixdata)+2(%esi),PARTIAL_REG(%edx,%dl)
369: cmpb $32,%dl
370: movw SYM(colors_for_drawing)(,%edx,4),%ax
371: jc .La_dehb4
372: WORD_MOVE SYM(colors_for_drawing)+32*4-32*2(,%edx,2),PARTIAL_REG(%ebx,%bx)
373: shrl $1,%ebx
374: andl $0x777,%ebx
375: movw SYM(xcolors)(,%ebx,4),%ax
376: .La_dehb4:
377: addl $2,%esi
378:
379: movl %ecx,-4(%ebp,%esi,2)
380: cmpl %esi,%edi
381: jbe .La_hdouble_ehb_end
382: movl %eax,(%ebp,%esi,2)
383: addl $2,%esi
384: .La_hdouble_ehb_doloop:
385: cmpl %esi,%edi
386: jnbe .La_hdouble_ehb_loop
387:
388: .La_hdouble_ehb_end:
389: addl %esi,%esi
390: ret
391:
392: /* 16 bit functions */
393:
394: .globl pfield_linetoscr_asm16
395: FUNCTYPE (pfield_linetoscr_asm16)
396: FUNCTION_ALIGN
397: pfield_linetoscr_asm16:
398: pushl %ebp
399: pushl %edi
400: pushl %esi
401: pushl %ebx
402: movl 24(%esp),%esi /* start */
403: movl 28(%esp),%edi /* lframe_end */
404:
405: movl SYM(colors_for_drawing),%eax
406:
407: movl 20(%esp),%ebx
408: movl SYM(xlinebuffer),%ecx
409: jmp .Lb_do_start_line
410: FUNCTION_ALIGN
411: .Lb_start_line:
412: movl %eax,(%ecx,%esi,2)
413: movl %eax,4(%ecx,%esi,2)
414: addl $4,%esi
415: .Lb_do_start_line:
416: cmpl %esi,%edi
417: jnbe .Lb_start_line
418:
419: call %ebx
420:
421: /* Finish off the line */
422:
423: movl SYM(xlinebuffer),%ecx
424: movl 36(%esp),%edi /* stoppos */
425: movl SYM(colors_for_drawing),%eax
426: jmp .Lb_do_end_line
427: FUNCTION_ALIGN
428: .Lb_end_line:
429: movl %eax,(%ecx,%esi,2)
430: movl %eax,4(%ecx,%esi,2)
431: addl $4,%esi
432: .Lb_do_end_line:
433: cmpl %esi,%edi
434: jnbe .Lb_end_line
435:
436: popl %ebx
437: popl %esi
438: popl %edi
439: popl %ebp
440: ret
441:
442: .globl pfield_linetoscr_ham6_asm16
443: FUNCTYPE (pfield_linetoscr_ham6_asm16)
444: FUNCTION_ALIGN
445: pfield_linetoscr_ham6_asm16:
446: movl 36(%esp),%edi /* diw_end */
447: .Lb_hamloop:
448: cmpl %esi,%edi
449: jbe .Lb_hamend
450:
451: movl SYM(ham_linebuf)+4(,%esi,4),%eax
452: movl SYM(xcolors)(,%eax,4),%ebx
453: movl SYM(ham_linebuf)(,%esi,4),%eax
454: movw SYM(xcolors)(,%eax,4),%bx
455: movl %ebx,(%ecx,%esi,2)
456:
457: movl SYM(ham_linebuf)+12(,%esi,4),%eax
458: movl SYM(xcolors)(,%eax,4),%ebx
459: movl SYM(ham_linebuf)+8(,%esi,4),%eax
460: movw SYM(xcolors)(,%eax,4),%bx
461: movl %ebx,4(%ecx,%esi,2)
462:
463: addl $4,%esi
464: jmp .Lb_hamloop
465: .Lb_hamend:
466: ret
467:
468: .globl pfield_linetoscr_dualpf_asm16
469: FUNCTYPE (pfield_linetoscr_dualpf_asm16)
470: FUNCTION_ALIGN
471: pfield_linetoscr_dualpf_asm16:
472: movl 44(%esp),%ebp /* lookup_no */
473: .Lb_dp_loop:
474: movl 36(%esp),%eax /* diw_end */
475: xorl %edx,%edx
476: cmpl %esi,%eax
477: jbe .Lb_dp_done
478:
479: movl SYM(pixdata)(%esi),%eax
480:
481: movl SYM(xlinebuffer),%ebx
482:
483: movb %ah,%dl
484: movb (%ebp,%edx,4),%dl
485: movl SYM(colors_for_drawing)(,%edx,4),%ecx
486: movb %al,%dl
487: movb (%ebp,%edx,4),%dl
488: movw SYM(colors_for_drawing)(,%edx,4),%cx
489: sarl $16,%eax
490: movl %ecx,(%ebx,%esi,2)
491: movb %ah,%dl
492: movb (%ebp,%edx,4),%dl
493: movl SYM(colors_for_drawing)(,%edx,4),%ecx
494: movb %al,%dl
495: movb (%ebp,%edx,4),%dl
496: movw SYM(colors_for_drawing)(,%edx,4),%cx
497: movl %ecx,4(%ebx,%esi,2)
498:
499: addl $4,%esi
500: jmp .Lb_dp_loop
501:
502: .Lb_dp_done:
503: ret
504:
505: .globl pfield_linetoscr_ehb_asm16
506: FUNCTYPE (pfield_linetoscr_ehb_asm16)
507: FUNCTION_ALIGN
508: pfield_linetoscr_ehb_asm16:
509: xorl %edx,%edx
510: xorl %ebx,%ebx
511: .Lb_ehb_loop:
512: movl 36(%esp),%edi /* diw_end */
513: cmpl %esi,%edi
514: jbe .Lb_ehb_end
515:
516: movl SYM(pixdata)(%esi),%eax
517: movb %ah,%bl
518: cmpb $32,%ah
519: movl SYM(colors_for_drawing)(,%ebx,4),%ecx
520: jc .Lb_ehb2
521: WORD_MOVE SYM(colors_for_drawing)+32*4-32*2(,%ebx,2),PARTIAL_REG(%edi,%di)
522: shrl $1,%edi
523: andl $0x777,%edi
524: movl SYM(xcolors)(,%edi,4),%ecx
525: .Lb_ehb2:
526: movb %al,%dl
527: movw SYM(colors_for_drawing)(,%edx,4),%cx
528: cmpb $32,%al
529: jc .Lb_ehb1
530:
531: WORD_MOVE SYM(colors_for_drawing)+32*4-32*2(,%edx,2),PARTIAL_REG(%edi,%di)
532: shrl $1,%edi
533: andl $0x777,%edi
534: movw SYM(xcolors)(,%edi,4),%cx
535: .Lb_ehb1:
536: movl SYM(xlinebuffer),%edi
537: sarl $16,%eax
538: movl %ecx,(%edi,%esi,2)
539: movb %ah,%bl
540: movl SYM(colors_for_drawing)(,%ebx,4),%ecx
541: cmpb $32,%ah
542: jc .Lb_ehb4
543:
544: WORD_MOVE SYM(colors_for_drawing)+32*4-32*2(,%ebx,2),PARTIAL_REG(%edi,%di)
545: shrl $1,%edi
546: andl $0x777,%edi
547: movl SYM(xcolors)(,%edi,4),%ecx
548: .Lb_ehb4:
549: movb %al,%dl
550: movw SYM(colors_for_drawing)(,%edx,4),%cx
551: cmpb $32,%al
552: jc .Lb_ehb3
553:
554: WORD_MOVE SYM(colors_for_drawing)+32*4-32*2(,%edx,2),PARTIAL_REG(%edi,%di)
555: shrl $1,%edi
556: andl $0x777,%edi
557: movw SYM(xcolors)(,%edi,4),%cx
558: .Lb_ehb3:
559:
560: movl SYM(xlinebuffer),%edi
561: movl %ecx,4(%edi,%esi,2)
562: addl $4,%esi
563: jmp .Lb_ehb_loop
564:
565: .Lb_ehb_end:
566: ret
567:
568: .globl pfield_linetoscr_normal_asm16
569: FUNCTYPE (pfield_linetoscr_normal_asm16)
570: FUNCTION_ALIGN
571: pfield_linetoscr_normal_asm16:
572: movl 36(%esp),%edi /* diw_end */
573: jmp .Lb_normal_doloop
574:
575: FUNCTION_ALIGN
576: .Lb_normal_loop:
577: CLEAR_FOR_BYTE_MOVE(%edx)
578: BYTE_MOVE SYM(pixdata)+1(%esi),PARTIAL_REG(%edx,%dl)
579: CLEAR_FOR_BYTE_MOVE(%ebx)
580: BYTE_MOVE SYM(pixdata)+5(%esi),PARTIAL_REG(%ebx,%bl)
581:
582: movl SYM(colors_for_drawing)(,%edx,4),%edi
583: movl SYM(colors_for_drawing)(,%ebx,4),%ecx
584: BYTE_MOVE SYM(pixdata)+0(%esi),PARTIAL_REG(%edx,%dl)
585: BYTE_MOVE SYM(pixdata)+4(%esi),PARTIAL_REG(%ebx,%bl)
586: movw SYM(colors_for_drawing)(,%edx,4),%di
587: movw SYM(colors_for_drawing)(,%ebx,4),%cx
588: BYTE_MOVE SYM(pixdata)+3(%esi),PARTIAL_REG(%edx,%dl)
589: BYTE_MOVE SYM(pixdata)+7(%esi),PARTIAL_REG(%ebx,%bl)
590: movl SYM(colors_for_drawing)(,%edx,4),%eax
591: movl SYM(colors_for_drawing)(,%ebx,4),%ebp
592: BYTE_MOVE SYM(pixdata)+2(%esi),PARTIAL_REG(%edx,%dl)
593: BYTE_MOVE SYM(pixdata)+6(%esi),PARTIAL_REG(%ebx,%bl)
594: movw SYM(colors_for_drawing)(,%edx,4),%ax
595: addl $4,%esi
596: movw SYM(colors_for_drawing)(,%ebx,4),%bp
597:
598: movl SYM(xlinebuffer),%ebx
599: movl %edi,-8(%ebx,%esi,2)
600: movl 36(%esp),%edi
601: movl %eax,-4(%ebx,%esi,2)
602:
603: cmpl %esi,%edi
604: jbe .Lb_normal_done
605:
606: movl %ecx,(%ebx,%esi,2)
607: movl %ebp,4(%ebx,%esi,2)
608:
609: addl $4,%esi
610: .Lb_normal_doloop:
611: cmpl %esi,%edi
612: jnbe .Lb_normal_loop
613:
614: .Lb_normal_done:
615: ret
616:
617: .globl pfield_linetoscr_hdouble_asm16
618: FUNCTYPE (pfield_linetoscr_hdouble_asm16)
619: FUNCTION_ALIGN
620: pfield_linetoscr_hdouble_asm16:
621: shrl $1,%esi
622: movl 36(%esp),%eax /* diw_end */
623: shrl $1,%eax
624: movl SYM(xlinebuffer),%ebp
625: CLEAR_FOR_BYTE_MOVE(%edx)
626: CLEAR_FOR_BYTE_MOVE(%ebx)
627: jmp .Lb_hdouble_doloop
628:
629: FUNCTION_ALIGN
630: .Lb_hdouble_loop:
631: BYTE_MOVE SYM(pixdata)(%esi),PARTIAL_REG(%edx,%dl)
632: BYTE_MOVE SYM(pixdata)+1(%esi),PARTIAL_REG(%ebx,%bl)
633:
634: addl $2,%esi
635: movl SYM(colors_for_drawing)(,%edx,4),%edi
636: movl SYM(colors_for_drawing)(,%ebx,4),%ecx
637: movl %edi,-8(%ebp,%esi,4)
638: movl %ecx,-4(%ebp,%esi,4)
639:
640: .Lb_hdouble_doloop:
641: cmpl %esi,%eax
642: jnbe .Lb_hdouble_loop
643:
644: .Lb_hdouble_done:
645: addl %esi,%esi
646: ret
647:
648: .globl pfield_linetoscr_hdouble_dpf_asm16
649: FUNCTYPE (pfield_linetoscr_hdouble_dpf_asm16)
650: FUNCTION_ALIGN
651: pfield_linetoscr_hdouble_dpf_asm16:
652: shrl $1,%esi
653: xorl %edx,%edx
654: xorl %ebx,%ebx
655: movl 36(%esp),%edi /* diw_end */
656: movl 44(%esp),%ebp
657: shrl $1,%edi
658: cmpl %esi,%edi
659: jbe .Lb_hdouble_dpf_end
660: jmp .Lb_hdouble_dpf_loop
661: FUNCTION_ALIGN
662: .Lb_hdouble_dpf_loop:
663: CLEAR_FOR_BYTE_MOVE(%edx)
664: BYTE_MOVE SYM(pixdata)+1(%esi),PARTIAL_REG(%edx,%dl)
665: CLEAR_FOR_BYTE_MOVE(%ebx)
666: BYTE_MOVE SYM(pixdata)+0(%esi),PARTIAL_REG(%ebx,%bl)
667: BYTE_MOVE (%ebp,%edx,4),PARTIAL_REG(%edx,%dl)
668: BYTE_MOVE (%ebp,%ebx,4),PARTIAL_REG(%ebx,%bl)
669: addl $2,%esi
670: movl SYM(colors_for_drawing)(,%edx,4),%ecx
671: movl SYM(colors_for_drawing)(,%ebx,4),%eax
672:
673: movl SYM(xlinebuffer),%ebx
674: movl %eax,-8(%ebx,%esi,4)
675: cmpl %esi,%edi
676: movl %ecx,-4(%ebx,%esi,4)
677: jnbe .Lb_hdouble_dpf_loop
678: jmp .Lb_hdouble_dpf_end
679:
680: .Lb_hdouble_dpf_end:
681: addl %esi,%esi
682: ret
683:
684: .globl pfield_linetoscr_hdouble_ehb_asm16
685: FUNCTYPE (pfield_linetoscr_hdouble_ehb_asm16)
686: FUNCTION_ALIGN
687: pfield_linetoscr_hdouble_ehb_asm16:
688: shrl $1,%esi
689: movl 36(%esp),%eax /* diw_end */
690: shrl $1,%eax
691: movl SYM(xlinebuffer),%ebp
692: jmp .Lb_hdouble_ehb_doloop
693:
694: FUNCTION_ALIGN
695: .Lb_hdouble_ehb_loop:
696: CLEAR_FOR_BYTE_MOVE(%edx)
697: BYTE_MOVE SYM(pixdata)(%esi),PARTIAL_REG(%edx,%dl)
698: CLEAR_FOR_BYTE_MOVE(%ebx)
699: BYTE_MOVE SYM(pixdata)+1(%esi),PARTIAL_REG(%ebx,%bl)
700: addl $2,%esi
701:
702: cmpb $32,%dl
703: movl SYM(colors_for_drawing)(,%edx,4),%edi
704: jc .Lb_dehb1
705: WORD_MOVE SYM(colors_for_drawing)+32*4-32*2(,%edx,2),PARTIAL_REG(%edi,%di)
706: shrl $1,%edi
707: andl $0x777,%edi
708: movl SYM(xcolors)(,%edi,4),%edi
709: .Lb_dehb1:
710:
711: cmpb $32,%bl
712: movl SYM(colors_for_drawing)(,%ebx,4),%ecx
713: jc .Lb_dehb2
714: WORD_MOVE SYM(colors_for_drawing)+32*4-32*2(,%ebx,2),PARTIAL_REG(%ecx,%cx)
715: shrl $1,%ecx
716: andl $0x777,%ecx
717: movl SYM(xcolors)(,%ecx,4),%ecx
718: .Lb_dehb2:
719: movl %edi,-8(%ebp,%esi,4)
720: movl %ecx,-4(%ebp,%esi,4)
721:
722: .Lb_hdouble_ehb_doloop:
723: cmpl %esi,%eax
724: jnbe .Lb_hdouble_ehb_loop
725:
726: .Lb_hdouble_ehb_done:
727: addl %esi,%esi
728: ret
729:
730: .globl DitherLine
731: #ifndef USE_UNDERSCORE
732: .type DitherLine,@function
733: #endif
734: FUNCTION_ALIGN
735: DitherLine:
736: pushl %ebp
737: pushl %edi
738: pushl %esi
739: pushl %ebx
740: movl 20(%esp),%edi
741: xorl %ebx,%ebx
742: movw 36(%esp),%bx
743: movl 32(%esp),%edx
744: andl $3,%edx
745: sall $15,%edx
746: movl 28(%esp),%eax
747: andl $3,%eax
748: sall $12,%eax
749: leal SYM(cidx)(%edx,%eax),%ebp
750: xorb %dl,%dl
751: movl $8,%ecx
752: testl %ebx,%ebx
753: je .Li_end
754: cmpl $8,40(%esp)
755: je .Li_fast
756:
757: movl 24(%esp),%esi
758: .Li_loop:
759: movzwl (%esi),%eax
760: movzbl (%eax,%ebp),%eax
761: subl 40(%esp),%ecx
762: sall %cl,%eax
763: orb %al,%dl
764: testl %ecx,%ecx
765: jne .Li_1
766: movb %dl,(%edi)
767: incl %edi
768: movl $8,%ecx
769: xorb %dl,%dl
770: .Li_1:
771: movzwl 2(%esi),%eax
772: movzbl 4096(%ebp,%eax),%eax
773: subl 40(%esp),%ecx
774: sall %cl,%eax
775: orb %al,%dl
776: testl %ecx,%ecx
777: jne .Li_2
778: movb %dl,(%edi)
779: incl %edi
780: movl $8,%ecx
781: xorb %dl,%dl
782: .Li_2:
783: movzwl 4(%esi),%eax
784: movzbl 8192(%ebp,%eax),%eax
785: subl 40(%esp),%ecx
786: sall %cl,%eax
787: orb %al,%dl
788: testl %ecx,%ecx
789: jne .Li_3
790: movb %dl,(%edi)
791: incl %edi
792: movl $8,%ecx
793: xorb %dl,%dl
794: .Li_3:
795: movzwl 6(%esi),%eax
796: movzbl 12288(%ebp,%eax),%eax
797: addl $8,%esi
798: subl 40(%esp),%ecx
799: sall %cl,%eax
800: orb %al,%dl
801: testl %ecx,%ecx
802: jne .Li_4
803: movb %dl,(%edi)
804: incl %edi
805: movl $8,%ecx
806: xorb %dl,%dl
807: .Li_4:
808: subl $4,%ebx
809: jne .Li_loop
810: jmp .Li_end
811:
812: /* Fast 8-bit version */
813: .Li_fast:
814: movl 24(%esp),%esi
815: xorl %edx,%edx
816: xorl %ecx,%ecx
817: FUNCTION_ALIGN
818: .Li_fast_loop:
819: movw (%esi),%edx
820: movw 2(%esi),%cx
821: movb (%edx,%ebp),%al
822: movw 4(%esi),%dx
823: movb 4096(%ebp,%ecx),%ah
824:
825: movw 6(%esi),%cx
826: sall $16,%eax
827: movb 8192(%ebp,%edx),%al
828:
829: movb 12288(%ebp,%ecx),%ah
830:
831: roll $16,%eax
832: movl %eax,(%edi)
833: addl $4,%edi
834: addl $8,%esi
835:
836: subl $4,%ebx
837: jne .Li_fast_loop
838:
839: .Li_end:
840: popl %ebx
841: popl %esi
842: popl %edi
843: popl %ebp
844: ret
845: #if 0
846: .globl compiler_do_rts
847: /* Entry: EDX == regs.regs + 15 */
848: compiler_do_rts:
849: movl (%edx),%esi
850: addl address_space,%esi
851: movl jsr_num,%ecx
852: movl (%esi),%esi
853: orl %ecx,%ecx
854: bswapl %esi
855: jz cdrts_noway
856: decl %ecx
857: cmpl jsr_rets(,%ecx,4),%esi
858: jne cdrts_noway
859: movl jsr_hash(,%ecx,4),%ebx
860: movl (%ebx),%ebx
861: orl %ebx,%ebx
862: jz cdrts_noway
863: addl $4,(%edx)
864: movl %ecx,jsr_num
865: jmp %ebx
866: cdrts_noway:
867: ret
868: #endif
869: #if 0
870: .globl longget_stub
871: longget_stub:
872: pushl %ecx
873: pushl %eax
874: pushl %edx
875: call SYM(longget)
876: popl %ecx
877: movl %eax,%ecx
878: popl %eax
879: ret
880:
881: .globl wordget_stub
882: wordget_stub:
883: pushl %ecx
884: pushl %eax
885: pushl %edx
886: call SYM(wordget)
887: popl %ecx
888: movl %eax,%ecx
889: popl %eax
890: ret
891:
892: .globl byteget_stub
893: byteget_stub:
894: pushl %ecx
895: pushl %eax
896: pushl %edx
897: call SYM(byteget)
898: popl %ecx
899: movl %eax,%ecx
900: popl %eax
901: ret
902:
903: .globl longput_stub
904: longput_stub:
905: pushl %ecx
906: pushl %eax
907: pushl %ebx
908: pushl %edx
909: call SYM(longput)
910: movl %eax,%ecx
911: addl $8,%esp
912: popl %eax
913: ret
914:
915: .globl wordput_stub
916: wordput_stub:
917: pushl %ecx
918: pushl %eax
919: pushl %ebx
920: pushl %edx
921: call SYM(wordput)
922: movl %eax,%ecx
923: addl $8,%esp
924: popl %eax
925: ret
926:
927: .globl byteput_stub
928: byteput_stub:
929: pushl %ecx
930: pushl %eax
931: pushl %ebx
932: pushl %edx
933: call SYM(byteput)
934: movl %eax,%ecx
935: addl $8,%esp
936: popl %eax
937: ret
938: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.