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

Adding bit manipulation intrinsics: #20

Closed
3 tasks
gnzlbg opened this issue Sep 19, 2017 · 3 comments
Closed
3 tasks

Adding bit manipulation intrinsics: #20

gnzlbg opened this issue Sep 19, 2017 · 3 comments

Comments

@gnzlbg
Copy link
Contributor

gnzlbg commented Sep 19, 2017

I could add the bit manipulation intrinsics from the bitintr library to this one. I have two questions:

  • IIUC the intrinsics here should be marked with #[target_feature] and be unsafe, that is, they are guaranteed to generate the right CPU instructions on the targets that support a feature. Portability is left to third-party crates, is this correct?
  • Given the organization in this crate, I would be adding the following modules (do they make sense?):
    • x86::{bmi1, bmi2, abm, tbm}
    • arm::{v5, v6, v7, v8}
  • Should the crate be renamed to something else?
@BurntSushi
Copy link
Member

Should the crate be renamed to something else?

I commented on that here: #11 (comment)

Given the organization in this crate, I would be adding the following modules (do they make sense?):

Yeah that layout seems fine. Note that I only have x86 so far, and I don't have a good process for testing other platforms yet. I'm tracking that in #13.

IIUC the intrinsics here should be marked with #[target_feature] and be unsafe, that is, they are guaranteed to generate the right CPU instructions on the targets that support a feature. Portability is left to third-party crates, is this correct?

We did land on unsafe then? I just forgot. Yeah that probably means all of the vendor intrinsics need to be transitioned to unsafe as well, but you don't have to do that. I'm tracking that in #21.

But yes, otherwise, portability is left to other crates for now.

@alexcrichton
Copy link
Member

@gnzlbg is this issue mostly done now?

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Sep 26, 2017

Yes, this is finished.

@gnzlbg gnzlbg closed this as completed Sep 26, 2017
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

No branches or pull requests

3 participants