mirror of
https://github.com/python/cpython.git
synced 2026-04-15 00:00:57 +00:00
gh-100239: Propagate type info through _BINARY_OP_EXTEND in tier 2 (GH-148146)
This commit is contained in:
parent
476fadc9ae
commit
efda60e2ec
6 changed files with 67 additions and 18 deletions
|
|
@ -410,8 +410,16 @@ dummy_func(void) {
|
|||
}
|
||||
|
||||
op(_BINARY_OP_EXTEND, (descr/4, left, right -- res, l, r)) {
|
||||
(void)descr;
|
||||
res = sym_new_not_null(ctx);
|
||||
_PyBinaryOpSpecializationDescr *d = (_PyBinaryOpSpecializationDescr *)descr;
|
||||
if (d != NULL && d->result_type != NULL) {
|
||||
res = sym_new_type(ctx, d->result_type);
|
||||
if (d->result_unique) {
|
||||
res = PyJitRef_MakeUnique(res);
|
||||
}
|
||||
}
|
||||
else {
|
||||
res = sym_new_not_null(ctx);
|
||||
}
|
||||
l = left;
|
||||
r = right;
|
||||
}
|
||||
|
|
|
|||
12
Python/optimizer_cases.c.h
generated
12
Python/optimizer_cases.c.h
generated
|
|
@ -1168,8 +1168,16 @@
|
|||
right = stack_pointer[-1];
|
||||
left = stack_pointer[-2];
|
||||
PyObject *descr = (PyObject *)this_instr->operand0;
|
||||
(void)descr;
|
||||
res = sym_new_not_null(ctx);
|
||||
_PyBinaryOpSpecializationDescr *d = (_PyBinaryOpSpecializationDescr *)descr;
|
||||
if (d != NULL && d->result_type != NULL) {
|
||||
res = sym_new_type(ctx, d->result_type);
|
||||
if (d->result_unique) {
|
||||
res = PyJitRef_MakeUnique(res);
|
||||
}
|
||||
}
|
||||
else {
|
||||
res = sym_new_not_null(ctx);
|
||||
}
|
||||
l = left;
|
||||
r = right;
|
||||
CHECK_STACK_BOUNDS(1);
|
||||
|
|
|
|||
|
|
@ -2195,24 +2195,24 @@ LONG_FLOAT_ACTION(compactlong_float_true_div, /)
|
|||
|
||||
static _PyBinaryOpSpecializationDescr binaryop_extend_descrs[] = {
|
||||
/* long-long arithmetic */
|
||||
{NB_OR, compactlongs_guard, compactlongs_or},
|
||||
{NB_AND, compactlongs_guard, compactlongs_and},
|
||||
{NB_XOR, compactlongs_guard, compactlongs_xor},
|
||||
{NB_INPLACE_OR, compactlongs_guard, compactlongs_or},
|
||||
{NB_INPLACE_AND, compactlongs_guard, compactlongs_and},
|
||||
{NB_INPLACE_XOR, compactlongs_guard, compactlongs_xor},
|
||||
{NB_OR, compactlongs_guard, compactlongs_or, &PyLong_Type, 1},
|
||||
{NB_AND, compactlongs_guard, compactlongs_and, &PyLong_Type, 1},
|
||||
{NB_XOR, compactlongs_guard, compactlongs_xor, &PyLong_Type, 1},
|
||||
{NB_INPLACE_OR, compactlongs_guard, compactlongs_or, &PyLong_Type, 1},
|
||||
{NB_INPLACE_AND, compactlongs_guard, compactlongs_and, &PyLong_Type, 1},
|
||||
{NB_INPLACE_XOR, compactlongs_guard, compactlongs_xor, &PyLong_Type, 1},
|
||||
|
||||
/* float-long arithemetic */
|
||||
{NB_ADD, float_compactlong_guard, float_compactlong_add},
|
||||
{NB_SUBTRACT, float_compactlong_guard, float_compactlong_subtract},
|
||||
{NB_TRUE_DIVIDE, nonzero_float_compactlong_guard, float_compactlong_true_div},
|
||||
{NB_MULTIPLY, float_compactlong_guard, float_compactlong_multiply},
|
||||
{NB_ADD, float_compactlong_guard, float_compactlong_add, &PyFloat_Type, 1},
|
||||
{NB_SUBTRACT, float_compactlong_guard, float_compactlong_subtract, &PyFloat_Type, 1},
|
||||
{NB_TRUE_DIVIDE, nonzero_float_compactlong_guard, float_compactlong_true_div, &PyFloat_Type, 1},
|
||||
{NB_MULTIPLY, float_compactlong_guard, float_compactlong_multiply, &PyFloat_Type, 1},
|
||||
|
||||
/* float-float arithmetic */
|
||||
{NB_ADD, compactlong_float_guard, compactlong_float_add},
|
||||
{NB_SUBTRACT, compactlong_float_guard, compactlong_float_subtract},
|
||||
{NB_TRUE_DIVIDE, nonzero_compactlong_float_guard, compactlong_float_true_div},
|
||||
{NB_MULTIPLY, compactlong_float_guard, compactlong_float_multiply},
|
||||
{NB_ADD, compactlong_float_guard, compactlong_float_add, &PyFloat_Type, 1},
|
||||
{NB_SUBTRACT, compactlong_float_guard, compactlong_float_subtract, &PyFloat_Type, 1},
|
||||
{NB_TRUE_DIVIDE, nonzero_compactlong_float_guard, compactlong_float_true_div, &PyFloat_Type, 1},
|
||||
{NB_MULTIPLY, compactlong_float_guard, compactlong_float_multiply, &PyFloat_Type, 1},
|
||||
};
|
||||
|
||||
static int
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue