Lines Matching refs:wordshift
4701 /* wordshift, remshift = divmod(shiftby, PyLong_SHIFT) */
4703 divmod_shift(PyObject *shiftby, Py_ssize_t *wordshift, digit *remshift)
4709 *wordshift = lshiftby / PyLong_SHIFT;
4721 *wordshift = PyLong_AsSsize_t((PyObject *)wordshift_obj);
4723 if (*wordshift >= 0 && *wordshift < PY_SSIZE_T_MAX / (Py_ssize_t)sizeof(digit)) {
4727 /* Clip the value. With such large wordshift the right shift
4729 *wordshift = PY_SSIZE_T_MAX / sizeof(digit);
4735 integer right by PyLong_SHIFT*wordshift + remshift bits.
4736 wordshift should be nonnegative. */
4739 long_rshift1(PyLongObject *a, Py_ssize_t wordshift, digit remshift)
4747 assert(wordshift >= 0);
4755 shift = wordshift == 0 ? remshift : PyLong_SHIFT;
4765 while keeping PyLong_SHIFT*wordshift + remshift the same. This
4768 if (wordshift == 0) {
4773 --wordshift;
4777 assert(wordshift >= 0);
4778 newsize = size_a - wordshift;
4789 accum = a->ob_digit[wordshift];
4796 In the addition `a + (2**shift - 1)`, the low `wordshift` digits of
4798 from the bottom `wordshift` digits when at least one of the least
4799 significant `wordshift` digits of `a` is nonzero. Digit `wordshift`
4805 for (Py_ssize_t j = 0; j < wordshift; j++) {
4812 for (Py_ssize_t i = 0, j = wordshift + 1; j < size_a; i++, j++) {
4827 Py_ssize_t wordshift;
4839 if (divmod_shift(b, &wordshift, &remshift) < 0)
4841 return long_rshift1((PyLongObject *)a, wordshift, remshift);
4848 Py_ssize_t wordshift;
4855 wordshift = shiftby / PyLong_SHIFT;
4857 return long_rshift1((PyLongObject *)a, wordshift, remshift);
4861 long_lshift1(PyLongObject *a, Py_ssize_t wordshift, digit remshift)
4867 if (wordshift == 0 && IS_MEDIUM_VALUE(a)) {
4875 newsize = oldsize + wordshift;
4885 for (i = 0; i < wordshift; i++)
4888 for (i = wordshift, j = 0; j < oldsize; i++, j++) {
4904 Py_ssize_t wordshift;
4916 if (divmod_shift(b, &wordshift, &remshift) < 0)
4918 return long_lshift1((PyLongObject *)a, wordshift, remshift);
4925 Py_ssize_t wordshift;
4932 wordshift = shiftby / PyLong_SHIFT;
4934 return long_lshift1((PyLongObject *)a, wordshift, remshift);