Testing C compiler

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);
原文地址:https://www.cnblogs.com/len3d/p/2756897.html