src/hermes/mmx_main.asm
author Sam Lantinga <slouken@libsdl.org>
Sun, 21 Sep 2003 18:32:04 +0000
changeset 720 f90d80d68071
parent 0 74212992fb08
child 1166 da33b7e6d181
permissions -rw-r--r--
N Sep 17 8791 Sam Lantinga Re: tks source released
Date: Sun, 07 Sep 2003 02:51:58 +0200
From: Stephane Marchesin
Subject: [SDL] Two little patches

Compiling SDL with a recent gcc (gcc 3.3.1, 3.3 doesn't have this
behaviour) gives some nasty warnings :

SDL_blit_A.c: In function `BlitRGBtoRGBSurfaceAlpha128MMX':
SDL_blit_A.c:223: warning: integer constant is too large for "long" type
SDL_blit_A.c:225: warning: integer constant is too large for "long" type
SDL_blit_A.c:227: warning: integer constant is too large for "long" type
[...]

The first attached patch (longlongfix.patch) tells gcc to really treat
those constants as unsigned long long and not long.

The second patch (nasinclude.patch) fixes an include problem I had while
compiling nas audio : when the <audio/audiolib.h> file lies in
/usr/X11R6/include, a -I/usr/X11R6/include option is needed or the file
isn't found.
slouken@0
     1
;
slouken@0
     2
; mmx format converter main loops for HERMES
slouken@0
     3
; Some routines Copyright (c) 1998 Christian Nentwich (c.nentwich@cs.ucl.ac.uk)
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
slouken@0
    10
BITS 32
slouken@0
    11
slouken@0
    12
GLOBAL _ConvertMMX
slouken@0
    13
GLOBAL _mmxreturn
slouken@0
    14
slouken@0
    15
slouken@0
    16
SECTION .text
slouken@0
    17
		
slouken@0
    18
;; _ConvertMMX:	 
slouken@0
    19
;; [ESP+8] ConverterInfo*
slouken@0
    20
;; --------------------------------------------------------------------------
slouken@0
    21
;; ConverterInfo (ebp+..)
slouken@0
    22
;;   0:	void *s_pixels
slouken@0
    23
;;   4:	int s_width
slouken@0
    24
;;   8:	int s_height
slouken@0
    25
;;  12:	int s_add
slouken@0
    26
;;  16:	void *d_pixels
slouken@0
    27
;;  20:	int d_width
slouken@0
    28
;;  24:	int d_height
slouken@0
    29
;;  28:	int d_add
slouken@0
    30
;;  32:	void (*converter_function)() 
slouken@0
    31
;;  36: int32 *lookup
slouken@0
    32
	
slouken@0
    33
_ConvertMMX:
slouken@0
    34
	push ebp
slouken@0
    35
	mov ebp,esp
slouken@0
    36
slouken@0
    37
; Save the registers used by the blitters, necessary for optimized code
slouken@0
    38
	pusha
slouken@0
    39
slouken@0
    40
	mov eax,[ebp+8]
slouken@0
    41
slouken@0
    42
        cmp dword [eax+4],BYTE 0
slouken@0
    43
	je endconvert
slouken@0
    44
	
slouken@0
    45
	mov ebp,eax
slouken@0
    46
	
slouken@0
    47
	mov esi,[ebp+0]
slouken@0
    48
	mov edi,[ebp+16]
slouken@0
    49
	
slouken@0
    50
y_loop:	
slouken@0
    51
	mov ecx,[ebp+4]
slouken@0
    52
slouken@0
    53
	jmp [ebp+32]
slouken@0
    54
slouken@0
    55
_mmxreturn:	
slouken@0
    56
	add esi,[ebp+12]
slouken@0
    57
	add edi,[ebp+28]
slouken@0
    58
	
slouken@0
    59
	dec dword  [ebp+8]
slouken@0
    60
	jnz y_loop
slouken@0
    61
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
	emms
slouken@0
    70
	
slouken@0
    71
	ret		
slouken@0
    72
slouken@0
    73
slouken@0
    74