Title: JIT: add _RROT_3 uop to reduce stack moves · Issue #149204 · python/cpython · GitHub
Open Graph Title: JIT: add _RROT_3 uop to reduce stack moves · Issue #149204 · python/cpython
X Title: JIT: add _RROT_3 uop to reduce stack moves · Issue #149204 · python/cpython
Description: Feature or enhancement Proposal: According to @markshannon's note #148816 (comment) Note: It might be worth adding ROT_3 and a RROT_3 uops to use in the optimizer and the peepholer. A SWAP_2; SWAP_3 takes 6 moves, but ROT_3 only takes 4....
Open Graph Description: Feature or enhancement Proposal: According to @markshannon's note #148816 (comment) Note: It might be worth adding ROT_3 and a RROT_3 uops to use in the optimizer and the peepholer. A SWAP_2; SWAP_...
X Description: Feature or enhancement Proposal: According to @markshannon's note #148816 (comment) Note: It might be worth adding ROT_3 and a RROT_3 uops to use in the optimizer and the peepholer. A SWAP_2; S...
Opengraph URL: https://github.com/python/cpython/issues/149204
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"JIT: add _RROT_3 uop to reduce stack moves","articleBody":"# Feature or enhancement\n\n### Proposal:\n\nAccording to @markshannon's note https://github.com/python/cpython/pull/148816#issuecomment-4335369185\n\u003e Note:\nIt might be worth adding `ROT_3` and a `RROT_3` uops to use in the optimizer and the peepholer.\nA `SWAP_2; SWAP_3` takes 6 moves, but `ROT_3` only takes 4.\n\nTwo narrowings:\n- No `_ROT_3` as `_SWAP 2; _SWAP 3` adjacent doesn't exist.\n- No separate peephole pass as it would never fire.\n\n### Has this already been discussed elsewhere?\n\nThis is a minor feature, which does not need previous discussion elsewhere\n\n### Links to previous discussion of this feature:\n\n_No response_\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-149205\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/NekoAsakura","@type":"Person","name":"NekoAsakura"},"datePublished":"2026-04-30T22:52:42.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/149204/cpython/issues/149204"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:26e35650-a600-00e2-d324-0871de413b2b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 80D8:14A013:2325DB9:2F6FD36:6A538DC5 |
| html-safe-nonce | cb53c7d8c1c9d2365efe53ee458bd0429ae827b78c22d84a04328f7d37ddc193 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MEQ4OjE0QTAxMzoyMzI1REI5OjJGNkZEMzY6NkE1MzhEQzUiLCJ2aXNpdG9yX2lkIjoiMzA3Mzk1MDE5OTA5NTQ2MzM2NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 72a279fa5efb64ce77e8308102d69ae51952512963d0e2f832f932f3b68efb98 |
| hovercard-subject-tag | issue:4361743384 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/149204/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b679811cbba55295f2be16ac40baba966f30e482ca4ccbb5839543865522dc81/python/cpython/issues/149204 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b679811cbba55295f2be16ac40baba966f30e482ca4ccbb5839543865522dc81/python/cpython/issues/149204 |
| og:image:alt | Feature or enhancement Proposal: According to @markshannon's note #148816 (comment) Note: It might be worth adding ROT_3 and a RROT_3 uops to use in the optimizer and the peepholer. A SWAP_2; SWAP_... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | NekoAsakura |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width