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

Make floating point intrinsics generic #29792

Closed
wants to merge 3 commits into from

Conversation

Jeffrharr
Copy link

Bring floating point intrinsics in line with other generic intrinsics such as integer generics in #29316

@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 @brson (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. 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.

@@ -1 +1 @@
Subproject commit cde1ed3196ba9b39bcf028e06e08a8722113a5cb
Subproject commit 62ad301a2407a7aca50c1d5120c63597d676d29f
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this patch need to change the llvm submodule, or is this an accident?

Copy link
Author

Choose a reason for hiding this comment

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

this is an accident; fixing

@brson
Copy link
Contributor

brson commented Nov 12, 2015

What is the motivation for doing this? I see a lot of snapshot churn without clear benefit.

cc @alexcrichton

@brson
Copy link
Contributor

brson commented Nov 12, 2015

Looks like it makes the implementation simpler perhaps? I'll just let r? @alexcrichton review.

@rust-highfive rust-highfive assigned alexcrichton and unassigned brson Nov 12, 2015
pub fn log10f64(x: f64) -> f64;
/// Returns the base 10 logarithm of a foating point of type `T`.
#[cfg(not(stage0))]
pub fn log10<T>(x: T) -> T;
Copy link
Member

Choose a reason for hiding this comment

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

To cut down on the annotation burden here, could you extract all the intrinsics to their own extern "rust-intrinsic" blocks? That way the cfg annotations should only be needed once.

@alexcrichton
Copy link
Member

cc @rust-lang/compiler about changes to intrinsics

@nikomatsakis
Copy link
Contributor

seems like a @rust-lang/lang question too

@nikomatsakis
Copy link
Contributor

I guess given that this is what we do for integer intrinsics, it seems ok. I'm not wild about it but these aren't stable or anything like that, so...

@nikomatsakis
Copy link
Contributor

...to be clear, what I'm not wild about is not this patch, per se, but the kind of ad-hoc monomorphization rules that are not captured by a trait. But we have this a fair amount in intrisics (e.g., transmute, but more germanely, the integer and SIMD intrinsics), so I think it's ok to continue in this vein. If we decide to address this problem we can still do it later.

@steveklabnik
Copy link
Member

Any feedback on this PR so it can move forward?

pub fn expf64(x: f64) -> f64;
/// Returns the exponential of a foating point of type `T`.
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/foating/floating/

@nikomatsakis
Copy link
Contributor

I'm fine with it, seems better to align these intrinsics with the integer ones.

@bors
Copy link
Collaborator

bors commented Jan 12, 2016

☔ The latest upstream changes (presumably #30719) made this pull request unmergeable. Please resolve the merge conflicts.

@Jeffrharr
Copy link
Author

Apologies on disappearing for a while. It seems that most people are fine with this, so I'm going to go ahead and make the requested changes.

@alexcrichton
Copy link
Member

Closing due to inactivity, but feel free to resubmit with a rebase!

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.

8 participants