Programming the Cell Processor: For Games, Graphics, and Computation

Book description

Make the Most of IBM’s Breakthrough Cell Processor in Any Gaming, Graphics, or Scientific Application

IBM’s Cell processor delivers truly stunning computational power: enough to satisfy even the most demanding gamers and graphics developers. That’s why Sony chose the Cell to drive its breakthrough PlayStation 3 and why Cell processors are at the heart of today’s most powerful supercomputers. But many developers have struggled to create high-performance Cell applications: the practical, coherent information they need simply hasn’t existed.

Programming the Cell Processor solves that problem once and for all. Whether you’re a game developer, graphics programmer, or engineer, Matthew Scarpino shows you how to create applications that leverage all the Cell’s extraordinary power. Scarpino covers everything from the Cell’s advanced architecture to its powerful tools and libraries, presenting realistic code examples that help you gain an increasingly deep and intuitive understanding of Cell development.

Scarpino illuminates each of the Cell’s most important technical innovations, introduces the commands needed to access its power, and walks you through the entire development process, including compiling, linking, debugging, and simulating code. He also offers start-to-finish case studies for three especially important Cell applications: games, graphics, and scientific computing. The Cell platform offers unprecedented potential, and this book will help you make the most of it.

  • Mastering the Cell SDK, including the GCC-based buildchain, ppu-gdb/spu-gdb debuggers, IBM Full System Simulator, and Cell IDE

  • Understanding the Cell’s central processing core, the PowerPC Processor Unit (PPU): structure, programming libraries, and AltiVec instructions

  • Programming the Synergistic Processor Unit (SPU): vector processing, communication, caching, assembler coding, and more

  • Leveraging SDK vector and matrix libraries, including the Large Matrix Library, BLAS Library, FFT libraries, Multiprecision Library, and Monte Carlo API

  • Coding basic 2D graphics using the Linux frame buffer

  • Building 3D graphics with the new Gallium OpenGL library 

  • Constructing 3D games with Ogre3D and packaging them using Collada digital content interchange

  • Optimizing the performance of your Cell applications

  • Developing on standard PCs and transferring code to Cell systems such as the PlayStation 3

  • Foreword xv

    Preface xvii

    Chapter 1: Introducing the Cell Processor 1

    Part I: The Software Development Tools 13

    Chapter 2: The Cell Software Development Kit (SDK) 15

    Chapter 3: Building Applications for the Cell Processor 35

    Chapter 4: Debugging and Simulating Applications 53

    Chapter 5: The Cell SDK Integrated Development Environment 83

    Part II: The PowerPC Processor Element (PPE) 97

    Chapter 6: Introducing the PowerPC Processor Unit (PPU) 99

    Chapter 7: The SPE Runtime Management Library (libspe) 125

    Chapter 8: SIMD Programming on the PPU, Part 1: Vector Libraries and Functions 153

    Chapter 9: SIMD Programming on the PPU, Part 2: Methods and Algorithms 195

    Part III: The Synergistic Processor Element (SPE) 217

    Chapter 10: Introducing the Synergistic Processor Unit (SPU) 219

    Chapter 11: SIMD Programming on the SPU 239

    Chapter 12: SPU Communication, Part 1: Direct Memory Access (DMA) 285

    Chapter 13: SPU Communication, Part 2: Events, Signals, and Mailboxes 317

    Chapter 14: Advanced SPU Topics: Overlays, Software Caching, and SPU Isolation 345

    Chapter 15: SPU Assembly Language 367

    Part IV: Mathematics and Computation 409

    Chapter 16: Vectors and Matrices 411

    Chapter 17: The Fast Fourier Transform (FFT) 439

    Chapter 18: Multiprecision Processing and Monte Carlo Methods 463

    Part V: Graphics and Games 489

    Chapter 19: Programming the Frame Buffer: Linux and the PlayStation 3 491

    Chapter 20: OpenGL on the Cell: Gallium and Mesa 503

    Chapter 21: Building Games with Ogre3D 529

    Chapter 22: Packaging Graphics with COLLADA 559

    Epilogue 581

    Part VI: Appendices 583

    Appendix A: Understanding ELF Files 585

    Appendix B: Updating the PS3 Add-On Packages and Installing a New Linux Kernel 609

    Appendix C: The Accelerated Library Framework (ALF) 617

    Appendix D: SPU Instruction Set Reference 649

    Appendix E: A Brief Introduction to Tcl 661

    Index 669

    Table of contents

    1. Title Page
    2. Copyright Page
    3. Dedication
    4. Contents at a Glance
    5. Table of Contents
    6. Foreword
    7. Preface
    8. Acknowledgments
    9. About the Author
    10. 1. Introducing the Cell Processor
    11. I: The Software Development Tools
      1. 2. The Cell Software Development Kit (SDK)
      2. 3. Building Applications for the Cell Processor
      3. 4. Debugging and Simulating Applications
      4. 5. The Cell SDK Integrated Development Environment
    12. II: The PowerPC Processor Element (PPE)
      1. 6. Introducing the PowerPC Processor Unit (PPU)
      2. 7. The SPE Runtime Management Library (libspe)
      3. 8. SIMD Programming on the PPU, Part 1: Vector Libraries and Functions
      4. 9. SIMD Programming on the PPU, Part 2: Methods and Algorithms
    13. III: The Synergistic Processor Element (SPE)
      1. 10. Introducing the Synergistic Processor Unit (SPU)
      2. 11. SIMD Programming on the SPU
      3. 12. SPU Communication, Part 1: Direct Memory Access (DMA)
      4. 13. SPU Communication, Part 2: Events, Signals, Mailboxes
      5. 14. Advanced SPU Topics: Overlays, Software Caching, and SPU Isolation
      6. 15. SPU Assembly Language
    14. IV: Mathematics and Computation
      1. 16. Vectors and Matrices
      2. 17. The Fast Fourier Transform (FFT)
      3. 18. Multiprecision Processing and Monte Carlo Methods
    15. V: Graphics and Games
      1. 19. Programming the Frame Buffer: Linux and the PlayStation 3
      2. 20. OpenGL on the Cell: Gallium and Mesa
      3. 21. Building Games with Ogre3D
      4. 22. Packaging Graphics with COLLADA
      5. Epilogue
    16. VI: Appendices
      1. Appendix A. Understanding ELF Files
      2. Appendix B. Updating the PS3 Add-On Packages and Installing a New Linux Kernel
      3. Appendix C. The Accelerated Library Framework (ALF)
      4. Appendix D. SPU Instruction Set Reference
      5. Appendix E. A Brief Introduction to Tcl
    17. Index
    18. Footnote
      1. Foreword
      2. Chapter 1
      3. Chapter 10

    Product information

    • Title: Programming the Cell Processor: For Games, Graphics, and Computation
    • Author(s): Matthew Scarpino
    • Release date: October 2008
    • Publisher(s): Pearson
    • ISBN: 9780137156115