From 5399a9ae8cde19758c928ecbe1684382ce1e890a Mon Sep 17 00:00:00 2001 From: ejcoumans Date: Fri, 1 Feb 2008 03:35:54 +0000 Subject: [PATCH] fixes to compile/share more code between SPU and PPU --- Extras/BulletMultiThreaded/SpuDoubleBuffer.h | 2 +- Extras/BulletMultiThreaded/SpuFakeDma.cpp | 8 ++++---- Extras/BulletMultiThreaded/SpuFakeDma.h | 2 +- .../SpuNarrowPhaseCollisionTask/SpuCollisionShapes.cpp | 1 + .../SpuNarrowPhaseCollisionTask/SpuContactResult.cpp | 1 - .../SpuGatheringCollisionTask.cpp | 2 +- src/BulletCollision/BroadphaseCollision/btDispatcher.h | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Extras/BulletMultiThreaded/SpuDoubleBuffer.h b/Extras/BulletMultiThreaded/SpuDoubleBuffer.h index 55740db4b..52d518d1a 100644 --- a/Extras/BulletMultiThreaded/SpuDoubleBuffer.h +++ b/Extras/BulletMultiThreaded/SpuDoubleBuffer.h @@ -9,7 +9,7 @@ template class DoubleBuffer { -#if defined(__CELLOS_LV2__) || defined(USE_LIBSPE2) +#if defined(__SPU__) || defined(USE_LIBSPE2) ATTRIBUTE_ALIGNED128( T m_buffer0[size] ) ; ATTRIBUTE_ALIGNED128( T m_buffer1[size] ) ; #else diff --git a/Extras/BulletMultiThreaded/SpuFakeDma.cpp b/Extras/BulletMultiThreaded/SpuFakeDma.cpp index f565a7ebd..872ab4775 100644 --- a/Extras/BulletMultiThreaded/SpuFakeDma.cpp +++ b/Extras/BulletMultiThreaded/SpuFakeDma.cpp @@ -22,7 +22,7 @@ void* cellDmaLargeGetReadOnly(void *ls, uint64_t ea, uint32_t size, uint32_t tag void* cellDmaSmallGetReadOnly(void *ls, uint64_t ea, uint32_t size, uint32_t tag, uint32_t tid, uint32_t rid) { -#if defined (__CELLOS_LV2__) || defined (USE_LIBSPE2) +#if defined (__SPU__) || defined (USE_LIBSPE2) mfc_get(ls,ea,size,tag,0,0); return ls; #else @@ -35,7 +35,7 @@ void* cellDmaSmallGetReadOnly(void *ls, uint64_t ea, uint32_t size, uint32_t tag void* cellDmaGetReadOnly(void *ls, uint64_t ea, uint32_t size, uint32_t tag, uint32_t tid, uint32_t rid) { -#if defined (__CELLOS_LV2__) || defined (USE_LIBSPE2) +#if defined (__SPU__) || defined (USE_LIBSPE2) cellDmaGet(ls,ea,size,tag,tid,rid); return ls; #else @@ -60,7 +60,7 @@ int stallingUnalignedDmaSmallGet(void *ls, uint64_t ea, uint32_t size) ///make sure last 4 bits are the same, for cellDmaSmallGet uint32_t last4BitsOffset = ea & 0x0f; char* tmpTarget = tmpBuffer + last4BitsOffset; -#if defined (__CELLOS_LV2__) || defined (USE_LIBSPE2) +#if defined (__SPU__) || defined (USE_LIBSPE2) mfc_get(tmpTarget,ea,size,DMA_TAG(1),0,0); #else //copy into final destination @@ -86,7 +86,7 @@ int stallingUnalignedDmaSmallGet(void *ls, uint64_t ea, uint32_t size) return 0; } -#if defined (__CELLOS_LV2__) || defined (USE_LIBSPE2) +#if defined (__SPU__) || defined (USE_LIBSPE2) #else int cellDmaLargeGet(void *ls, uint64_t ea, uint32_t size, uint32_t tag, uint32_t tid, uint32_t rid) diff --git a/Extras/BulletMultiThreaded/SpuFakeDma.h b/Extras/BulletMultiThreaded/SpuFakeDma.h index ad04377d4..3c4b5536a 100644 --- a/Extras/BulletMultiThreaded/SpuFakeDma.h +++ b/Extras/BulletMultiThreaded/SpuFakeDma.h @@ -7,7 +7,7 @@ #include "LinearMath/btScalar.h" -#ifdef __CELLOS_LV2__ +#ifdef __SPU__ #include #include diff --git a/Extras/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.cpp b/Extras/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.cpp index c7386f5d3..17f138692 100644 --- a/Extras/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.cpp +++ b/Extras/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.cpp @@ -13,6 +13,7 @@ subject to the following restrictions: 3. This notice may not be removed or altered from any source distribution. */ + #include "SpuCollisionShapes.h" btPoint3 localGetSupportingVertexWithoutMargin(int shapeType, void* shape, btVector3& localDir,struct SpuConvexPolyhedronVertexData* convexVertexData)//, int *featureIndex) diff --git a/Extras/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.cpp b/Extras/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.cpp index 7ebc54da9..4918f9566 100644 --- a/Extras/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.cpp +++ b/Extras/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.cpp @@ -15,7 +15,6 @@ subject to the following restrictions: #include "SpuContactResult.h" - //#define DEBUG_SPU_COLLISION_DETECTION 1 diff --git a/Extras/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp b/Extras/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp index 30987575a..0dc3b2bb8 100644 --- a/Extras/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp +++ b/Extras/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp @@ -28,7 +28,7 @@ #include "SpuCollisionShapes.h" //definition of SpuConvexPolyhedronVertexData -#ifdef __CELLOS_LV2__ +#ifdef __SPU__ ///Software caching from the IBM Cell SDK, it reduces 25% SPU time for our test cases #define USE_SOFTWARE_CACHE 1 #endif //__CELLOS_LV2__ diff --git a/src/BulletCollision/BroadphaseCollision/btDispatcher.h b/src/BulletCollision/BroadphaseCollision/btDispatcher.h index daea11f77..782497972 100644 --- a/src/BulletCollision/BroadphaseCollision/btDispatcher.h +++ b/src/BulletCollision/BroadphaseCollision/btDispatcher.h @@ -43,7 +43,7 @@ struct btDispatcherInfo m_useContinuous(false), m_debugDraw(0), m_enableSatConvex(false), - m_enableSPU(false), + m_enableSPU(true), m_stackAllocator(0) {