@@ -24,6 +24,9 @@ October 27, 2014: | |||||
stand more analysis. This is why I have the careful balancing of | stand more analysis. This is why I have the careful balancing of | ||||
"hexad" and "nonad" multiplies in its Chung-Hasan mul routine. | "hexad" and "nonad" multiplies in its Chung-Hasan mul routine. | ||||
(TODO: reconsider whether this is even worthwhile on machines | |||||
without AVX2.) | |||||
The 'r12 build is a work in progress, and currently only works on | The 'r12 build is a work in progress, and currently only works on | ||||
clang (because it rearranges vectors in the timesW function). | clang (because it rearranges vectors in the timesW function). | ||||
@@ -50,12 +50,11 @@ static mask_t field_assert_eq_gmp( | |||||
int radix_bits = 1 + (sizeof(x->limb[0]) * FIELD_BITS - 1) / sizeof(*x); | int radix_bits = 1 + (sizeof(x->limb[0]) * FIELD_BITS - 1) / sizeof(*x); | ||||
word_t yardstick; | word_t yardstick; | ||||
if (BRANCH_ON_CONSTANT(FIELD_BITS == 521 && sizeof(*x)==12*8)) { | |||||
yardstick = (1ull<<58) - 1; | |||||
} else { | |||||
yardstick = (i==sizeof(*x)/sizeof(x->limb[0])/2) ? | |||||
(1ull<<radix_bits) - 2 : (1ull<<radix_bits) - 1; // FIELD_MAGIC | |||||
if (BRANCH_ON_CONSTANT(FIELD_BITS == 521) && BRANCH_ON_CONSTANT(sizeof(*x)==12*8)) { | |||||
radix_bits = 58; | |||||
} | } | ||||
yardstick = (1ull<<radix_bits) - 1; | |||||
if (x->limb[i] < yardstick * lowBound || x->limb[i] > yardstick * highBound) { | if (x->limb[i] < yardstick * lowBound || x->limb[i] > yardstick * highBound) { | ||||
youfail(); | youfail(); | ||||