commit eed4de7f91d1013a842161f8e36c809d78573c4c
parent af6e9af26e0f547b41fc85f1cce07040cb3dbc87
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date: Tue, 16 Dec 2025 00:29:03 +0100
Swap bit pairs in pval_min
Diffstat:
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git 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)
STATIC_INLINE uint8_t
get_h48_pvalmin(const unsigned char *table, uint64_t i)
{
- return (get_h48_pval(table, i) << UINT8_C(2)) +
- get_h48_pval(table, i+UINT64_C(1));
+ return table[H48_INDEX(i)] >> UINT8_C(4);
}
STATIC_INLINE void
@@ -521,9 +520,9 @@ set_h48_pval(unsigned char *table, uint64_t i, uint8_t val)
STATIC_INLINE void
set_h48_pvalmin(unsigned char *table, uint64_t i, uint8_t val)
{
- uint8_t v;
+ uint8_t t, v;
v = MIN(val, get_h48_pvalmin(table, i));
- set_h48_pval(table, i, v >> UINT8_C(2));
- set_h48_pval(table, i+UINT64_C(1), v % UINT8_C(4));
+ t = table[H48_INDEX(i)];
+ table[H48_INDEX(i)] = (t & UINT8_C(0xF)) | (v << UINT8_C(4));
}