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.
     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 GLOBAL _ConvertMMX
    13 GLOBAL _mmxreturn
    14 
    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 	jmp [ebp+32]
    54 
    55 _mmxreturn:	
    56 	add esi,[ebp+12]
    57 	add edi,[ebp+28]
    58 	
    59 	dec dword  [ebp+8]
    60 	jnz y_loop
    61 
    62 	
    63 ; Restore the registers used by the blitters, necessary for optimized code
    64 	popa
    65 
    66 	pop ebp
    67 
    68 endconvert:
    69 	emms
    70 	
    71 	ret		
    72 
    73 
    74