| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| Propagate result type and uniqueness information through | ||
| ``_BINARY_OP_EXTEND`` in the tier 2 optimizer, enabling elimination of | ||
| downstream type guards and selection of inplace float operations. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -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}, | ||
|
Comment thread
Copy link
Copy Markdown
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityThese can return small int too right? In that case, the result would not be unique
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityThe contract is that operations making use of the uniqueness can handle small ints. (The inplace versions of BINARY_ADD_INT handle this for example).
Sorry, something went wrong.
All reactions
|
||
| {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 | ||
| Expand Down | ||
| Back | FazBrowse Home | New Git URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityIsn't this always true?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityYes, here it is. In the pr this was factored out from we had more specializations where this would not always be true.
We can remove it here and add back later. I think it would be needed of we use the binary_op_extend as s mechanism for adding more cases to tier 2 without creating more tier 1 opcodes
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.