include/SDL_cpuinfo.h
author Sam Lantinga <slouken@libsdl.org>
Thu, 27 Jan 2011 16:51:47 -0800
changeset 5116 02b860cbc7ce
parent 5115 427998ff3bcf
child 5120 b3f075368b1f
permissions -rw-r--r--
Bump up the default cache line size.
slouken@739
     1
/*
slouken@739
     2
    SDL - Simple DirectMedia Layer
slouken@3697
     3
    Copyright (C) 1997-2010 Sam Lantinga
slouken@739
     4
slouken@739
     5
    This library is free software; you can redistribute it and/or
slouken@1312
     6
    modify it under the terms of the GNU Lesser General Public
slouken@739
     7
    License as published by the Free Software Foundation; either
slouken@1312
     8
    version 2.1 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@1312
    13
    Lesser General Public License for more details.
slouken@739
    14
slouken@1312
    15
    You should have received a copy of the GNU Lesser General Public
slouken@1312
    16
    License along with this library; if not, write to the Free Software
slouken@1312
    17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
slouken@739
    18
slouken@739
    19
    Sam Lantinga
slouken@739
    20
    slouken@libsdl.org
slouken@739
    21
*/
slouken@739
    22
slouken@1895
    23
/**
slouken@3407
    24
 *  \file SDL_cpuinfo.h
slouken@3407
    25
 *  
slouken@3407
    26
 *  CPU feature detection for SDL.
slouken@1895
    27
 */
slouken@739
    28
slouken@739
    29
#ifndef _SDL_cpuinfo_h
slouken@739
    30
#define _SDL_cpuinfo_h
slouken@739
    31
slouken@1402
    32
#include "SDL_stdinc.h"
slouken@1402
    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@1895
    37
/* *INDENT-OFF* */
slouken@739
    38
extern "C" {
slouken@1895
    39
/* *INDENT-ON* */
slouken@739
    40
#endif
slouken@739
    41
slouken@5116
    42
/* This is a guess for the cacheline size used for padding.
slouken@5116
    43
 * Most x86 processors have a 64 byte cache line.
slouken@5116
    44
 * The 64-bit PowerPC processors have a 128 byte cache line.
slouken@5116
    45
 * We'll use the larger value to be generally safe.
slouken@5115
    46
 */
slouken@5116
    47
#define SDL_CACHELINE_SIZE  128
slouken@5115
    48
slouken@3407
    49
/**
slouken@3579
    50
 *  This function returns the number of CPU cores available.
slouken@3579
    51
 */
slouken@3579
    52
extern DECLSPEC int SDLCALL SDL_GetCPUCount(void);
slouken@3579
    53
slouken@3579
    54
/**
slouken@3407
    55
 *  This function returns true if the CPU has the RDTSC instruction.
slouken@745
    56
 */
slouken@1426
    57
extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void);
slouken@745
    58
slouken@3407
    59
/**
slouken@3407
    60
 *  This function returns true if the CPU has MMX features.
slouken@739
    61
 */
slouken@1426
    62
extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void);
slouken@739
    63
slouken@3407
    64
/**
slouken@3407
    65
 *  This function returns true if the CPU has MMX Ext.\ features.
slouken@785
    66
 */
slouken@1426
    67
extern DECLSPEC SDL_bool SDLCALL SDL_HasMMXExt(void);
slouken@785
    68
slouken@3407
    69
/**
slouken@3407
    70
 *  This function returns true if the CPU has 3DNow!\ features.
slouken@739
    71
 */
slouken@1426
    72
extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void);
slouken@739
    73
slouken@3407
    74
/**
slouken@3407
    75
 *  This function returns true if the CPU has 3DNow!\ Ext.\ features.
slouken@785
    76
 */
slouken@1426
    77
extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNowExt(void);
slouken@785
    78
slouken@3407
    79
/**
slouken@3407
    80
 *  This function returns true if the CPU has SSE features.
slouken@739
    81
 */
slouken@1426
    82
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void);
slouken@739
    83
slouken@3407
    84
/**
slouken@3407
    85
 *  This function returns true if the CPU has SSE2 features.
slouken@785
    86
 */
slouken@1426
    87
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void);
slouken@785
    88
slouken@3407
    89
/**
slouken@3407
    90
 *  This function returns true if the CPU has AltiVec features.
slouken@778
    91
 */
slouken@1426
    92
extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void);
slouken@778
    93
slouken@739
    94
/* Ends C function definitions when using C++ */
slouken@739
    95
#ifdef __cplusplus
slouken@1895
    96
/* *INDENT-OFF* */
slouken@739
    97
}
slouken@1895
    98
/* *INDENT-ON* */
slouken@739
    99
#endif
slouken@739
   100
#include "close_code.h"
slouken@739
   101
slouken@739
   102
#endif /* _SDL_cpuinfo_h */
slouken@1895
   103
slouken@1895
   104
/* vi: set ts=4 sw=4 expandtab: */