src/hermes/x86_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(+)
slouken@0
     1
;
slouken@0
     2
; x86 format converters for HERMES
slouken@0
     3
; Some routines Copyright (c) 1998 Christian Nentwich (brn@eleet.mcb.at)
slouken@0
     4
; This source code is licensed under the GNU LGPL
slouken@0
     5
; 
slouken@0
     6
; Please refer to the file COPYING.LIB contained in the distribution for
slouken@0
     7
; licensing conditions		
slouken@0
     8
;
slouken@0
     9
; Most routines are (c) Glenn Fiedler (ptc@gaffer.org), used with permission
slouken@0
    10
; 
slouken@0
    11
slouken@0
    12
BITS 32
slouken@0
    13
slouken@1873
    14
%include "common.inc"
slouken@1871
    15
slouken@1871
    16
SDL_FUNC _ConvertX86
slouken@0
    17
slouken@0
    18
SECTION .text
slouken@0
    19
		
slouken@0
    20
;; _ConvertX86:	 
slouken@0
    21
;; [ESP+8] ConverterInfo*
slouken@0
    22
;; --------------------------------------------------------------------------
slouken@0
    23
;; ConverterInfo (ebp+..)
slouken@0
    24
;;   0:	void *s_pixels
slouken@0
    25
;;   4:	int s_width
slouken@0
    26
;;   8:	int s_height
slouken@0
    27
;;  12:	int s_add
slouken@0
    28
;;  16:	void *d_pixels
slouken@0
    29
;;  20:	int d_width
slouken@0
    30
;;  24:	int d_height
slouken@0
    31
;;  28:	int d_add
slouken@0
    32
;;  32:	void (*converter_function)() 
slouken@0
    33
;;  36: int32 *lookup
slouken@0
    34
	
slouken@0
    35
_ConvertX86:
slouken@0
    36
	push ebp
slouken@0
    37
	mov ebp,esp
slouken@0
    38
slouken@0
    39
; Save the registers used by the blitters, necessary for optimized code
slouken@0
    40
	pusha
slouken@0
    41
slouken@0
    42
	mov eax,[ebp+8]
slouken@0
    43
slouken@0
    44
        cmp dword [eax+4],BYTE 0
slouken@0
    45
	je endconvert
slouken@0
    46
	
slouken@0
    47
	mov ebp,eax
slouken@0
    48
	
slouken@0
    49
	mov esi,[ebp+0]
slouken@0
    50
	mov edi,[ebp+16]
slouken@0
    51
	
slouken@0
    52
y_loop:	
slouken@0
    53
	mov ecx,[ebp+4]
slouken@0
    54
icculus@3983
    55
	call [ebp+32]
slouken@0
    56
slouken@0
    57
	add esi,[ebp+12]
slouken@0
    58
	add edi,[ebp+28]
slouken@0
    59
	
slouken@0
    60
	dec dword  [ebp+8]
slouken@0
    61
	jnz y_loop
slouken@0
    62
slouken@0
    63
; Restore the registers used by the blitters, necessary for optimized code
slouken@0
    64
	popa
slouken@0
    65
	
slouken@0
    66
	pop ebp
slouken@0
    67
slouken@0
    68
endconvert:	
slouken@0
    69
	ret		
slouken@0
    70
slouken@0
    71
slouken@0
    72
slouken@5392
    73
%ifidn __OUTPUT_FORMAT__,elf32
icculus@1199
    74
section .note.GNU-stack noalloc noexec nowrite progbits
icculus@1199
    75
%endif