setting the speed for the future of games programming
vectorc

contentsclose
 

INTRODUCTION

Features VectorC compiles standard C for a range of PC microprocessors. C++ is not supported.

VectorC applies a very high level of optimizing. This means that compilation can be slower than other compilers.  You can reduce the level of optimization if you want to compile more quickly.  The compiler will automatically increase the level of optimization on small functions especially if they contain small loops, as these functions are more likely to benefit from optimization.

Floating-point Consistency

On Intel architecture processors, floating-point results are inconsistent. That means that the same floating-point expression can give a different result when compiled with different options or in different parts of your program. If floating-point consistency is important to you, read this. This often applies in networked computer games.

Generating the Fastest Code

VectorC is designed to generate fast code.  To get the most of its abilities, you need to compile different versions of your program for different processors. You then need to detect the user's processor and run the right version. Detection is described here.

To make the best use of MMX, 3D Now! and Streaming SIMD Extensions, you need to read about aliasing, alignment and prefetching. You also need to know about what operations are available on different processors. More detailed guidelines on writing fast code with VectorC is described in Optimization Guidelines.

To use 3D Now! and Streaming SIMD Extensions to speed up floating-point code, you need to make sure your program uses single-precision float types (not doubles). C will assume double types by default for floating-point constants and standard functions. Floating-point constants can be make single precision by adding an F on the end. The 'sqrt' function has explicit support within 3D Now! and SSE, but only at single precision.  You can modify the header files, or alternatively, you can use the /single or /vec:single command-line options.  These options make constants and the sqrt function single-precision in single-precision expressions throughout your source code.  You also need to look at the __hint__((precision(12))) compiler hint as both 3D Now! and SSE have 12-bit precision divides and reciprocal square root instructions that are extremely fast.

Debugging your Programs

VectorC will output debugging information in Microsoft or Dwarf format, but the debugging information is not as detailed as might be available from other compilers. Also, debugging vectorized programs can be difficult, so you may wish to use another compiler for the debugging versions of your programs.

top

contentsclose