Skip to content
New issue

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

[mypyc] Add 'bit' primitive type and streamline branching #9606

Merged
merged 13 commits into from
Oct 17, 2020
Merged

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Oct 17, 2020

Add the bit primitive type that only has two valid values: 0 and 1. The existing
boolean primitive type is different as it also supports a third value (for error).
This makes boolean a poor fit for low-level IR operations which never raise an
exception.

Use bit as the result type of comparison operations and various primitives.

Also simplify the branch operation to not have a special mode for branching on
negative values, since it's needlessly ad hoc. Primitives still support this mode,
but it gets converted away during IR building.

Work on mypyc/mypyc#748.

@JukkaL
Copy link
Collaborator Author

JukkaL commented Oct 17, 2020

I'm going to merge this as soon as I have a green build, since this will get stale very quickly. A review would still be appreciated, and I will respond to review feedback in a separate PR if this PR has already been merged.

@JukkaL JukkaL merged commit 5db3e1a into master Oct 17, 2020
@JukkaL JukkaL deleted the mypyc-bit-etc branch October 17, 2020 15:44
Copy link
Collaborator

@TH3CHARLie TH3CHARLie left a comment

Choose a reason for hiding this comment

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

LGTM! Looking forward to seeing its boost on performance

@JukkaL
Copy link
Collaborator Author

JukkaL commented Oct 18, 2020

Looking forward to seeing its boost on performance

This probably has no direct impact of performance, but this will be useful when working on non-C backends.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants