src/hermes/mmx_main.asm
author Ben Avison <bavison@riscosopen.org>
Thu, 31 Oct 2019 14:00:28 +0300
branchSDL-1.2
changeset 13219 4f88e197acad
parent 5392 30e4d724fe98
permissions -rw-r--r--
ARM: Create configure option --enable-arm-neon to govern assembly optimizations
---
configure.in | 39 +++++++++++++++++++++++++++++++++++++++
include/SDL_config.h.in | 1 +
include/SDL_cpuinfo.h | 3 +++
src/cpuinfo/SDL_cpuinfo.c | 37 +++++++++++++++++++++++++++++++++++++
4 files changed, 80 insertions(+)
     1 ;
     2 ; mmx format converter main loops for HERMES
     3 ; Some routines Copyright (c) 1998 Christian Nentwich (c.nentwich@cs.ucl.ac.uk)
     4 ; This source code is licensed under the GNU LGPL
     5 ; 
     6 ; Please refer to the file COPYING.LIB contained in the distribution for
     7 ; licensing conditions		
     8 ;
     9 
    10 BITS 32
    11 
    12 %include "common.inc"
    13 
    14 SDL_FUNC _ConvertMMX
    15 
    16 SECTION .text
    17 		
    18 ;; _ConvertMMX:	 
    19 ;; [ESP+8] ConverterInfo*
    20 ;; --------------------------------------------------------------------------
    21 ;; ConverterInfo (ebp+..)
    22 ;;   0:	void *s_pixels
    23 ;;   4:	int s_width
    24 ;;   8:	int s_height
    25 ;;  12:	int s_add
    26 ;;  16:	void *d_pixels
    27 ;;  20:	int d_width
    28 ;;  24:	int d_height
    29 ;;  28:	int d_add
    30 ;;  32:	void (*converter_function)() 
    31 ;;  36: int32 *lookup
    32 	
    33 _ConvertMMX:
    34 	push ebp
    35 	mov ebp,esp
    36 
    37 ; Save the registers used by the blitters, necessary for optimized code
    38 	pusha
    39 
    40 	mov eax,[ebp+8]
    41 
    42         cmp dword [eax+4],BYTE 0
    43 	je endconvert
    44 	
    45 	mov ebp,eax
    46 	
    47 	mov esi,[ebp+0]
    48 	mov edi,[ebp+16]
    49 	
    50 y_loop:	
    51 	mov ecx,[ebp+4]
    52 
    53 	call [ebp+32]
    54 
    55 	add esi,[ebp+12]
    56 	add edi,[ebp+28]
    57 	
    58 	dec dword  [ebp+8]
    59 	jnz y_loop
    60 
    61 	
    62 ; Restore the registers used by the blitters, necessary for optimized code
    63 	popa
    64 
    65 	pop ebp
    66 
    67 endconvert:
    68 	emms
    69 	
    70 	ret		
    71 
    72 %ifidn __OUTPUT_FORMAT__,elf32
    73 section .note.GNU-stack noalloc noexec nowrite progbits
    74 %endif