Skip to content

Bit-magic for faster is_char_boundary #32862

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

Merged
merged 1 commit into from
Apr 12, 2016
Merged

Conversation

raphlinus
Copy link
Contributor

The asm generated for b < 128 || b >= 192 is not ideal, as it computes
both sub-inequalities. This patch replaces it with bit magic.

Fixes #32471

The asm generated for b < 128 || b >= 192 is not ideal, as it computes
both sub-inequalities. This patch replaces it with bit magic.

Fixes rust-lang#32471
@rust-highfive
Copy link
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@bluss
Copy link
Member

bluss commented Apr 10, 2016

Thank you!

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Apr 10, 2016

📌 Commit b2db973 has been approved by bluss

@frewsxcv
Copy link
Member

Is this a bug in the optimizer?

@raphlinus
Copy link
Contributor Author

@frewsxcv It's an area where the optimizer could be improved, but I'm not sure I'd go so far as to call it a bug. It's a pretty specialized transformation.

steveklabnik added a commit to steveklabnik/rust that referenced this pull request Apr 11, 2016
Bit-magic for faster is_char_boundary

The asm generated for b < 128 || b >= 192 is not ideal, as it computes
both sub-inequalities. This patch replaces it with bit magic.

Fixes rust-lang#32471
@alexcrichton
Copy link
Member

Neat!

bors added a commit that referenced this pull request Apr 11, 2016
Rollup of 9 pull requests

- Successful merges: #32768, #32802, #32815, #32823, #32849, #32854, #32862, #32870, #32873
- Failed merges:
@bors bors merged commit b2db973 into rust-lang:master Apr 12, 2016
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.

6 participants