mirror of
https://github.com/recp/cglm.git
synced 2026-02-17 03:39:05 +00:00
opitimize mat2 operations with fma
This commit is contained in:
@@ -26,11 +26,11 @@ glm_mat2_mul_sse2(mat2 m1, mat2 m2, mat2 dest) {
|
|||||||
dest[1][0] = a * g + c * h;
|
dest[1][0] = a * g + c * h;
|
||||||
dest[1][1] = b * g + d * h;
|
dest[1][1] = b * g + d * h;
|
||||||
*/
|
*/
|
||||||
x0 = _mm_mul_ps(_mm_movelh_ps(x1, x1), glmm_shuff1(x2, 2, 2, 0, 0));
|
x0 = glmm_fmadd(_mm_movelh_ps(x1, x1), glmm_shuff1(x2, 2, 2, 0, 0),
|
||||||
x1 = _mm_mul_ps(_mm_movehl_ps(x1, x1), glmm_shuff1(x2, 3, 3, 1, 1));
|
_mm_mul_ps(_mm_movehl_ps(x1, x1),
|
||||||
x1 = _mm_add_ps(x0, x1);
|
glmm_shuff1(x2, 3, 3, 1, 1)));
|
||||||
|
|
||||||
glmm_store(dest[0], x1);
|
glmm_store(dest[0], x0);
|
||||||
}
|
}
|
||||||
|
|
||||||
CGLM_INLINE
|
CGLM_INLINE
|
||||||
|
|||||||
Reference in New Issue
Block a user