diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-05-20 17:48:47 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-05-20 17:54:35 +0200 |
| commit | b144ec8b96b5b71e409d2a692eac64b38120c9ba (patch) | |
| tree | b8e443180fcf49cd1b815806dd6de91980ddc4d7 /src/cube_portable.h | |
| parent | 8bacac732dcb2c0118e47e1bb81be855f4a0bf58 (diff) | |
| download | nissy-core-b144ec8b96b5b71e409d2a692eac64b38120c9ba.tar.gz nissy-core-b144ec8b96b5b71e409d2a692eac64b38120c9ba.zip | |
More tests for gendata h48
Diffstat (limited to 'src/cube_portable.h')
| -rw-r--r-- | src/cube_portable.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/cube_portable.h b/src/cube_portable.h index cb4d8fc..e72c169 100644 --- a/src/cube_portable.h +++ b/src/cube_portable.h | |||
| @@ -200,7 +200,7 @@ It can be seen as the composition of two "subset index" coordinates. | |||
| 200 | _static_inline int64_t | 200 | _static_inline int64_t |
| 201 | coord_fast_esep(cube_fast_t c) | 201 | coord_fast_esep(cube_fast_t c) |
| 202 | { | 202 | { |
| 203 | int64_t i, j, k, l, ret1, ret2, bit1, bit2, is1; | 203 | int64_t i, j, jj, k, l, ret1, ret2, bit1, bit2, is1; |
| 204 | 204 | ||
| 205 | for (i = 0, j = 0, k = 4, l = 4, ret1 = 0, ret2 = 0; i < 12; i++) { | 205 | for (i = 0, j = 0, k = 4, l = 4, ret1 = 0, ret2 = 0; i < 12; i++) { |
| 206 | /* Simple version: | 206 | /* Simple version: |
| @@ -220,7 +220,8 @@ coord_fast_esep(cube_fast_t c) | |||
| 220 | ret1 += bit2 * binomial[11-i][k]; | 220 | ret1 += bit2 * binomial[11-i][k]; |
| 221 | k -= bit2; | 221 | k -= bit2; |
| 222 | 222 | ||
| 223 | ret2 += is1 * binomial[7-j][l]; | 223 | jj = j < 8; |
| 224 | ret2 += jj * is1 * binomial[7-(j*jj)][l]; | ||
| 224 | l -= is1; | 225 | l -= is1; |
| 225 | j += (1-bit2); | 226 | j += (1-bit2); |
| 226 | } | 227 | } |
| @@ -257,7 +258,7 @@ _static_inline cube_fast_t | |||
| 257 | invcoord_fast_esep(int64_t esep) | 258 | invcoord_fast_esep(int64_t esep) |
| 258 | { | 259 | { |
| 259 | cube_fast_t ret; | 260 | cube_fast_t ret; |
| 260 | int64_t i, j, k, l, s, v, w, is1, set1, set2; | 261 | int64_t i, j, jj, k, l, s, v, w, is1, set1, set2; |
| 261 | uint8_t bit2, bit1; | 262 | uint8_t bit2, bit1; |
| 262 | uint8_t slice[3] = {0}; | 263 | uint8_t slice[3] = {0}; |
| 263 | 264 | ||
| @@ -267,7 +268,8 @@ invcoord_fast_esep(int64_t esep) | |||
| 267 | 268 | ||
| 268 | for (i = 0, j = 0, k = 4, l = 4; i < 12; i++) { | 269 | for (i = 0, j = 0, k = 4, l = 4; i < 12; i++) { |
| 269 | v = binomial[11-i][k]; | 270 | v = binomial[11-i][k]; |
| 270 | w = binomial[7-j][l]; | 271 | jj = j < 8; |
| 272 | w = jj * binomial[7-(j*jj)][l]; | ||
| 271 | bit2 = set2 >= v; | 273 | bit2 = set2 >= v; |
| 272 | bit1 = set1 >= w; | 274 | bit1 = set1 >= w; |
| 273 | is1 = (1 - bit2) * bit1; | 275 | is1 = (1 - bit2) * bit1; |
