c++ - _MM_TRANSPOSE4_PS causes compiler errors in GCC? -
i'm compiling math library in gcc instead of msvc first time , going through little errors, , i've hit 1 makes no sense:
line 284: error: lvalue required left operand of assignment
what's on line 284? this:
_mm_transpose4_ps(r, u, t, _mm_setr_ps(0.0f, 0.0f, 0.0f, 1.0f));
(r, u, , t instances of __m128
)
those familiar using xmmintrin.h
aware _mm_transpose4_ps
isn't function, rather macro, expands to:
/* transpose 4x4 matrix composed of row[0-3]. */ #define _mm_transpose4_ps(row0, row1, row2, row3) \ { \ __v4sf __r0 = (row0), __r1 = (row1), __r2 = (row2), __r3 = (row3); \ __v4sf __t0 = __builtin_ia32_unpcklps (__r0, __r1); \ __v4sf __t1 = __builtin_ia32_unpcklps (__r2, __r3); \ __v4sf __t2 = __builtin_ia32_unpckhps (__r0, __r1); \ __v4sf __t3 = __builtin_ia32_unpckhps (__r2, __r3); \ (row0) = __builtin_ia32_movlhps (__t0, __t1); \ (row1) = __builtin_ia32_movhlps (__t1, __t0); \ (row2) = __builtin_ia32_movlhps (__t2, __t3); \ (row3) = __builtin_ia32_movhlps (__t3, __t2); \ } while (0)
so... what's causing compiler errors? don't redefine here, know of. exact same code compiled , ran when using msvc.
you need change:
_mm_transpose4_ps(r, u, t, _mm_setr_ps(0.0f, 0.0f, 0.0f, 1.0f));
to:
__m128 v = _mm_setr_ps(0.0f, 0.0f, 0.0f, 1.0f); _mm_transpose4_ps(r, u, t, v);
since in-place transpose, , 4 input vectors used output.
Comments
Post a Comment