mirror of
https://github.com/recp/cglm.git
synced 2025-10-04 09:08:53 +00:00
avx: replace binary constants with hex
This commit is contained in:
@@ -27,13 +27,14 @@ glm_mul_avx(mat4 m1, mat4 m2, mat4 dest) {
|
|||||||
y2 = glmm_load256(m1[0]); /* h g f e d c b a */
|
y2 = glmm_load256(m1[0]); /* h g f e d c b a */
|
||||||
y3 = glmm_load256(m1[2]); /* p o n m l k j i */
|
y3 = glmm_load256(m1[2]); /* p o n m l k j i */
|
||||||
|
|
||||||
y4 = _mm256_permute2f128_ps(y2, y2, 0b00000011); /* d c b a h g f e */
|
/* 0x03: 0b00000011 */
|
||||||
y5 = _mm256_permute2f128_ps(y3, y3, 0b00000000); /* l k j i l k j i */
|
y4 = _mm256_permute2f128_ps(y2, y2, 0x03); /* d c b a h g f e */
|
||||||
|
y5 = _mm256_permute2f128_ps(y3, y3, 0x03); /* l k j i l k j i */
|
||||||
|
|
||||||
/* f f f f a a a a */
|
/* f f f f a a a a */
|
||||||
/* g g g g c c c c */
|
/* g g g g c c c c */
|
||||||
/* e e e e b b b b */
|
/* e e e e b b b b */
|
||||||
y7 = _mm256_permute_ps(y0, 0b10101010);
|
y7 = _mm256_permute_ps(y0, 0xAA); /* 0xAA: 0b10101010 */
|
||||||
y6 = _mm256_permutevar_ps(y0, _mm256_set_epi32(1, 1, 1, 1, 0, 0, 0, 0));
|
y6 = _mm256_permutevar_ps(y0, _mm256_set_epi32(1, 1, 1, 1, 0, 0, 0, 0));
|
||||||
y8 = _mm256_permutevar_ps(y0, _mm256_set_epi32(0, 0, 0, 0, 1, 1, 1, 1));
|
y8 = _mm256_permutevar_ps(y0, _mm256_set_epi32(0, 0, 0, 0, 1, 1, 1, 1));
|
||||||
|
|
||||||
|
@@ -27,8 +27,9 @@ glm_mat4_mul_avx(mat4 m1, mat4 m2, mat4 dest) {
|
|||||||
y2 = glmm_load256(m1[0]); /* h g f e d c b a */
|
y2 = glmm_load256(m1[0]); /* h g f e d c b a */
|
||||||
y3 = glmm_load256(m1[2]); /* p o n m l k j i */
|
y3 = glmm_load256(m1[2]); /* p o n m l k j i */
|
||||||
|
|
||||||
y4 = _mm256_permute2f128_ps(y2, y2, 0b00000011); /* d c b a h g f e */
|
/* 0x03: 0b00000011 */
|
||||||
y5 = _mm256_permute2f128_ps(y3, y3, 0b00000011); /* l k j i p o n m */
|
y4 = _mm256_permute2f128_ps(y2, y2, 0x03); /* d c b a h g f e */
|
||||||
|
y5 = _mm256_permute2f128_ps(y3, y3, 0x03); /* l k j i p o n m */
|
||||||
|
|
||||||
/* f f f f a a a a */
|
/* f f f f a a a a */
|
||||||
/* h h h h c c c c */
|
/* h h h h c c c c */
|
||||||
|
Reference in New Issue
Block a user