diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-05-20 17:39:07 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-05-20 17:39:07 +0200 |
| commit | 8bacac732dcb2c0118e47e1bb81be855f4a0bf58 (patch) | |
| tree | 503960622342592d141fa0a375dee9b9aa265fe7 /src/cube_avx2.h | |
| parent | 4dde2625a1bcb5381b50b22e7212070266cd224f (diff) | |
| download | nissy-core-8bacac732dcb2c0118e47e1bb81be855f4a0bf58.tar.gz nissy-core-8bacac732dcb2c0118e47e1bb81be855f4a0bf58.zip | |
Tests for gendata h48
Diffstat (limited to 'src/cube_avx2.h')
| -rw-r--r-- | src/cube_avx2.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/cube_avx2.h b/src/cube_avx2.h index d39da94..934737c 100644 --- a/src/cube_avx2.h +++ b/src/cube_avx2.h | |||
| @@ -207,7 +207,7 @@ _static_inline int64_t | |||
| 207 | coord_fast_esep(cube_fast_t c) | 207 | coord_fast_esep(cube_fast_t c) |
| 208 | { | 208 | { |
| 209 | cube_fast_t ep; | 209 | cube_fast_t ep; |
| 210 | int64_t e, mem[4], i, j, k, l, ret1, ret2, bit1, bit2, is1; | 210 | int64_t e, mem[4], i, j, jj, k, l, ret1, ret2, bit1, bit2, is1; |
| 211 | 211 | ||
| 212 | ep = _mm256_and_si256(c, _ep_avx2); | 212 | ep = _mm256_and_si256(c, _ep_avx2); |
| 213 | _mm256_storeu_si256((__m256i *)mem, ep); | 213 | _mm256_storeu_si256((__m256i *)mem, ep); |
| @@ -225,7 +225,8 @@ coord_fast_esep(cube_fast_t c) | |||
| 225 | ret1 += bit2 * binomial[11-i][k]; | 225 | ret1 += bit2 * binomial[11-i][k]; |
| 226 | k -= bit2; | 226 | k -= bit2; |
| 227 | 227 | ||
| 228 | ret2 += is1 * binomial[7-j][l]; | 228 | jj = j < 8; |
| 229 | ret2 += jj * is1 * binomial[7-(j*jj)][l]; | ||
| 229 | l -= is1; | 230 | l -= is1; |
| 230 | j += (1-bit2); | 231 | j += (1-bit2); |
| 231 | } | 232 | } |
| @@ -274,7 +275,7 @@ _static_inline cube_fast_t | |||
| 274 | invcoord_fast_esep(int64_t esep) | 275 | invcoord_fast_esep(int64_t esep) |
| 275 | { | 276 | { |
| 276 | cube_fast_t eee, ret; | 277 | cube_fast_t eee, ret; |
| 277 | int64_t i, j, k, l, s, v, w, is1, set1, set2; | 278 | int64_t i, j, jj, k, l, s, v, w, is1, set1, set2; |
| 278 | uint8_t bit2, bit1, mem[32]; | 279 | uint8_t bit2, bit1, mem[32]; |
| 279 | uint8_t slice[3] = {0}; | 280 | uint8_t slice[3] = {0}; |
| 280 | 281 | ||
| @@ -283,7 +284,8 @@ invcoord_fast_esep(int64_t esep) | |||
| 283 | 284 | ||
| 284 | for (i = 0, j = 0, k = 4, l = 4; i < 12; i++) { | 285 | for (i = 0, j = 0, k = 4, l = 4; i < 12; i++) { |
| 285 | v = binomial[11-i][k]; | 286 | v = binomial[11-i][k]; |
| 286 | w = binomial[7-j][l]; | 287 | jj = j < 8; |
| 288 | w = jj * binomial[7-(j*jj)][l]; | ||
| 287 | bit2 = set2 >= v; | 289 | bit2 = set2 >= v; |
| 288 | bit1 = set1 >= w; | 290 | bit1 = set1 >= w; |
| 289 | is1 = (1 - bit2) * bit1; | 291 | is1 = (1 - bit2) * bit1; |
