--- a/include/vector.h Thu May 08 09:21:25 2008 +0200
+++ b/include/vector.h Sat May 10 14:29:37 2008 +0200
@@ -36,8 +36,10 @@
using namespace std;
+#define NO_SIMD_VECTOR
+
/**
- * three cell vector
+ * three (four) cell vector
*/
class Vector
{
@@ -92,7 +94,7 @@
/** Accumulate. Useful for colors. */
Vector operator+=(const Vector &v)
{
-#ifdef NO_SIMD
+#ifdef NO_SIMD_VECTOR
x += v.x;
y += v.y;
z += v.z;
@@ -124,7 +126,7 @@
/** Sum of two vectors */
friend Vector operator+(const Vector &a, const Vector &b)
{
-#ifdef NO_SIMD
+#ifdef NO_SIMD_VECTOR
return Vector(a.x + b.x, a.y + b.y, a.z + b.z);
#else
return Vector(madd(a.mf4, b.mf4));
@@ -134,10 +136,9 @@
/** Difference of two vectors */
friend Vector operator-(const Vector &a, const Vector &b)
{
-#if defined(NO_SIMD) || defined(MSVC)
+#ifdef NO_SIMD_VECTOR
return Vector(a.x - b.x, a.y - b.y, a.z - b.z);
#else
- // this faults in MSVC, for unknown reason
return Vector(msub(a.mf4, b.mf4));
#endif
};
@@ -178,7 +179,7 @@
/** Get f/v, i.e. inverted vector multiplied by scalar */
friend Vector operator/(const Float &f, const Vector &v)
{
-#ifdef NO_SIMD
+#ifdef NO_SIMD_VECTOR
return Vector(f / v.x, f / v.y, f / v.z);
#else
return Vector(mdiv(mset1(f), v.mf4));
@@ -200,7 +201,7 @@
/** Cell by cell product (only useful for colors) */
friend Vector operator*(const Vector &a, const Vector &b)
{
-#ifdef NO_SIMD
+#ifdef NO_SIMD_VECTOR
return Vector(a.x * b.x, a.y * b.y, a.z * b.z);
#else
return Vector(mmul(a.mf4, b.mf4));