setting the speed for the future of games programming |
||||||||||||||||||||||||||||||
3DNOW!3DNow! is a set of new processor instructions added to AMD's K6-2 processor. All AMD's processors since the K6-2 support 3DNow!. The new instructions perform single-precision floating-point operations on values in MMX registers. Because MMX registers are used, all the restrictions applied to MMX registers apply to 3DNow! code also. So, it is not possible to mix 3DNow! code and normal FPU floating-point code. Because only a limited set of floating-point operations are supplied by 3DNow!, if you want to make your code work with these new instructions, you should not use any unsupported floating-point operations in the same functions or loops.In addition to the normal integer vectors, MMX registers can now also be treated as type:-
It is also possible to use 3DNow! instructions to operate on normal float types. Floating-point operations carried out in 3DNow! registers will not produce exactly the same results in all circumstances as that of normal floating-point code. If 2 versions of your program must produce exactly the same results, you should enable consistent precision. 3DNow! is ideal for multiplying vectors and matrices as well as 3D projection. It can also be used with MMX for image and sound processing using floating-point intermediates. Operations Supported by 3DNow!Arithmetic - addition, subtraction, multiplication on floats or float vectorse.g.
Reciprocal 12-bit precision - floatsVectorC will also do 12-bit division by calculating the reciprocal of the right hand side and multiplying by the left hand side.e.g.
Reciprocal full precision - floatsVectorC will also do division by calculating the reciprocal of the right hand side and multiplying by the left hand side.e.g.
Reciprocal Square Root - 12-bit precision float.The "sqrt" function in "math.h" is declared with doubles. Doubles cannot be processed with 3DNow!, so you can either declare your own version of "sqrt", or use the command-line switch "/vec:single" or "/single". This will use a "float" version of "sqrt" if the argument is a float. e.g.
Conversion to or from 32-bit signed integer or signed 32-bit integer vectore.g.
Minimum and Maximum - floats or float vectorse.g.
Absolute and Negate - floats and float vectorsThe MMX logical instructions can be used to negate floats and calculate the absolute (positive) values.Conditional Move - float, float vectorsIt is possible to conditional assignments on vectors using a sequence of instructions without branching. This can be much faster than branching (which can be very slow on modern processors). e.g.
PrefetchingPrefetching is available on processors with 3DNow!
support.
|
||||||||||||||||||||||||||||||