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

core::arch::x86_64::_mm_shuffle_ps input doesn't match official docs #62490

Closed
Lokathor opened this issue Jul 8, 2019 · 8 comments · Fixed by #75009
Closed

core::arch::x86_64::_mm_shuffle_ps input doesn't match official docs #62490

Lokathor opened this issue Jul 8, 2019 · 8 comments · Fixed by #75009
Assignees
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools A-intrinsics Area: Intrinsics E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@Lokathor
Copy link
Contributor

Lokathor commented Jul 8, 2019

x86_64::_mm_shuffle_ps (and by extension x86::_mm_shuffle_ps) have i32 as the mask type, but the intel intrinsics guide lists unsigned int as the mask type.

This issue has been assigned to @georgio via this comment.

@hellow554
Copy link
Contributor

Hey @Lokathor 👋

I (I think we all) very much appreciate the work you are doing by looking at the docs and finding unsound things. What about opening a PR and fixing them immediatly (some of them could be done by using the github editor)? It's a very great opportunity to make Rust a better programming langauge.

If you feel like it, please open a PR and reference this issue with one of the closing keywords github provides.

@Lokathor
Copy link
Contributor Author

Lokathor commented Jul 8, 2019

I am well aware of how GitHub works :D unfortunately for us all, I only have so much programming time. I've been busy at work safe wrapping all these intrinsics for my own lib, which is why I'm filing bugs on them as they come up. However, in my experience, filing even a single PR to this repo is rather involved and so I've mostly given up on doing it.

As to this particular issue, it's a change to a stable API, so at minimum a full crater run would have to be performed of course. The input mask value has to be a const, so you get a lot of literals of course and those can usually infer to the new type fine, but you also get a lot of const declarations too, which would break. I suspect that at least some people will get their code broken. Given that the intrinsic only uses the 8 lowest bits, it would be entirely reasonable for T-libs to say they don't care about the i32/u32 difference compared to code breaks and just document the (very minor) difference.

or they could go for absolute exactness and declare the breaks to be the fair product of a bug fix.

up to them

@nikic
Copy link
Contributor

nikic commented Jul 8, 2019

I believe this was changed recently because Intel's definition is wrong/inconsistent. See rust-lang/stdarch#522.

@Lokathor
Copy link
Contributor Author

Lokathor commented Jul 8, 2019

ah lovely. of course the guide is wrong :P

well, then consider this a minor documentation issue. the function should simply explain that it doesn't match the spec and why and such.

@Centril Centril added A-intrinsics Area: Intrinsics A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. labels Aug 6, 2019
@afnanenayet
Copy link
Contributor

I could take this!

@rustbot claim

@rustbot rustbot self-assigned this Jan 4, 2020
@jonas-schievink jonas-schievink added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Mar 6, 2020
@JohnTitor
Copy link
Member

Triage: I'm going to release assignment due to inactivity.
@afnanenayet If you're still interested in this, feel free to re-claim.
@rustbot release-assignment

@rustbot rustbot removed their assignment Jul 24, 2020
@georgio
Copy link
Contributor

georgio commented Jul 31, 2020

@rustbot claim

@georgio
Copy link
Contributor

georgio commented Jul 31, 2020

I have submitted rust-lang/stdarch#879 in order to fix this. I believe we could resolve this issue once that PR is merged by updating the submodule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools A-intrinsics Area: Intrinsics E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants