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

Rename rdrnd target feature to rdrand #48369

Merged
merged 3 commits into from
Feb 25, 2018
Merged

Rename rdrnd target feature to rdrand #48369

merged 3 commits into from
Feb 25, 2018

Conversation

newpavlov
Copy link
Contributor

Plus minor cleanup.

Related stdsimd issue.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (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.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 20, 2018
// WARNING: the features must be known to LLVM or the feature
// detection code will walk past the end of the feature array,
// leading to crashes.
// WARNING: the features after aplpying `to_llvm_feature` must be known
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: s/aplpying/applying

@nikomatsakis
Copy link
Contributor

r? @nagisa =)

@rust-highfive rust-highfive assigned nagisa and unassigned nikomatsakis Feb 20, 2018
@nikomatsakis
Copy link
Contributor

cc @alexcrichton @BurntSushi

@BurntSushi
Copy link
Member

This seems right to me, and is what Intel refers to upstream. Do we know why LLVM calls this rdrnd?

@nagisa
Copy link
Member

nagisa commented Feb 21, 2018

Looking at the blame, it seems that rdrnd was chosen to match what gcc and clang "use" (before 2013 the feature was named rdrand). Clang probably copied the name from GCC and it is probable that GCC implemented this feature before the RDRAND name was widespread/confirmed/etc.

@nagisa
Copy link
Member

nagisa commented Feb 21, 2018

This is the commit.

@BurntSushi
Copy link
Member

Ug, so you're saying other compiler front ends use rdrnd instead of rdrand? To me, that makes this a harder decision. So I think our choices are:

  1. Conform with what people expect using other popular compilers. (Accept only rdrnd.)
  2. Conform with upstream vendors. (Accept on rdrand.)
  3. Conform to both. (Accept rdrnd or rdrand as aliases of one another.)

I'm not really a fan of any of these, but I feel myself leaning toward (1).

@newpavlov
Copy link
Contributor Author

@alexcrichton opinion was to follow vendor names.

@nagisa
Copy link
Member

nagisa commented Feb 21, 2018

@newpavlov that was an opinion in context of llvm vs vendor and not gcc/clang vs vendor, though.

I can say for sure that I was super surprised that +rdrand didn’t work and took me a while to figure out that it is in fact +rdrnd, so I’m certainly in favour of this change.

@newpavlov
Copy link
Contributor Author

@nagisa
I believe pclmul was chosen by LLVM over pclmulqdq for the same reasons as rdrnd over rdrand. In other words "lvm vs vendor" looks like is equivalent to "gcc/clang vs vendor", as clang follows gcc and in turn LLVM follows clang.

@nagisa
Copy link
Member

nagisa commented Feb 22, 2018

@bors r+

@bors
Copy link
Contributor

bors commented Feb 22, 2018

📌 Commit a33c1da has been approved by nagisa

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 22, 2018
@BurntSushi
Copy link
Member

BurntSushi commented Feb 22, 2018

I'm still not convinced that this is the right path to take. Being different from the vendor stinks, but being different from other mainstream compiler front ends also stinks (which is very different from eschewing LLVM names specifically, which I'd be totally fine with). I didn't see any consideration given to supporting both?

@nagisa
Copy link
Member

nagisa commented Feb 22, 2018

@BurntSushi well, it is something relevant to more than just rdrand, and is something we should decide about in context of all features. If we decide to have aliases for compatibility with other compilers, we can simply add the cases for all the features at the same time.

Manishearth added a commit to Manishearth/rust that referenced this pull request Feb 25, 2018
Rename rdrnd target feature to rdrand

Plus minor cleanup.

Related stdsimd [issue](rust-lang/stdarch#325).
kennytm added a commit to kennytm/rust that referenced this pull request Feb 25, 2018
Rename rdrnd target feature to rdrand

Plus minor cleanup.

Related stdsimd [issue](rust-lang/stdarch#325).
bors added a commit that referenced this pull request Feb 25, 2018
Rollup of 17 pull requests

- Successful merges: #47964, #47970, #48076, #48115, #48166, #48281, #48297, #48302, #48362, #48369, #48489, #48491, #48494, #48517, #48529, #48235, #48330
- Failed merges:
@bors bors merged commit a33c1da into rust-lang:master Feb 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants