00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef neo_core_arch_h
00022 #define neo_core_arch_h
00023
00024 #include "platform.h"
00025
00029
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
00057 # undef NEO_ARCH_X86
00058 # define NEO_ARCH_X86 1
00059 # else
00060
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