Skip to content

Commit 81713ed

Browse files
committed
perf(specialize): widen BINARY_OP_SUBTRACT_INT to full int64 range
Change the subtract specialization condition to accept exact ints in the full int64 range, matching the widened add path while keeping multiply compact-only.
1 parent 039d6c3 commit 81713ed

14 files changed

Lines changed: 1412 additions & 1562 deletions

Include/internal/pycore_long.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ PyAPI_FUNC(_PyStackRef) _PyCompactLong_Add(PyLongObject *left, PyLongObject *rig
117117
PyAPI_FUNC(_PyStackRef) _PyCompactLong_Multiply(PyLongObject *left, PyLongObject *right);
118118
PyAPI_FUNC(_PyStackRef) _PyCompactLong_Subtract(PyLongObject *left, PyLongObject *right);
119119
PyAPI_FUNC(_PyStackRef) _PyCompactLong_AddWide(PyLongObject *left, PyLongObject *right);
120+
PyAPI_FUNC(_PyStackRef) _PyCompactLong_SubtractWide(PyLongObject *left, PyLongObject *right);
120121

121122
// Export for 'binascii' shared extension.
122123
PyAPI_DATA(unsigned char) _PyLong_DigitValue[256];

Include/internal/pycore_opcode_metadata.h

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)