diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-12-16 00:29:03 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-12-16 00:29:03 +0100 |
| commit | eed4de7f91d1013a842161f8e36c809d78573c4c (patch) | |
| tree | a26e2652e1104fa0f169524b65d6f6f4e208dfb1 /src/solvers/h48 | |
| parent | af6e9af26e0f547b41fc85f1cce07040cb3dbc87 (diff) | |
| download | nissy-core-eed4de7f91d1013a842161f8e36c809d78573c4c.tar.gz nissy-core-eed4de7f91d1013a842161f8e36c809d78573c4c.zip | |
Swap bit pairs in pval_min
Diffstat (limited to 'src/solvers/h48')
| -rw-r--r-- | src/solvers/h48/gendata_h48.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/solvers/h48/gendata_h48.h b/src/solvers/h48/gendata_h48.h index 890aad8..15b7589 100644 --- a/src/solvers/h48/gendata_h48.h +++ b/src/solvers/h48/gendata_h48.h | |||
| @@ -507,8 +507,7 @@ get_h48_pval(const unsigned char *table, uint64_t i) | |||
| 507 | STATIC_INLINE uint8_t | 507 | STATIC_INLINE uint8_t |
| 508 | get_h48_pvalmin(const unsigned char *table, uint64_t i) | 508 | get_h48_pvalmin(const unsigned char *table, uint64_t i) |
| 509 | { | 509 | { |
| 510 | return (get_h48_pval(table, i) << UINT8_C(2)) + | 510 | return table[H48_INDEX(i)] >> UINT8_C(4); |
| 511 | get_h48_pval(table, i+UINT64_C(1)); | ||
| 512 | } | 511 | } |
| 513 | 512 | ||
| 514 | STATIC_INLINE void | 513 | STATIC_INLINE void |
| @@ -521,9 +520,9 @@ set_h48_pval(unsigned char *table, uint64_t i, uint8_t val) | |||
| 521 | STATIC_INLINE void | 520 | STATIC_INLINE void |
| 522 | set_h48_pvalmin(unsigned char *table, uint64_t i, uint8_t val) | 521 | set_h48_pvalmin(unsigned char *table, uint64_t i, uint8_t val) |
| 523 | { | 522 | { |
| 524 | uint8_t v; | 523 | uint8_t t, v; |
| 525 | 524 | ||
| 526 | v = MIN(val, get_h48_pvalmin(table, i)); | 525 | v = MIN(val, get_h48_pvalmin(table, i)); |
| 527 | set_h48_pval(table, i, v >> UINT8_C(2)); | 526 | t = table[H48_INDEX(i)]; |
| 528 | set_h48_pval(table, i+UINT64_C(1), v % UINT8_C(4)); | 527 | table[H48_INDEX(i)] = (t & UINT8_C(0xF)) | (v << UINT8_C(4)); |
| 529 | } | 528 | } |
