include/SDL_cpuinfo.h
author Sam Lantinga <slouken@libsdl.org>
Tue, 06 Jan 2004 17:18:38 +0000
changeset 778 8ac3f46f9d09
parent 769 b8d311d90021
child 785 ca06a994f03c
permissions -rw-r--r--
Date: Tue, 6 Jan 2004 12:42:19 +0100
From: Max Horn
Subject: SDL_HasAltiVec; BUGS file

the attached patch adds SDL_HasAltiVec to SDL CVS. Note that at this
point, this only works on MacOSX (and maybe darwin). I don't know how
to properly add a test for e.g. Linux/PPC at this point. I found an
email which might help in doing so:
http://zebra.fh-weingarten.de/~maxi/html/mplayer-dev-eng/2003-01msg00783.html
However, since I have no way to test on a non-OSX PowerPC system, I am
not comfortable blindly adding such code... I just hope that if
somebody from the Linux/PPC (or FreeBSD/PPC, or whatever) community
notices this, they'll jump up and provide a patch for us ;-)
slouken@739
     1
/*
slouken@739
     2
    SDL - Simple DirectMedia Layer
slouken@769
     3
    Copyright (C) 1997-2004 Sam Lantinga
slouken@739
     4
slouken@739
     5
    This library is free software; you can redistribute it and/or
slouken@739
     6
    modify it under the terms of the GNU Library General Public
slouken@739
     7
    License as published by the Free Software Foundation; either
slouken@739
     8
    version 2 of the License, or (at your option) any later version.
slouken@739
     9
slouken@739
    10
    This library is distributed in the hope that it will be useful,
slouken@739
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@739
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@739
    13
    Library General Public License for more details.
slouken@739
    14
slouken@739
    15
    You should have received a copy of the GNU Library General Public
slouken@739
    16
    License along with this library; if not, write to the Free
slouken@739
    17
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
slouken@739
    18
slouken@739
    19
    Sam Lantinga
slouken@739
    20
    slouken@libsdl.org
slouken@739
    21
*/
slouken@739
    22
slouken@739
    23
#ifdef SAVE_RCSID
slouken@739
    24
static char rcsid =
slouken@739
    25
 "@(#) $Id$";
slouken@739
    26
#endif
slouken@739
    27
slouken@739
    28
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
slouken@739
    29
/* CPU feature detection for SDL                                       */
slouken@739
    30
slouken@739
    31
#ifndef _SDL_cpuinfo_h
slouken@739
    32
#define _SDL_cpuinfo_h
slouken@739
    33
slouken@739
    34
#include "begin_code.h"
slouken@739
    35
/* Set up for C function definitions, even when using C++ */
slouken@739
    36
#ifdef __cplusplus
slouken@739
    37
extern "C" {
slouken@739
    38
#endif
slouken@739
    39
slouken@745
    40
/* This function returns true if the CPU has the RDTSC instruction
slouken@745
    41
 */
slouken@745
    42
extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC();
slouken@745
    43
slouken@739
    44
/* This function returns true if the CPU has MMX features
slouken@739
    45
 */
slouken@739
    46
extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX();
slouken@739
    47
slouken@739
    48
/* This function returns true if the CPU has 3DNow features
slouken@739
    49
 */
slouken@739
    50
extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow();
slouken@739
    51
slouken@739
    52
/* This function returns true if the CPU has SSE features
slouken@739
    53
 */
slouken@739
    54
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE();
slouken@739
    55
slouken@778
    56
/* This function returns true if the CPU has AltiVec features
slouken@778
    57
 */
slouken@778
    58
extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec();
slouken@778
    59
slouken@739
    60
/* Ends C function definitions when using C++ */
slouken@739
    61
#ifdef __cplusplus
slouken@739
    62
}
slouken@739
    63
#endif
slouken@739
    64
#include "close_code.h"
slouken@739
    65
slouken@739
    66
#endif /* _SDL_cpuinfo_h */