◐ Shell
reader mode source ↗
Skip to content

Add file describing how to add or modify specialized families of instructions.#26954

Merged
markshannon merged 3 commits into
python:mainfrom
faster-cpython:add-specialization-guide
Jul 1, 2021
Merged

Add file describing how to add or modify specialized families of instructions.#26954
markshannon merged 3 commits into
python:mainfrom
faster-cpython:add-specialization-guide

Conversation

@markshannon

@markshannon markshannon commented Jun 29, 2021

Copy link
Copy Markdown
Member

We've had a few contributors wanting to implement specialized instructions.
To help out those contributors, I thought it would be useful add a "how to" describing the process.

@Fidget-Spinner Fidget-Spinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hide comment

LGTM. I noticed some of the lower level implementation details aren't described (like the code and data layout, being positive and negative indexes on a contiguous array). But those will probably change quite a bit over time, so I think it's fine to omit them.

@gvanrossum gvanrossum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hide comment

Can you fold lines longer than 80 characters?

Adding more code examples would make the doc more accessible. At the very least indicate where to find the examples you do mention in the source code.

@pablogsal

Copy link
Copy Markdown
Member

I would advice to copy/move this guide to https://github.com/python/devguide as this is going to be much more visible there than a readme in the Python directory.

@gvanrossum

Copy link
Copy Markdown
Member

I would advice to copy/move this guide to https://github.com/python/devguide as this is going to be much more visible there than a readme in the Python directory.

Not clear that we need to give it much visibility though. There are probably only 20-30 opcodes that are candidates for specialization and only very few people (including everyone reading this PR :-) will need it. There are other readmes sprinkled throughout the code for similarly obscure things.

Maybe there should be a mention of this readme in ceval.c or specialize.c though?

@pablogsal

pablogsal commented Jun 29, 2021

Copy link
Copy Markdown
Member

Maybe there should be a mention of this readme in ceval.c or specialize.c though?

Right, that is probably a much better approach than the devguide 👍

@gvanrossum gvanrossum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hide comment

Let's land this!

@markshannon markshannon reopened this Jun 30, 2021
@markshannon markshannon merged commit 3623aaa into python:main Jul 1, 2021
@markshannon markshannon deleted the add-specialization-guide branch January 6, 2022 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants