Browse Source

Added support for AMD Chips

Vincent Gee 10 years ago
parent
commit
ff7f48be6f

+ 4 - 1
Engine/source/platform/platform.h

@@ -74,6 +74,9 @@ enum ProcessorType
    CPU_AMD_K6_2,
    CPU_AMD_K6_3,
    CPU_AMD_Athlon,
+   CPU_AMD_Phenom,
+   CPU_AMD_PhenomII,
+   CPU_AMD_Bulldozer,
    CPU_AMD_Unknown,
    CPU_Cyrix_6x86,
    CPU_Cyrix_MediaGX,
@@ -510,7 +513,7 @@ extern void* dRealloc_r(void* in_pResize, dsize_t in_size, const char*, const ds
 extern void* dRealMalloc(dsize_t);
 extern void  dRealFree(void*);
 
-extern void *dMalloc_aligned(dsize_t in_size, S32 alignment);
+extern void *dMalloc_aligned(dsize_t in_size, intptr_t alignment);
 extern void dFree_aligned(void *);
 
 

+ 2 - 2
Engine/source/platform/platformAssert.h

@@ -92,8 +92,8 @@ public:
       exit conditions.
     */
    #define AssertFatal(x, y)         \
-         { if (((bool)(x))==(bool)0) \
-            { if ( ::PlatformAssert::processAssert(::PlatformAssert::Fatal, __FILE__, __LINE__,  y) ) { ::Platform::debugBreak(); } } }
+      { if (((bool)(x))==false) \
+         { if ( ::PlatformAssert::processAssert(::PlatformAssert::Fatal, __FILE__, __LINE__,  y) ) { ::Platform::debugBreak(); } } } 
 
 #else
    #define AssertFatal(x, y)   { TORQUE_UNUSED(x); TORQUE_UNUSED(y); }

+ 21 - 0
Engine/source/platform/platformCPU.cpp

@@ -178,6 +178,9 @@ void SetProcessorInfo(Platform::SystemInfo_struct::Processor& pInfo,
          pInfo.properties |= (properties & BIT_SSE) ? CPU_PROP_SSE : 0;
          pInfo.properties |= ( properties & BIT_SSE2 ) ? CPU_PROP_SSE2 : 0;
          pInfo.properties |= (properties & BIT_3DNOW) ? CPU_PROP_3DNOW : 0;
+		 // Phenom and PhenomII support SSE3, SSE4a
+		 pInfo.properties |= ( properties2 & BIT_SSE3 ) ? CPU_PROP_SSE3 : 0;
+         pInfo.properties |= ( properties2 & BIT_SSE4_1 ) ? CPU_PROP_SSE4_1 : 0;
          // switch on processor family code
          switch ((processor >> 8) & 0xf)
          {
@@ -223,6 +226,24 @@ void SetProcessorInfo(Platform::SystemInfo_struct::Processor& pInfo,
                pInfo.name = StringTable->insert("AMD Athlon");
                break;
 
+               // Phenom Family
+			case 15:
+               pInfo.type = CPU_AMD_Phenom;
+               pInfo.name = StringTable->insert("AMD Phenom");
+               break;
+
+			   // Phenom II Family
+			case 16:
+               pInfo.type = CPU_AMD_PhenomII;
+               pInfo.name = StringTable->insert("AMD Phenom II");
+               break;
+
+			   // Bulldozer Family
+			case 17:
+               pInfo.type = CPU_AMD_Bulldozer;
+               pInfo.name = StringTable->insert("AMD Bulldozer");
+               break;
+
             default:
                pInfo.type = CPU_AMD_Unknown;
                pInfo.name = StringTable->insert("AMD (unknown)");