Commit 192fe4ca authored by peastman's avatar peastman
Browse files

Merge pull request #271 from peastman/master

Workaround for compilation error on some compilers
parents 742ab844 29bfe077
...@@ -55,8 +55,9 @@ public: ...@@ -55,8 +55,9 @@ public:
return val; return val;
} }
float operator[](int i) const { float operator[](int i) const {
int resultBits = _mm_extract_ps(val, i); float result[4];
return *((float*) &resultBits); store(result);
return result[i];
} }
void store(float* v) const { void store(float* v) const {
_mm_storeu_ps(v, val); _mm_storeu_ps(v, val);
...@@ -131,7 +132,9 @@ public: ...@@ -131,7 +132,9 @@ public:
return val; return val;
} }
int operator[](int i) const { int operator[](int i) const {
return _mm_extract_epi32(val, i); int result[4];
store(result);
return result[i];
} }
void store(int* v) const { void store(int* v) const {
_mm_storeu_si128((__m128i*) v, val); _mm_storeu_si128((__m128i*) v, val);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment