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