arch.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2004-2005 by Reality Rift Studios                       *
00003  *   http://www.realityrift.com  -  mattias@realityrift.com                *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 
00021 #ifndef neo_core_arch_h
00022 #define neo_core_arch_h
00023 
00024 #include "platform.h"
00025 
00029 /***  Only use C-style syntax (comments) in this file, as it gets included in C files in the engine (jpeg, png, vorbis, theora) ***/
00030 
00031 
00038 #define NEO_ARCH_X86 0
00039 #define NEO_ARCH_X86_64 0
00040 #define NEO_ARCH_PPC 0
00041 
00046 #define NEO_ARCH_BYTEORDER_LITTLEENDIAN 0
00047 #define NEO_ARCH_BYTEORDER_BIGENDIAN 0
00048 
00051 #define NEO_INTEL_INTRINSICS 0
00052 
00053 #if NEO_PLATFORM_WINDOWS
00054 
00055 #  if NEO_PLATFORM_WINDOWS_WIN32
00056 /*   We only support x86 on Win32 targets */
00057 #    undef  NEO_ARCH_X86
00058 #    define NEO_ARCH_X86 1
00059 #  else
00060 /*   We only support x86-64 on Win64 targets */
00061 #    undef  NEO_ARCH_X86_64
00062 #    define NEO_ARCH_X86_64 1
00063 #  endif
00064 
00065 #  undef  NEO_ARCH_BYTEORDER_LITTLEENDIAN
00066 #  define NEO_ARCH_BYTEORDER_LITTLEENDIAN 1
00067 
00068 #  if NEO_COMPILER_MSVC
00069 #    undef  NEO_INTEL_INTRINSICS
00070 #    define NEO_INTEL_INTRINSICS 1
00071 #  endif
00072 
00073 #elif NEO_PLATFORM_MACOSX
00074 
00075 #  ifdef __POWERPC__
00076 
00077 #    undef  NEO_ARCH_PPC
00078 #    define NEO_ARCH_PPC 1
00079 
00080 #    undef  NEO_ARCH_BYTEORDER_BIGENDIAN
00081 #    define NEO_ARCH_BYTEORDER_BIGENDIAN 1
00082 
00083 #  else
00084 
00085 #    undef  NEO_ARCH_X86
00086 #    define NEO_ARCH_X86 1
00087 
00088 #    undef  NEO_ARCH_BYTEORDER_LITTLEENDIAN
00089 #    define NEO_ARCH_BYTEORDER_LITTLEENDIAN 1
00090 
00091 #  endif
00092 
00093 #elif NEO_PLATFORM_LINUX
00094 
00095 #  ifdef __POWERPC__
00096 
00097 #    undef  NEO_ARCH_PPC
00098 #    define NEO_ARCH_PPC 1
00099 
00100 #    undef  NEO_ARCH_BYTEORDER_BIGENDIAN
00101 #    define NEO_ARCH_BYTEORDER_BIGENDIAN 1
00102 
00103 #  else
00104 #    if defined __x86_64__
00105 #      undef  NEO_ARCH_X86_64
00106 #      define NEO_ARCH_X86_64 1
00107 #    else
00108 #      undef  NEO_ARCH_X86
00109 #      define NEO_ARCH_X86 1
00110 #    endif
00111 #    undef  NEO_ARCH_BYTEORDER_LITTLEENDIAN
00112 #    define NEO_ARCH_BYTEORDER_LITTLEENDIAN 1
00113 #  endif
00114 
00115 #else
00116 #  error Unsupported platform
00117 #endif
00118 
00119 #ifdef __cplusplus
00120 
00121 namespace neo {
00122 namespace core {
00123 
00128 enum Architecture
00129 {
00131     ARCHITECTURE_X86          = 0,
00132 
00134     ARCHITECTURE_X86_64       = 1,
00135 
00137     ARCHITECTURE_PPC          = 2
00138 };
00139 
00144 enum Byteorder
00145 {
00147     BYTEORDER_LITTLEENDIAN = 0,
00148 
00150     BYTEORDER_BIGENDIAN    = 1
00151 };
00152 
00156 enum CPUCaps
00157 {
00159     CPUCAPS_MMX                        = 0x00000001,
00160 
00162     CPUCAPS_FXSR                       = 0x00000002,
00163 
00165     CPUCAPS_SSE                        = 0x00000004,
00166 
00168     CPUCAPS_SSE2                       = 0x00000008,
00169 
00171     CPUCAPS_3DNOW                      = 0x00000010,
00172 
00174     CPUCAPS_3DNOWEX                    = 0x00000020,
00175 
00177     CPUCAPS_ALTIVEC                    = 0x00000040,
00178 
00180     CPUCAPS_SSE3                       = 0x00000080
00181 };
00182 
00183 }
00184 }
00185 
00186 #endif
00187 
00188 #endif
00189 

Generated on Sat Feb 17 20:50:47 2007 for NeoEngine 2 - Evolution by  doxygen 1.5.1