} while (0)
#endif
+/* Set (rh,rl) = (ah,al) >> cnt, where 0 < cnt < W_TYPE_SIZE. */
#define rsh2(rh, rl, ah, al, cnt) \
do { \
(rl) = ((ah) << (W_TYPE_SIZE - (cnt))) | ((al) >> (cnt)); \
(rh) = (ah) >> (cnt); \
} while (0)
+/* Set (rh,rl) = (ah,al) << cnt, where 0 < cnt < W_TYPE_SIZE. */
#define lsh2(rh, rl, ah, al, cnt) \
do { \
(rh) = ((ah) << cnt) | ((al) >> (W_TYPE_SIZE - (cnt))); \
count_leading_zeros (cntd, d1);
count_leading_zeros (cnta, a1);
int cnt = cntd - cnta;
- lsh2 (d1, d0, d1, d0, cnt);
- for (int i = 0; i < cnt; i++)
+ if (0 < cnt)
{
- if (ge2 (a1, a0, d1, d0))
- sub_ddmmss (a1, a0, a1, a0, d1, d0);
- rsh2 (d1, d0, d1, d0, 1);
+ lsh2 (d1, d0, d1, d0, cnt);
+ for (int i = 0; i < cnt; i++)
+ {
+ if (ge2 (a1, a0, d1, d0))
+ sub_ddmmss (a1, a0, a1, a0, d1, d0);
+ rsh2 (d1, d0, d1, d0, 1);
+ }
}
*r1 = a1;
# t1: 9223372036854775421 18446744073709551709
# t2: 9223372036854775643 18446744073709551709
+# https://bugs.gnu.org/73474
+bug73474=22222222222222222202111121111
+
# Each test is a triple: lo, hi, sha1 of result.
# The test script, run.sh, runs seq lo hi|factor|sha1sum
# and verifies that the actual and expected checksums are the same.
t34) set ${q}956336 ${q}958335 d1ae6bc712d994f35edf55c785d71ddf31f16535 ;;
t35) set ${q}958336 ${q}960335 2374919a89196e1fce93adfe779cb4664556d4b6 ;;
t36) set ${q}960336 ${q}962335 569e4363e8d9e8830a187d9ab27365eef08abde1 ;;
+ t37) set $bug73474 $bug73474 61d04aaf757acc5a37eb1d5581a98eea78ef50e8 ;;
*)
echo "$0: error: unknown test: '$test_name' -> '$t'" >&2
exit 1
$(tf)/t20.sh $(tf)/t21.sh $(tf)/t22.sh $(tf)/t23.sh $(tf)/t24.sh \
$(tf)/t25.sh $(tf)/t26.sh $(tf)/t27.sh $(tf)/t28.sh $(tf)/t29.sh \
$(tf)/t30.sh $(tf)/t31.sh $(tf)/t32.sh $(tf)/t33.sh $(tf)/t34.sh \
- $(tf)/t35.sh $(tf)/t36.sh
+ $(tf)/t35.sh $(tf)/t36.sh $(tf)/t37.sh
$(factor_tests): $(tf)/run.sh $(tf)/create-test.sh
$(AM_V_GEN)$(MKDIR_P) $(tf)