2005, Wordware Publishing, Inc.
No part of this book may be reproduced in any form or by any means without permission in writing from Wordware Publishing, Inc.
Brand names and product names mentioned in this book are trademarks or service marks of their respective companies. Any omission or misuse (of any kind) of service marks or trademarks should not be regarded as intent to infringe on the property of others. The publisher recognizes and respects all marks used by companies, manufacturers, and developers as a means to distinguish their products.
This book is sold as is, without warranty of any kind, either express or implied, respecting the contents of this book and any disks or programs that may accompany it, including but not limited to implied warranties for the book's quality, performance, merchantability, or fitness for any particular purpose. Neither Wordware Publishing, Inc. nor its dealers or distributors shall be liable to the purchaser or any other person or entity with respect to any liability, loss, or damage caused or alleged to have been caused directly or indirectly by this book.
All inquiries for volume purchases of this book should be addressed to Wordware Publishing, Inc., at the above address. Telephone inquiries may be made by calling:
Preface
(or, So Why Did He Write Yet Another Book?)
Yet another book? Well, actually I am merely just one of the other ex-Atari employees who was a member of Alan Kay's group, Atari Corporate Research, and has published books.
For those of you who have been following my eventful career, you already know that this is actually my third published book.
Just to bring you up to date, my first book was titled The Death and Rebirth of the x86 Assembly Language Programmer and was originally written between July 1997 and June 1998. It also went under the title of x86 Assembly Language Optimization in Computer Games. Its timing was perfect as SSE code named Katmai by Intel was just about to come out. I could not find a publisher willing to sign as they "could not sell their last 8086 assembly language book," and so I put it aside and went back to school to work on my next degree at Oregon State University. ( Go Beavers! )
Two years later I came up with a SIMD (vector) assembly language book idea. Having learned my lesson, I sold the idea to a publisher first (Wordware Publishing) and Vector Game Math Processors became my first published book. It probably should have included 8086, Mips, and PowerPC in the title, as that would have helped to increase its sales. It seems most people stumble across it.
Everybody who read it and contacted me seemed to like it. It was more of a niche book as it primarily taught how to vectorize code to take advantage of the vector instruction sets of processors only recently introduced into offices and homes. These contain functionality that was once confined to the domain of the super computer. Vector Game Math Processors discusses pseudo vector code that actually emulated vector processors using generic optimized C, as well as heavy utilization of the following instruction sets:
8086 (MMX, SSE(2), 3DNow! Professional)
PowerPC and AltiVec
MIPS (MIPS-3D, MIPS V, etc.)
While writing it I wrote a chapter on vertex shaders and sold the idea to my publisher. Thus my second book published was Learn Vertex and Pixel Shader Programming with DirectX 9 .
And now we have come full circle, as this book is actually the completion of my original 8086 book, The Death... But I digress. The title was too long and not really to the point. So now that book has been completed, updated, and designed to be the prequel to my vector book. And thank you for buying both (you did, did you not?) as you are reading one of them now!
The problem with writing "yet another book" is that one tends to use the best jokes or favorite stories in the first one. Well, I have so many from over the years, especially since I have eight kids (with the same wife), that I have saved some for this book. But relax, the worst stories are laying on the editing room floor in order to make this book more academic friendly.
One (almost) last item. Keep an eye out for my not-so-technical book, Programming Pyrite The Fool's Gold of Programming Video Games . It is meant not to be a programming book, but a book about the trials and tribulations of becoming a video game programmer. It is meant to be a satirical peek into this world, and is based on my experiences as well as the good and bad stories that I have encountered over the years.
I wish to thank those who have contributed information, hints, testing time, etc., for this book. Paul Stapley for some recommendations and technical overview recommendations; Peter Jefferies and John Swiderski for some code sample testing; Ken Mayfield for some 3D computer art donations; John Romero for his technical check and tip recommendations; and some of those others that I have neglected to mention here for their contributions.
And most of all to my wife for not balking too much after she thought I had finished writing for good after finishing my second published book and then noticed within a couple weeks that I was working on this book. "Revising your vector book for a second edition?" Of course she did not seem to notice (or mention) the purchases of new motherboards and processors as they were hidden inside my nice super quiet Sonata computer equipment.
I finally wish to thank Wes Beckwith from Wordware Publishing, Inc., for seeing the niche that this book would fill and convincing his company to publish yet another of my books.
So get up from that floor or chair in the bookstore in which you are currently reading this book; you know you will need this book for work or school. Besides, I filled it with so much stuff you might as well stop copying the stuff into that little notebook, grab a second copy for use at home, walk over to that check stand, and buy them both. Tell your friends how great the book is so they will buy a copy too! Insist to your employer that the technical book library needs a few copies as well. This book is a tutorial and a reference manual.
My eight children and my outnumbered domestic engineering wife will be thankful that we will be able to afford school clothes as well as Christmas presents this year! Unlike the title of Steve Martin's remake of the movie that kids are Cheaper by the Dozen , they are not! They eat us out of house and home! (Fortunately for me, my kids are typically not quite as rambunctious as his!)
To check for any updates or code supplements to any of my books, check out my web site at