src/hermes/HeadMMX.h
author Sam Lantinga <slouken@libsdl.org>
Sun, 21 Sep 2003 18:32:04 +0000
changeset 720 f90d80d68071
parent 0 74212992fb08
child 1197 bb5ace455586
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    Header definitions for the MMX routines for the HERMES library
     3    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 #ifndef __HERMES_HEAD_MMX__
    11 #define __HERMES_HEAD_MMX__
    12 
    13 
    14 /* If you cannot stand ifdefs, then please do not look into this file, it's
    15    going to end your life :) */
    16 
    17 #ifdef X86_ASSEMBLER
    18 
    19 
    20 #ifdef __cplusplus
    21 extern "C" {
    22 #endif
    23 
    24 void STACKCALL ConvertMMX(HermesConverterInterface *);
    25 
    26 void STACKCALL ClearMMX_32(HermesClearInterface *);
    27 void STACKCALL ClearMMX_24(HermesClearInterface *);
    28 void STACKCALL ClearMMX_16(HermesClearInterface *);
    29 void STACKCALL ClearMMX_8(HermesClearInterface *);
    30 
    31 void ConvertMMXpII32_24RGB888();
    32 void ConvertMMXpII32_16RGB565();
    33 void ConvertMMXpII32_16BGR565();
    34 void ConvertMMXpII32_16RGB555();
    35 void ConvertMMXpII32_16BGR565();
    36 void ConvertMMXpII32_16BGR555();
    37 
    38 void ConvertMMXp32_16RGB555();
    39 
    40 #ifdef __cplusplus
    41 }
    42 #endif
    43 
    44 
    45 
    46 /* Fix the underscore business with ELF compilers */
    47 
    48 #if defined(__ELF__) && defined(__GNUC__)
    49   #ifdef __cplusplus 
    50   extern "C" {   
    51   #endif
    52 
    53   void ConvertMMX(HermesConverterInterface *) __attribute__ ((alias ("_ConvertMMX")));
    54 #if 0
    55   void ClearMMX_32(HermesClearInterface *) __attribute__ ((alias ("_ClearMMX_32")));
    56   void ClearMMX_24(HermesClearInterface *)  __attribute__ ((alias ("_ClearMMX_24")));
    57   void ClearMMX_16(HermesClearInterface *)  __attribute__ ((alias ("_ClearMMX_16")));
    58   void ClearMMX_8(HermesClearInterface *)  __attribute__ ((alias ("_ClearMMX_8")));
    59 
    60   void ConvertMMXp32_16RGB555() __attribute__ ((alias ("_ConvertMMXp32_16RGB555")));
    61 #endif
    62 
    63   void ConvertMMXpII32_24RGB888() __attribute__ ((alias ("_ConvertMMXpII32_24RGB888")));
    64   void ConvertMMXpII32_16RGB565() __attribute__ ((alias ("_ConvertMMXpII32_16RGB565")));
    65   void ConvertMMXpII32_16BGR565() __attribute__ ((alias ("_ConvertMMXpII32_16BGR565")));
    66   void ConvertMMXpII32_16RGB555() __attribute__ ((alias ("_ConvertMMXpII32_16RGB555")));
    67   void ConvertMMXpII32_16BGR555() __attribute__ ((alias ("_ConvertMMXpII32_16BGR555")));
    68 
    69   #ifdef __cplusplus
    70   }
    71   #endif
    72 
    73 #endif /* ELF and GNUC */
    74 
    75 
    76 
    77 
    78 /* Make it work with Watcom */
    79 #ifdef __WATCOMC__
    80 #pragma warning 601 9
    81 
    82 #pragma aux ConvertMMX "_*" modify [EAX EBX ECX EDX ESI EDI]
    83 
    84 #pragma aux ClearMMX_32 "_*" modify [EAX EBX ECX EDX ESI EDI]
    85 #pragma aux ClearMMX_24 "_*" modify [EAX EBX ECX EDX ESI EDI]
    86 #pragma aux ClearMMX_16 "_*" modify [EAX EBX ECX EDX ESI EDI]
    87 #pragma aux ClearMMX_8 "_*" modify [EAX EBX ECX EDX ESI EDI]
    88 
    89 #pragma aux ConvertMMXpII32_24RGB888 "_*"
    90 #pragma aux ConvertMMXpII32_16RGB565 "_*"
    91 #pragma aux ConvertMMXpII32_16BGR565 "_*"
    92 #pragma aux ConvertMMXpII32_16RGB555 "_*"
    93 #pragma aux ConvertMMXpII32_16BGR555 "_*"
    94 #pragma aux ConvertMMXp32_16RGB555 "_*"
    95 
    96 #endif /* WATCOM */
    97 
    98 #endif /* X86_ASSEMBLER */
    99 
   100 
   101 #endif