IBM CELL SDK 3.0 fixes

This commit is contained in:
johnmccutchan
2008-02-28 00:07:00 +00:00
parent 6a59432ee8
commit 94586390b6
10 changed files with 74 additions and 28 deletions

View File

@@ -26,17 +26,6 @@ PROGRAM_ppu := CcdPhysicsDemo
###################################################################### ######################################################################
OBJS = CcdPhysicsDemo.o main.o OBJS = CcdPhysicsDemo.o main.o
IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi)
ifeq ("$(IBM_CELLSDK_VERSION)","3.0")
CELL_TOP ?= /opt/cell/sdk
CELL_SYSROOT = /opt/cell/sysroot
include $(CELL_TOP)/buildutils/make.footer
else
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
CELL_SYSROOT = $(CELL_TOP)/sysroot
include $(CELL_TOP)/make.footer
endif
######################################################################## ########################################################################
# Libraries, Include paths, Defines # Libraries, Include paths, Defines
@@ -52,6 +41,7 @@ SYS_LIBS := -lspe2 -lglut -lGLU -lGL -lm -lXext -lXmu -lX11
IMPORTS = $(ROOT)/lib/ibmsdk/bulletmultithreaded.a \ IMPORTS = $(ROOT)/lib/ibmsdk/bulletmultithreaded.a \
$(ROOT)/lib/ibmsdk/bulletopenglsupport.a \ $(ROOT)/lib/ibmsdk/bulletopenglsupport.a \
$(ROOT)/lib/ibmsdk/bulletdynamics.a \ $(ROOT)/lib/ibmsdk/bulletdynamics.a \
$(ROOT)/lib/ibmsdk/bulletconvexhull.a \
$(ROOT)/lib/ibmsdk/bulletcollision.a \ $(ROOT)/lib/ibmsdk/bulletcollision.a \
$(ROOT)/lib/ibmsdk/bulletmath.a $(ROOT)/lib/ibmsdk/bulletmath.a
@@ -64,7 +54,17 @@ INSTALL_FILES = $(PROGRAM_ppu)
# make.footer # make.footer
######################################################################## ########################################################################
IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi)
ifeq ("$(IBM_CELLSDK_VERSION)","3.0")
CELL_TOP ?= /opt/cell/sdk
# CELL_SYSROOT = $(CELL_TOP);
include $(CELL_TOP)/buildutils/make.footer
else
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
CELL_SYSROOT = $(CELL_TOP)/sysroot
include $(CELL_TOP)/make.footer
endif
$(PPMS): $(PPMS):
cp textures/$@ . cp textures/$@ .

View File

@@ -39,6 +39,7 @@ SYS_LIBS := -lspe2 -lglut -lGLU -lGL -lm -lXext -lXmu -lX11
IMPORTS = $(ROOT)/lib/ibmsdk/bulletmultithreaded.a \ IMPORTS = $(ROOT)/lib/ibmsdk/bulletmultithreaded.a \
$(ROOT)/lib/ibmsdk/bulletopenglsupport.a \ $(ROOT)/lib/ibmsdk/bulletopenglsupport.a \
$(ROOT)/lib/ibmsdk/bulletdynamics.a \ $(ROOT)/lib/ibmsdk/bulletdynamics.a \
$(ROOT)/lib/ibmsdk/bulletconvexhull.a \
$(ROOT)/lib/ibmsdk/bulletcollision.a \ $(ROOT)/lib/ibmsdk/bulletcollision.a \
$(ROOT)/lib/ibmsdk/bulletmath.a $(ROOT)/lib/ibmsdk/bulletmath.a

View File

@@ -38,6 +38,7 @@ SYS_LIBS := -lglut -lGLU -lGL -lm -lXext -lXmu -lX11
IMPORTS = $(ROOT)/lib/ibmsdk/bulletopenglsupport.a \ IMPORTS = $(ROOT)/lib/ibmsdk/bulletopenglsupport.a \
$(ROOT)/lib/ibmsdk/bulletdynamics.a \ $(ROOT)/lib/ibmsdk/bulletdynamics.a \
$(ROOT)/lib/ibmsdk/bulletconvexhull.a \
$(ROOT)/lib/ibmsdk/bulletcollision.a \ $(ROOT)/lib/ibmsdk/bulletcollision.a \
$(ROOT)/lib/ibmsdk/bulletmath.a $(ROOT)/lib/ibmsdk/bulletmath.a

View File

@@ -41,7 +41,7 @@ subject to the following restrictions:
#include "BulletCollision/CollisionShapes/btUniformScalingShape.h" #include "BulletCollision/CollisionShapes/btUniformScalingShape.h"
#include "BulletCollision/CollisionShapes/btStaticPlaneShape.h" #include "BulletCollision/CollisionShapes/btStaticPlaneShape.h"
/// ///
#include "btShapeHull.h" #include "ConvexHull/btShapeHull.h"
#include "LinearMath/btTransformUtil.h" #include "LinearMath/btTransformUtil.h"

View File

@@ -9,6 +9,7 @@ LIBRARY_ppu = bulletopenglsupport.a
#### Compiler flags #### Compiler flags
CPPFLAGS = -DUSE_LIBSPE2 \ CPPFLAGS = -DUSE_LIBSPE2 \
-I$(ROOT)/Extras/ \
-I$(ROOT)/src/ \ -I$(ROOT)/src/ \
-I$(SDKINC) \ -I$(SDKINC) \
-I$(HOST) -I$(HOST)

View File

@@ -9,14 +9,13 @@ IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi)
ifeq ("$(IBM_CELLSDK_VERSION)","3.0") ifeq ("$(IBM_CELLSDK_VERSION)","3.0")
CELL_TOP ?= /opt/cell/sdk CELL_TOP ?= /opt/cell/sdk
CELL_SYSROOT := /opt/cell/sysroot CELL_SYSROOT := /opt/cell/sysroot
include $(CELL_TOP)/buildutils/make.footer
else else
CELL_TOP ?= /opt/ibm/cell-sdk/prototype CELL_TOP ?= /opt/ibm/cell-sdk/prototype
CELL_SYSROOT := $(CELL_TOP)/sysroot CELL_SYSROOT := $(CELL_TOP)/sysroot
include $(CELL_TOP)/make.footer
endif endif
USE_CCACHE=ccache
RM=rm -f RM=rm -f
OUTDIR=./out OUTDIR=./out
DEBUGFLAG=-DNDEBUG DEBUGFLAG=-DNDEBUG
@@ -29,7 +28,7 @@ ifeq "$(__ARCH_BITS__)" "64"
else else
SPU_DEFFLAGS= -DUSE_LIBSPE2 -D__SPU__ SPU_DEFFLAGS= -DUSE_LIBSPE2 -D__SPU__
endif endif
SPU_GCC=/usr/bin/spu-gcc SPU_GCC=$(USE_CCACHE) /usr/bin/spu-gcc
SPU_INCLUDEDIR= -I. -I$(CELL_SYSROOT)/usr/spu/include -I../../src -I$(NARROWPHASEDIR) SPU_INCLUDEDIR= -I. -I$(CELL_SYSROOT)/usr/spu/include -I../../src -I$(NARROWPHASEDIR)
#SPU_CFLAGS= $(DEBUGFLAG) -W -Wall -Winline -Os -c -include spu_intrinsics.h -include stdbool.h #SPU_CFLAGS= $(DEBUGFLAG) -W -Wall -Winline -Os -c -include spu_intrinsics.h -include stdbool.h
SPU_CFLAGS= $(DEBUGFLAG) -W -Wall -Winline -O3 -mbranch-hints -fomit-frame-pointer -ftree-vectorize -finline-functions -ftree-vect-loop-version -ftree-loop-optimize -ffast-math -fno-rtti -fno-exceptions -c -include spu_intrinsics.h -include stdbool.h SPU_CFLAGS= $(DEBUGFLAG) -W -Wall -Winline -O3 -mbranch-hints -fomit-frame-pointer -ftree-vectorize -finline-functions -ftree-vect-loop-version -ftree-loop-optimize -ffast-math -fno-rtti -fno-exceptions -c -include spu_intrinsics.h -include stdbool.h
@@ -42,10 +41,10 @@ SYMBOLNAME=spu_program
ifeq "$(__ARCH_BITS__)" "64" ifeq "$(__ARCH_BITS__)" "64"
PPU_DEFFLAGS= -DUSE_LIBSPE2 -DUSE_ADDR64 PPU_DEFFLAGS= -DUSE_LIBSPE2 -DUSE_ADDR64
PPU_GCC=/usr/bin/ppu-gcc PPU_GCC=$(USE_CCACHE) /usr/bin/ppu-gcc
else else
PPU_DEFFLAGS= -DUSE_LIBSPE2 PPU_DEFFLAGS= -DUSE_LIBSPE2
PPU_GCC=/usr/bin/ppu32-gcc PPU_GCC=$(USE_CCACHE) /usr/bin/ppu32-gcc
endif endif
PPU_CFLAGS= $(ARCHITECTUREFLAG) $(DEBUGFLAG) -W -Wall -Winline -O3 -c -mabi=altivec -maltivec -include altivec.h -include stdbool.h PPU_CFLAGS= $(ARCHITECTUREFLAG) $(DEBUGFLAG) -W -Wall -Winline -O3 -c -mabi=altivec -maltivec -include altivec.h -include stdbool.h
@@ -67,6 +66,9 @@ SpuFakeDma : MakeOut
SpuContactManifoldCollisionAlgorithm_spu : MakeOut SpuContactManifoldCollisionAlgorithm_spu : MakeOut
$(SPU_GCC) $(SPU_DEFFLAGS) $(SPU_CFLAGS) $(SPU_INCLUDEDIR) -o $(OUTDIR)/$@.o SpuContactManifoldCollisionAlgorithm.cpp $(SPU_GCC) $(SPU_DEFFLAGS) $(SPU_CFLAGS) $(SPU_INCLUDEDIR) -o $(OUTDIR)/$@.o SpuContactManifoldCollisionAlgorithm.cpp
SpuCollisionShapes : MakeOut
$(SPU_GCC) $(SPU_DEFFLAGS) $(SPU_CFLAGS) $(SPU_INCLUDEDIR) -o $(OUTDIR)/$@.o $(NARROWPHASEDIR)/$@.cpp
SpuContactResult : MakeOut SpuContactResult : MakeOut
$(SPU_GCC) $(SPU_DEFFLAGS) $(SPU_CFLAGS) $(SPU_INCLUDEDIR) -o $(OUTDIR)/$@.o $(NARROWPHASEDIR)/$@.cpp $(SPU_GCC) $(SPU_DEFFLAGS) $(SPU_CFLAGS) $(SPU_INCLUDEDIR) -o $(OUTDIR)/$@.o $(NARROWPHASEDIR)/$@.cpp
@@ -130,7 +132,7 @@ SpuSampleTaskProcess : MakeOut
spu : SpuFakeDma SpuContactManifoldCollisionAlgorithm_spu SpuContactResult SpuTaskFile \ spu : SpuFakeDma SpuContactManifoldCollisionAlgorithm_spu SpuContactResult SpuTaskFile \
SpuGjkPairDetector SpuMinkowskiPenetrationDepthSolver SpuVoronoiSimplexSolver \ SpuGjkPairDetector SpuMinkowskiPenetrationDepthSolver SpuVoronoiSimplexSolver SpuCollisionShapes \
btPersistentManifold btOptimizedBvh btCollisionObject btTriangleCallback btTriangleIndexVertexArray \ btPersistentManifold btOptimizedBvh btCollisionObject btTriangleCallback btTriangleIndexVertexArray \
btStridingMeshInterface btAlignedAllocator btStridingMeshInterface btAlignedAllocator
$(SPU_GCC) -o $(OUTDIR)/spuCollision.elf \ $(SPU_GCC) -o $(OUTDIR)/spuCollision.elf \
@@ -138,6 +140,7 @@ spu : SpuFakeDma SpuContactManifoldCollisionAlgorithm_spu SpuContactResult SpuTa
$(OUTDIR)/SpuFakeDma.o \ $(OUTDIR)/SpuFakeDma.o \
$(OUTDIR)/SpuContactManifoldCollisionAlgorithm_spu.o \ $(OUTDIR)/SpuContactManifoldCollisionAlgorithm_spu.o \
$(OUTDIR)/SpuContactResult.o \ $(OUTDIR)/SpuContactResult.o \
$(OUTDIR)/SpuCollisionShapes.o \
$(OUTDIR)/SpuGjkPairDetector.o \ $(OUTDIR)/SpuGjkPairDetector.o \
$(OUTDIR)/SpuMinkowskiPenetrationDepthSolver.o \ $(OUTDIR)/SpuMinkowskiPenetrationDepthSolver.o \
$(OUTDIR)/SpuVoronoiSimplexSolver.o \ $(OUTDIR)/SpuVoronoiSimplexSolver.o \
@@ -148,7 +151,7 @@ spu : SpuFakeDma SpuContactManifoldCollisionAlgorithm_spu SpuContactResult SpuTa
$(OUTDIR)/btAlignedAllocator.o \ $(OUTDIR)/btAlignedAllocator.o \
$(SPU_LFLAGS) $(SPU_LIBRARIES) $(SPU_LFLAGS) $(SPU_LIBRARIES)
spu-embed : spu spu-embed : spu
$(SPU_EMBED) $(ARCHITECTUREFLAG) $(SYMBOLNAME) $(OUTDIR)/spuCollision.elf $(OUTDIR)/$@.o $(SPU_EMBED) $(ARCHITECTUREFLAG) $(SYMBOLNAME) $(OUTDIR)/spuCollision.elf $(OUTDIR)/$@.o
$(SPU_AR) -qcs $(LIBOUTDIR)/libspu.a $(OUTDIR)/$@.o $(SPU_AR) -qcs $(LIBOUTDIR)/libspu.a $(OUTDIR)/$@.o
@@ -164,13 +167,9 @@ ppu : SpuGatheringCollisionDispatcher SpuCollisionTaskProcess btThreadSupportInt
$(OUTDIR)/btThreadSupportInterface.o \ $(OUTDIR)/btThreadSupportInterface.o \
$(OUTDIR)/SpuContactManifoldCollisionAlgorithm.o $(OUTDIR)/SpuContactManifoldCollisionAlgorithm.o
all : spu-embed ppu
all : spu ppu clean:
all-embed : spu-embed ppu
clean :
$(RM) $(OUTDIR)/* ; $(RM) $(LIBOUTDIR)/libspu.a ; $(RM) $(LIBOUTDIR)/bulletmultithreaded.a $(RM) $(OUTDIR)/* ; $(RM) $(LIBOUTDIR)/libspu.a ; $(RM) $(LIBOUTDIR)/bulletmultithreaded.a

View File

@@ -9,13 +9,15 @@
#ifdef __SPU__ #ifdef __SPU__
#ifndef USE_LIBSPE2
#include <cell/dma.h> #include <cell/dma.h>
#include <stdint.h> #include <stdint.h>
#define DMA_TAG(xfer) (xfer + 1) #define DMA_TAG(xfer) (xfer + 1)
#define DMA_MASK(xfer) (1 << DMA_TAG(xfer)) #define DMA_MASK(xfer) (1 << DMA_TAG(xfer))
#elif defined(USE_LIBSPE2) #else // !USE_LIBSPE2
#define DMA_TAG(xfer) (xfer + 1) #define DMA_TAG(xfer) (xfer + 1)
#define DMA_MASK(xfer) (1 << DMA_TAG(xfer)) #define DMA_MASK(xfer) (1 << DMA_TAG(xfer))
@@ -88,7 +90,8 @@
#else #endif // USE_LIBSPE2
#else // !__SPU__
//Simulate DMA using memcpy or direct access on non-CELL platforms that don't have DMAs and SPUs (Win32, Mac, Linux etc) //Simulate DMA using memcpy or direct access on non-CELL platforms that don't have DMAs and SPUs (Win32, Mac, Linux etc)
//Potential to add networked simulation using this interface //Potential to add networked simulation using this interface

View File

@@ -30,8 +30,10 @@
#ifdef __SPU__ #ifdef __SPU__
///Software caching from the IBM Cell SDK, it reduces 25% SPU time for our test cases ///Software caching from the IBM Cell SDK, it reduces 25% SPU time for our test cases
#ifndef USE_LIBSPE2
#define USE_SOFTWARE_CACHE 1 #define USE_SOFTWARE_CACHE 1
#endif //__CELLOS_LV2__ #endif
#endif //__SPU__
//////////////////////////////////////////////// ////////////////////////////////////////////////
/// software caching /// software caching

View File

@@ -0,0 +1,38 @@
#### Source code Dirs
VPATH = ../
ROOT = ../../..
HOST = /usr/include
#### Library
LIBRARY_ppu = bulletconvexhull.a
#### Compiler flags
CPPFLAGS = -DUSE_LIBSPE2 \
-I$(ROOT)/Extras/ \
-I$(ROOT)/src/ \
-I$(SDKINC) \
-I$(HOST)
#### Optimization level flags
#CC_OPT_LEVEL = $(CC_OPT_LEVEL_DEBUG)
CC_OPT_LEVEL = -O3
##### Objects to be archived in lib
OBJS = \
btConvexHull.o \
btShapeHull.o
#### Install directories
INSTALL_DIR = $(ROOT)/lib/ibmsdk/
INSTALL_FILES = $(LIBRARY)
IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi)
ifeq ("$(IBM_CELLSDK_VERSION)","3.0")
CELL_TOP ?= /opt/cell/sdk
include $(CELL_TOP)/buildutils/make.footer
else
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
include $(CELL_TOP)/make.footer
endif

View File

@@ -49,6 +49,7 @@ btCollisionDispatcher.o \
btCollisionObject.o \ btCollisionObject.o \
btCollisionWorld.o \ btCollisionWorld.o \
btCompoundCollisionAlgorithm.o \ btCompoundCollisionAlgorithm.o \
btConvexPlaneCollisionAlgorithm.o \
btConvexConcaveCollisionAlgorithm.o \ btConvexConcaveCollisionAlgorithm.o \
btConvexConvexAlgorithm.o \ btConvexConvexAlgorithm.o \
btEmptyCollisionAlgorithm.o \ btEmptyCollisionAlgorithm.o \