I have a .h file, SSEMatrixMultiplier, where I tried to put a function prototype:
__m128 mulVectorMatrixAttempt2(__m128 v, __m128 Mrow1, __m128 Mrow2, __m128 Mrow3, __m128 Mrow4);
and a .cpp file, where I try to implement the function:
__m128 mulVectorMatrixAttempt2(__m128 v, __m128 Mrow1, __m128 Mrow2, __m128 Mrow3, __m128 Mrow4)
{
__m128 xMrow1 = _mm_mul_ps(_mm_replicate_x_ps(v), Mrow1);
__m128 yMrow2 = _mm_mul_ps(_mm_replicate_y_ps(v), Mrow2);
__m128 zMrow3 = _mm_mul_ps(_mm_replicate_z_ps(v), Mrow3);
__m128 wMrow4 = _mm_mul_ps(_mm_replicate_w_ps(v), Mrow4);
__m128 result = _mm_add_ps(xMrow1, yMrow2);
result = _mm_add_ps(result, zMrow3);
result = _mm_add_ps(result, wMrow4);
return result;
}
But the compiler gives me the following errors:
Error 1 error C2719: 'Mrow3': formal parameter with __declspec(align('16')) won't be aligned c:\...simd sse math test\simd sse math test\ssematrixmultiplier.h 20
Error 3 error C2719: 'Mrow3': formal parameter with __declspec(align('16')) won't be aligned c:\...simd sse math test\simd sse math test\ssematrixmultiplier.cpp 4
Error 2 error C2719: 'Mrow4': formal parameter with __declspec(align('16')) won't be aligned c:\...simd sse math test\simd sse math test\ssematrixmultiplier.h 20
Error 4 error C2719: 'Mrow4': formal parameter with __declspec(align('16')) won't be aligned c:\...simd sse math test\simd sse math test\ssematrixmultiplier.cpp 4[/quote]
Anyone know what's up?