Mercurial > sdl-ios-xcode
comparison src/hermes/x86p_32.asm @ 3983:540466e900db SDL-1.2
Removed textrels from hermes code.
Partially fixes Bugzilla #418.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Wed, 27 Jun 2007 10:12:49 +0000 |
parents | eb4d9d99849b |
children |
comparison
equal
deleted
inserted
replaced
3982:0a0f8cccc77c | 3983:540466e900db |
---|---|
22 SDL_FUNC _ConvertX86p32_16BGR565 | 22 SDL_FUNC _ConvertX86p32_16BGR565 |
23 SDL_FUNC _ConvertX86p32_16RGB555 | 23 SDL_FUNC _ConvertX86p32_16RGB555 |
24 SDL_FUNC _ConvertX86p32_16BGR555 | 24 SDL_FUNC _ConvertX86p32_16BGR555 |
25 SDL_FUNC _ConvertX86p32_8RGB332 | 25 SDL_FUNC _ConvertX86p32_8RGB332 |
26 | 26 |
27 EXTERN _x86return | |
28 | |
29 SECTION .text | 27 SECTION .text |
30 | 28 |
31 ;; _Convert_* | 29 ;; _Convert_* |
32 ;; Paramters: | 30 ;; Paramters: |
33 ;; ESI = source | 31 ;; ESI = source |
51 add esi,BYTE 4 | 49 add esi,BYTE 4 |
52 add edi,BYTE 4 | 50 add edi,BYTE 4 |
53 dec ecx | 51 dec ecx |
54 jnz .L1 | 52 jnz .L1 |
55 .L2 | 53 .L2 |
56 jmp _x86return | 54 retn |
57 | 55 |
58 .L3 ; save ebp | 56 .L3 ; save ebp |
59 push ebp | 57 push ebp |
60 | 58 |
61 ; unroll four times | 59 ; unroll four times |
111 add edi,BYTE 4 | 109 add edi,BYTE 4 |
112 dec ecx | 110 dec ecx |
113 jnz .L5 | 111 jnz .L5 |
114 | 112 |
115 .L6 pop ebp | 113 .L6 pop ebp |
116 jmp _x86return | 114 retn |
117 | 115 |
118 | 116 |
119 | 117 |
120 | 118 |
121 _ConvertX86p32_32RGBA888: | 119 _ConvertX86p32_32RGBA888: |
131 add esi,BYTE 4 | 129 add esi,BYTE 4 |
132 add edi,BYTE 4 | 130 add edi,BYTE 4 |
133 dec ecx | 131 dec ecx |
134 jnz .L1 | 132 jnz .L1 |
135 .L2 | 133 .L2 |
136 jmp _x86return | 134 retn |
137 | 135 |
138 .L3 ; save ebp | 136 .L3 ; save ebp |
139 push ebp | 137 push ebp |
140 | 138 |
141 ; unroll four times | 139 ; unroll four times |
182 add edi,BYTE 4 | 180 add edi,BYTE 4 |
183 dec ecx | 181 dec ecx |
184 jnz .L5 | 182 jnz .L5 |
185 | 183 |
186 .L6 pop ebp | 184 .L6 pop ebp |
187 jmp _x86return | 185 retn |
188 | 186 |
189 | 187 |
190 | 188 |
191 | 189 |
192 _ConvertX86p32_32BGRA888: | 190 _ConvertX86p32_32BGRA888: |
202 add esi,BYTE 4 | 200 add esi,BYTE 4 |
203 add edi,BYTE 4 | 201 add edi,BYTE 4 |
204 dec ecx | 202 dec ecx |
205 jnz .L1 | 203 jnz .L1 |
206 .L2 | 204 .L2 |
207 jmp _x86return | 205 retn |
208 | 206 |
209 .L3 ; save ebp | 207 .L3 ; save ebp |
210 push ebp | 208 push ebp |
211 | 209 |
212 ; unroll four times | 210 ; unroll four times |
255 add edi,BYTE 4 | 253 add edi,BYTE 4 |
256 dec ecx | 254 dec ecx |
257 jnz .L5 | 255 jnz .L5 |
258 | 256 |
259 .L6 pop ebp | 257 .L6 pop ebp |
260 jmp _x86return | 258 retn |
261 | 259 |
262 | 260 |
263 | 261 |
264 | 262 |
265 ;; 32 bit RGB 888 to 24 BIT RGB 888 | 263 ;; 32 bit RGB 888 to 24 BIT RGB 888 |
280 add esi,BYTE 4 | 278 add esi,BYTE 4 |
281 add edi,BYTE 3 | 279 add edi,BYTE 3 |
282 dec ecx | 280 dec ecx |
283 jnz .L1 | 281 jnz .L1 |
284 .L2 | 282 .L2 |
285 jmp _x86return | 283 retn |
286 | 284 |
287 .L3 ; head | 285 .L3 ; head |
288 mov edx,edi | 286 mov edx,edi |
289 and edx,BYTE 11b | 287 and edx,BYTE 11b |
290 jz .L4 | 288 jz .L4 |
352 add edi,BYTE 3 | 350 add edi,BYTE 3 |
353 dec ecx | 351 dec ecx |
354 jnz .L6 | 352 jnz .L6 |
355 | 353 |
356 .L7 pop ebp | 354 .L7 pop ebp |
357 jmp _x86return | 355 retn |
358 | 356 |
359 | 357 |
360 | 358 |
361 | 359 |
362 ;; 32 bit RGB 888 to 24 bit BGR 888 | 360 ;; 32 bit RGB 888 to 24 bit BGR 888 |
378 add esi,BYTE 4 | 376 add esi,BYTE 4 |
379 add edi,BYTE 3 | 377 add edi,BYTE 3 |
380 dec ecx | 378 dec ecx |
381 jnz .L1 | 379 jnz .L1 |
382 .L2 | 380 .L2 |
383 jmp _x86return | 381 retn |
384 | 382 |
385 .L3 ; head | 383 .L3 ; head |
386 mov edx,edi | 384 mov edx,edi |
387 and edx,BYTE 11b | 385 and edx,BYTE 11b |
388 jz .L4 | 386 jz .L4 |
453 dec ecx | 451 dec ecx |
454 jnz .L6 | 452 jnz .L6 |
455 | 453 |
456 .L7 | 454 .L7 |
457 pop ebp | 455 pop ebp |
458 jmp _x86return | 456 retn |
459 | 457 |
460 | 458 |
461 | 459 |
462 | 460 |
463 ;; 32 bit RGB 888 to 16 BIT RGB 565 | 461 ;; 32 bit RGB 888 to 16 BIT RGB 565 |
482 add edi,BYTE 2 | 480 add edi,BYTE 2 |
483 dec ecx | 481 dec ecx |
484 jnz .L1 | 482 jnz .L1 |
485 | 483 |
486 .L2: ; End of short loop | 484 .L2: ; End of short loop |
487 jmp _x86return | 485 retn |
488 | 486 |
489 | 487 |
490 .L3 ; head | 488 .L3 ; head |
491 mov ebx,edi | 489 mov ebx,edi |
492 and ebx,BYTE 11b | 490 and ebx,BYTE 11b |
568 mov [edi+1],ah | 566 mov [edi+1],ah |
569 add esi,BYTE 4 | 567 add esi,BYTE 4 |
570 add edi,BYTE 2 | 568 add edi,BYTE 2 |
571 | 569 |
572 .L7: | 570 .L7: |
573 jmp _x86return | 571 retn |
574 | 572 |
575 | 573 |
576 | 574 |
577 | 575 |
578 ;; 32 bit RGB 888 to 16 BIT BGR 565 | 576 ;; 32 bit RGB 888 to 16 BIT BGR 565 |
597 add esi,BYTE 4 | 595 add esi,BYTE 4 |
598 add edi,BYTE 2 | 596 add edi,BYTE 2 |
599 dec ecx | 597 dec ecx |
600 jnz .L1 | 598 jnz .L1 |
601 .L2 | 599 .L2 |
602 jmp _x86return | 600 retn |
603 | 601 |
604 .L3 ; head | 602 .L3 ; head |
605 mov ebx,edi | 603 mov ebx,edi |
606 and ebx,BYTE 11b | 604 and ebx,BYTE 11b |
607 jz .L4 | 605 jz .L4 |
682 mov [edi+1],ah | 680 mov [edi+1],ah |
683 add esi,BYTE 4 | 681 add esi,BYTE 4 |
684 add edi,BYTE 2 | 682 add edi,BYTE 2 |
685 | 683 |
686 .L7 | 684 .L7 |
687 jmp _x86return | 685 retn |
688 | 686 |
689 | 687 |
690 | 688 |
691 | 689 |
692 ;; 32 BIT RGB TO 16 BIT RGB 555 | 690 ;; 32 BIT RGB TO 16 BIT RGB 555 |
711 add esi,BYTE 4 | 709 add esi,BYTE 4 |
712 add edi,BYTE 2 | 710 add edi,BYTE 2 |
713 dec ecx | 711 dec ecx |
714 jnz .L1 | 712 jnz .L1 |
715 .L2 | 713 .L2 |
716 jmp _x86return | 714 retn |
717 | 715 |
718 .L3 ; head | 716 .L3 ; head |
719 mov ebx,edi | 717 mov ebx,edi |
720 and ebx,BYTE 11b | 718 and ebx,BYTE 11b |
721 jz .L4 | 719 jz .L4 |
793 mov [edi+1],ah | 791 mov [edi+1],ah |
794 add esi,BYTE 4 | 792 add esi,BYTE 4 |
795 add edi,BYTE 2 | 793 add edi,BYTE 2 |
796 | 794 |
797 .L7 | 795 .L7 |
798 jmp _x86return | 796 retn |
799 | 797 |
800 | 798 |
801 | 799 |
802 | 800 |
803 ;; 32 BIT RGB TO 16 BIT BGR 555 | 801 ;; 32 BIT RGB TO 16 BIT BGR 555 |
823 add esi,BYTE 4 | 821 add esi,BYTE 4 |
824 add edi,BYTE 2 | 822 add edi,BYTE 2 |
825 dec ecx | 823 dec ecx |
826 jnz .L1 | 824 jnz .L1 |
827 .L2 | 825 .L2 |
828 jmp _x86return | 826 retn |
829 | 827 |
830 .L3 ; head | 828 .L3 ; head |
831 mov ebx,edi | 829 mov ebx,edi |
832 and ebx,BYTE 11b | 830 and ebx,BYTE 11b |
833 jz .L4 | 831 jz .L4 |
908 mov [edi+1],ah | 906 mov [edi+1],ah |
909 add esi,BYTE 4 | 907 add esi,BYTE 4 |
910 add edi,BYTE 2 | 908 add edi,BYTE 2 |
911 | 909 |
912 .L7 | 910 .L7 |
913 jmp _x86return | 911 retn |
914 | 912 |
915 | 913 |
916 | 914 |
917 | 915 |
918 | 916 |
1038 | 1036 |
1039 dec ecx | 1037 dec ecx |
1040 jnz .L3 | 1038 jnz .L3 |
1041 | 1039 |
1042 .L4: | 1040 .L4: |
1043 jmp _x86return | 1041 retn |
1044 | 1042 |
1045 %ifidn __OUTPUT_FORMAT__,elf | 1043 %ifidn __OUTPUT_FORMAT__,elf |
1046 section .note.GNU-stack noalloc noexec nowrite progbits | 1044 section .note.GNU-stack noalloc noexec nowrite progbits |
1047 %endif | 1045 %endif |