From 3051b2342d67dcba2fdc0010fb26f5850964c4d9 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Sat, 4 Nov 2023 10:25:13 +0100 Subject: avx2 fully works --- src/_trans_avx2.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/_trans_avx2.c') diff --git a/src/_trans_avx2.c b/src/_trans_avx2.c index e80bf79..c296f6d 100644 --- a/src/_trans_avx2.c +++ b/src/_trans_avx2.c @@ -1,14 +1,15 @@ static inline cube_t flipallcorners(cube_t c) { - cube_t shleft, shright, summed, newco, cleanco, ret; + cube_t co, shleft, shright, summed, newco, cleanco, ret; - shleft = _mm256_slli_si256(c, 1); - shright = _mm256_srli_si256(c, 1); + co = _mm256_and_si256(c, _co2_avx2); + shleft = _mm256_slli_epi32(co, 1); + shright = _mm256_srli_epi32(co, 1); summed = _mm256_or_si256(shleft, shright); - newco = _mm256_and_si256(summed, _co_avx2); - cleanco = _mm256_andnot_si256(c, _co_avx2); - ret = _mm256_and_si256(cleanco, newco); + newco = _mm256_and_si256(summed, _co2_avx2); + cleanco = _mm256_xor_si256(c, co); + ret = _mm256_or_si256(cleanco, newco); return ret; } -- cgit v1.3