That's a very good news for everybody looking for a well written math lib, especially the SoA one which is quite rare.
Anyway, it seems to me that I'm facing an issue:
- The sse implementation of boolInVec uses for the == operator the _mm_cmpeq_ps intrinsic (vectormathlibrary\include\vectormath\SSE\cpp\boolInVec.h line 207).
- The __m128 argument stores either 0xfffffff or 0x0 to reflect a boolean value (respectively true or false). See constructor boolInVec::boolInVec(bool scalar) line 139.
- As seen as a float value, 0xfffffff is a NAN.
- According to sse instruction specifications (that I found here :
http://www.cs.cmu.edu/~410/doc/intel-isr.pdf), _mm_cmpeq_ps always returns false when comparing NANs.
Thus comparing 2 boolInVec that are initialized to "true" with the == operator returns false, which is not the expected result.
I've experimented this behavior with those 3 lines of code:
Code:
int i = 0xffffffff;
__m128 a = _mm_set1_ps(*(float*)&i);
__m128 c = _mm_cmpeq_ps(a, a);
You'll notice that c equals 0x0 instead of the expected 0xffffffff.
Am I wrong?
Guillaume