factor: a bit more simple isqrt

function                                             old     new   delta
isqrt_odd                                             87      80      -7

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2017-04-10 00:28:26 +02:00
parent c6476dca54
commit bef1713217

View File

@ -62,7 +62,7 @@ static inline half_t isqrt(wide_t N)
*/ */
x = HALF_MAX; x = HALF_MAX;
mask_2bits = TOPMOST_WIDE_BIT | (TOPMOST_WIDE_BIT >> 1); mask_2bits = TOPMOST_WIDE_BIT | (TOPMOST_WIDE_BIT >> 1);
while (mask_2bits && !(N & mask_2bits)) { while (!(N & mask_2bits)) {
x >>= 1; x >>= 1;
mask_2bits >>= 2; mask_2bits >>= 2;
} }