I did some tests with the C compiler of Visual Studio 2008, the two methods of dot below made no difference in the generated assembly code:
typedef
struct Vec {
float x, y, z;
} Vec;
#define DOT(a, b) (a.x*b.x + a.y*b.y + a.z*b.z)
__forceinline float dot( const Vec *a, const Vec *b)
{
return (a->x*b->x + a->y*b->y + a->z*b->z);
}
float x, y, z;
} Vec;
#define DOT(a, b) (a.x*b.x + a.y*b.y + a.z*b.z)
__forceinline float dot( const Vec *a, const Vec *b)
{
return (a->x*b->x + a->y*b->y + a->z*b->z);
}